Skip to main content
Create a borrow position, deposit collateral, and borrow assets from Jupiter Lend vaults using Privy embedded wallets. The full flow uses two transactions: one to create a position and deposit collateral, and one to borrow.

Prerequisites


Create Position and Deposit Collateral

1

Import Dependencies

2

Configure Privy and Initialise Client

Set up your Privy credentials, Solana connection, and borrow parameters.
AUTH_KEY_ID identifies the authorization key (from dashboard/API), AUTH_KEY_PRIVATE is the P-256 private key used for signing. See the Privy authorization keys docs for setup.
3

Get Wallet Address

4

Build Create Position + Deposit Instructions

Pass positionId: 0 to create a new position and deposit collateral in a single transaction. The SDK returns nftId for future operations.
Save nftId for subsequent operations (borrow, repay, withdraw). With positionId: 0, the SDK batches position creation and collateral deposit into one transaction.
5

Build and Sign Transaction

Borrow transactions use versioned (v0) format with address lookup tables.
6

Send Transaction


Borrow Against Collateral

Once you have a position with deposited collateral, borrow assets against it.
1

Build Borrow Instructions

Use the nftId from the previous step as positionId. Set colAmount to 0 and debtAmount to the borrow amount.
Your borrow capacity depends on collateral value and the vault’s LTV limits. Monitor your position to avoid liquidation.
2

Build, Sign, and Send

The borrowed tokens are now in the Privy wallet. Repay with the standard Repay flow using the same positionId.

Operate Parameters

getOperateIx accepts the following parameters:

Earn with Privy

Deposit and withdraw with Privy wallets

Deposit Collateral

Standard collateral deposit with keypair signing