LoopscaleClient. Unlike the other integrations that start from createVaultSyncTransaction directly, Loopscale flows start from raw Loopscale API responses and then turn those responses into executable vault transactions.
Loopscale exposes two distinct Strategy Vault surfaces:
- Lender-side strategy flows — create, fund, update, withdraw from, and close a Loopscale strategy
- Borrower-side loan flows — create a loan, deposit collateral, borrow principal, repay, withdraw collateral, and close the loan
How co-signing works
Loopscale transaction flow is slightly different from the other Strategy Vault integrations:- Loopscale constructs the transaction flow through its API.
- The SDK turns that raw response into manager-facing vault transactions and signs them locally.
- If a transaction is flagged with
requiresLoopscaleCoSign, send that transaction toclient.coSign(...). - Submit the returned co-signed transaction on-chain.
If you need more detail on Loopscale-specific mechanics, markets, or transaction endpoints, visit the Loopscale Docs.
Loopscale client
Create a client once and reuse it across your strategy or loan flow:Choose an execution path
Loopscale transaction methods return raw Loopscale responses. After each call, choose one of two execution paths.Prepare appendable transactions
UseprepareVaultTransactions(...) when you want lower-level transaction pieces that you can compose yourself.
setupInstructions— send these first when presentinstructions— the main instruction list for the stepsigners— any extra local signers required for the stepaddressLookupTableAddresses— lookup tables needed to compile the transactionrequiresLoopscaleCoSign— whether the main transaction still needsclient.coSign(...)
Build ready-to-send transactions
UsebuildVaultTransactions(...) when you want locally signed VersionedTransactions that are ready to send.
requiresLoopscaleCoSign is the exact boundary for Loopscale MPC signing. Only call coSign(...) for transactions flagged true.
buildVaultTransactions(...) requires context.signers[0] to match context.signer.If you are already using VaultTransactionBuilder, pass the raw response to
addLoopscaleResponse(...) and let result.send() handle any required Loopscale co-signing.Create strategy
createStrategy(...) returns a raw Loopscale batch response. The response itself is enough to execute the create flow. If you want to keep the created strategy address for later calls, you can extract it from the response.
Parameters
A matching policy must exist before executing. See Policy Builders. See also Loopscale: Create Strategy for API details.
Deposit strategy
Parameters
A matching policy must exist before executing. See Policy Builders. See also Loopscale: Deposit Strategy for API details.
Update strategy
updateStrategy(...) also accepts collateralTerms when you need to change collateral matrices or duration / APY settings.
Parameters
A matching policy must exist before executing. See Policy Builders. See also Loopscale: Update Strategy for API details.
Withdraw strategy
Parameters
A matching policy must exist before executing. See Policy Builders. See also Loopscale: Withdraw Strategy for API details.
Close strategy
Parameters
A matching policy must exist before executing. See Policy Builders. See also Loopscale: Close Strategy for API details.
Create loan
createLoan(...) returns a raw Loopscale response plus a loanAddress string you can use immediately in follow-up calls.
Parameters
A matching policy must exist before executing. See Policy Builders. See also Loopscale: Create Loan for API details.
Deposit collateral
Parameters
A matching policy must exist before executing. See Policy Builders. See also Loopscale: Deposit Collateral for API details.
Borrow principal
Before you request a borrow, inspect the available Loopscale lending options for the principal, collateral, and duration you want to use. In the SDK, the usual discovery calls are:getQuotes(...)when you want a list of current lend orders for a principal / collateral / duration combinationgetMaxQuote(...)when you already know the collateral input and want the top matching quote for that borrow
borrowPrincipal(...).
Parameters
A matching policy must exist before executing. See Policy Builders. See also Loopscale: Borrow Principal for API details.
If you need more detail on Loopscale-specific market discovery and borrow selection, visit the Loopscale Docs. The official data endpoints are Get quotes and Get best quote.
Repay loan
repayLoanSimple(...) builds the raw repay_simple Loopscale response.
Parameters
A matching policy must exist before executing. See Policy Builders. See also Loopscale: Repay Loan for API details.
Withdraw collateral
Parameters
A matching policy must exist before executing. See Policy Builders. See also Loopscale: Withdraw Collateral for API details.
Close loan
Parameters
A matching policy must exist before executing. See Policy Builders. See also Loopscale: Close Loan for API details.
Practical notes
createStrategy(...)can be executed directly from its raw response. UseextractCreatedStrategyAddress(...)only when you want to reference the created strategy later.createLoan(...)returns a raw response plusloanAddress, so you can construct the loan public key immediately.- Only call
coSign(...)for transactions flagged withrequiresLoopscaleCoSign === true. - Split lender-side strategy actions and borrower-side loan actions into separate Loopscale policies when you configure the vault.