What you can do
| earn-deposit | Deposit a token into Jupiter Earn | POST https://api.jup.ag/lend/v1/earn/deposit with the wallet and amount (x-api-key header); sign the returned transaction and send it. Or call deposit_with_min_amount_out on the Earn program. |
| earn-withdraw | Withdraw a token from Jupiter Earn | POST /lend/v1/earn/withdraw (or redeem with a share amount); sign and send the returned transaction. |
| vault-borrow | Open or change a borrow position in a Vaults (Borrow) vault | init_position once, then operate(new_col, new_debt, ...) with signed amounts. Read the vault's exchange prices and ticks first. Build the call with the Jupiter Lend SDK or the official IDL; do not hand-encode the remaining accounts. |
Borrowing can be liquidated when a vault position becomes undercollateralized. Liquidation takes collateral at a discount.
Earn deposits are exposed to the strategies and lending markets behind the vault. Yield is not guaranteed and withdrawals can be limited by available liquidity.
Oracle and price risk: vault values depend on oracle prices.
Programs are upgradeable and the IDL can change. Build from the current IDL or API output, not from a cached copy.
Contracts
Read any function, or build a write and sign it. Amounts are in base units (1 USDC = 1000000).Jupiter Lend Earn programvault on solanajup3YeL8QhtSx1e253b2FDvsMNC87fDrgQZivbrndc9
write deposit(assets: u64)
Deposit an exact amount of the underlying token into Earn and receive fToken shares. assets is in base units of the underlying mint.
write deposit_with_min_amount_out(assets: u64, min_amount_out: u64)
Same as deposit, but fails if fewer than min_amount_out shares are received. Use this to protect against a rate change between quote and execution.
write mint(shares: u64)
Mint an exact number of fToken shares, paying the underlying token needed for them.
write mint_with_max_assets(shares: u64, max_assets: u64)
Mint an exact number of shares, failing if more than max_assets of the underlying would be spent.
write withdraw(amount: u64)
Withdraw an exact amount of the underlying token by burning the needed shares. amount is in underlying base units.
write withdraw_with_max_shares_burn(amount: u64, max_shares_burn: u64)
Withdraw an exact amount of underlying, failing if more than max_shares_burn shares would be burned.
write redeem(shares: u64)
Burn an exact number of fToken shares and receive the underlying token.
write redeem_with_min_amount_out(shares: u64, min_amount_out: u64)
Redeem shares, failing if less than min_amount_out of the underlying is received.
Jupiter Lend Vaults program (Borrow)vault on solanajupr81YtYssSyPt8jbnGuiWon5f6x9TcDEFxYe3Bdzi
write init_position(vault_id: u16, next_position_id: u32)
Create a borrow position in a vault. Needed before the first operate call for a new position.
write operate(new_col: i128, new_debt: i128, transfer_type: Option<TransferType>, remaining_accounts_indices: bytes)
Change a position's collateral and debt in one call. new_col and new_debt are signed amounts: positive adds collateral or borrows debt, negative withdraws collateral or repays debt. Check the vault docs for the exact sign and unit convention before sending.
write operate_dex(col_amounts: Option<OperateDexColAmounts>, debt_amounts: Option<OperateDexDebtAmounts>, transfer_type: Option<TransferType>, remaining_accounts_indices: bytes)
Operate on a DEX-type vault (collateral and debt split across two tokens). Amounts are passed as structured arguments.
write operate_perfect_dex(col_amounts: Option<OperatePerfectDexColAmounts>, debt_amounts: Option<OperatePerfectDexDebtAmounts>, transfer_type: Option<TransferType>, remaining_accounts_indices: bytes)
Operate on a DEX-type vault with perfect (balanced) amounts. Same accounts model as operate_dex.
write liquidate(debt_amt: u64, col_per_unit_debt: u128, absorb: bool, transfer_type: Option<TransferType>, remaining_accounts_indices: bytes)
Liquidate an unhealthy position: repay debt_amt and receive collateral at the liquidation discount. absorb is a boolean flag for the bad-debt handling path. Liquidators only.
write liquidate_dex(debt_amt: u64, debt_amounts: Option<LiquidateDexDebtAmounts>, col_per_unit_debt: u128, col_amounts: Option<LiquidateDexColAmounts>, absorb: bool, transfer_type: Option<TransferType>, remaining_accounts_indices: bytes)
Liquidation for DEX-type vaults with per-token amounts.
write rebalance()
Rebalance the vault's DEX liquidity (no arguments). Not meant for ordinary borrowers; check the IDL for who is allowed to call it.
read get_exchange_prices()
Read the current exchange prices used for vault accounting. Simulate to read the result without sending.
write init_tick(vault_id: u16, tick: i32)
Create a tick account for a price tick in the vault. Positions use ticks, so the tick account must exist before a position uses that tick.
Jupiter Lend Liquidity programpool on solanajupeiUmn818Jg1ekPURTpr4mFo29p46vygyykFJ3wZC