Deposit Collateral
Deposit assets as collateral to enable borrowing.1
Import Dependencies
2
Load Market and Initialize RPC
3
Build Deposit Instructions
Deposit USDC as collateral into the wallet’s borrow position.A market can hold several reserves for the same token: one variable-rate reserve plus fixed-rate reserves. Actions take a reserve address, and
getExistingFloatRateReserveByMint() returns the variable-rate one. skipLutCreation: true keeps a first deposit, including user account setup, in one transaction; without it the deposit fails with 0x17a3.4
Build the Transaction
5
Borrow Assets
Borrow assets against your deposited collateral.1
Import Dependencies
2
Load Market and Initialize RPC
3
4
Build Borrow Instructions
Borrow USDT from its variable-rate reserve against the collateral.The borrow must keep the position under its borrow limit, or the program rejects it.
5
Build the Transaction
6