What is Multiply?
Multiply creates leveraged positions in a single atomic transaction by automating the looping process through flash loans. Instead of manually executing 8-10 separate deposit-borrow-swap cycles, Multiply collapses the entire leverage-building process into one transaction that either succeeds completely or reverts with no state changes.Borrow and Multiply SDK Methods
Multiply operations use
MultiplyObligation. Standard borrow operations use VanillaObligation. The obligation type determines which PDA is derived for your position.Borrow and Multiply: Rust Crate Helpers
The Rustklend-interface crate exposes the lending primitives and flash loans, but does not include leveraged combo helpers.
Leveraged combo operations (
getDepositWithLeverageIxs, getWithdrawWithLeverageIxs, getRepayWithCollIxs) are not available in the Rust crate — they bundle flash loans with KSwap routing, which only the TypeScript SDK builds.SDK vs API vs Rust Crate: What’s Available
Understanding which operations are reachable from the SDK, the API, and the Rust crate is critical for building Multiply integrations.Flash Loans
A flash loan is an uncollateralized loan that must be borrowed and fully repaid within the same transaction block. This atomic property makes flash loans risk-free for the protocol.Flash Loan Properties
If a flash loan cannot be repaid — due to slippage, insufficient liquidity, or any other failure — the entire transaction reverts. No intermediate state is committed to the blockchain.
Looping: Manual vs Atomic
Looping is the process of repeatedly depositing collateral, borrowing against it, and reinvesting the borrowed funds to amplify exposure. The method determines risk, cost, and execution complexity.Comparison Table
The Multiply Transaction Flow
Multiply executes leverage creation in a precise sequence of steps within a single atomic transaction.1
Flash Borrow
Protocol borrows the required debt token amount (e.g., SOL) via flash loan. No collateral is required.
2
Swap to Collateral
Flash-borrowed funds are swapped into the target collateral asset (e.g., SOL → JitoSOL) using Kamino Swap (KSwap) with multi-DEX routing for optimal execution.
3
Deposit Collateral
The full collateral amount (user deposit + swapped amount) is deposited into Kamino Lend as collateral.
4
Borrow Against Collateral
With collateral deposited, the protocol borrows the debt token against the collateral position.
5
Repay Flash Loan
Borrowed funds are used to repay the flash loan plus the 0.001% fee.
6
Position Established
Net result: Leveraged position with amplified collateral exposure and outstanding debt balance recorded on Kamino Lend.
All steps execute in a single transaction. If any step fails (slippage exceeds tolerance, insufficient liquidity, etc.), the entire transaction reverts and no position is created.