Skip to main content
POST
Open Position

Authorizations

x-api-key
string
header
required

Body

application/json

Details of the request to open a position.

smart_wallet_id
integer
required

Identifier of the one-time wallet the funds are advanced into, returned by the /borrow/smart-wallet endpoint. Must belong to user_address.

Example:

4821

user_address
string
required

The Solana wallet address of the user opening the position.

source_token_address
string
required

The address of the token being advanced into the one-time wallet. Wrapped SOL is normalised to native SOL after the signature check.

amount
required

The amount to advance into the one-time wallet, expressed in the smallest unit (e.g., lamports for SOL). Must be greater than 0. Can be provided as a string or a number

Pattern: ^[0-9]+$
loan_additional_sol
required

Additional SOL (in lamports) advanced alongside the token, typically used for ATA creation and account initialization. The one-time wallet starts empty, so this is required the first time the position uses a given token: one ATA costs approximately 2039280 lamports. Pass 0 when the wallet already holds enough. Can be provided as a string or a number

Pattern: ^[0-9]+$
jito_tip_amount
required

The amount of Jito tip, expressed in the smallest unit (e.g., lamports for SOL). Only applied when the wrapped transaction overflows Solana's size limit and a two-transaction bundle is used instead, but always required - it is part of the signed message either way. Can be provided as a string or a number

Pattern: ^[0-9]+$
main_tx
string
required

Serialized or encoded transaction data carrying your own deposit or open instructions. The transaction must be provided unsigned, with the one-time wallet address set as the signer.

timestamp
required

Unix timestamp of when the position was opened (in milliseconds). Must be within 10 minutes of server time. Can be provided as a string or a number

Pattern: ^[0-9]+$
user_signature
string
required

A digital signature of 'By signing, I hereby agree to Vanish's Terms of Service and agree to be bound by them (docs.vanish.trade/legal/TOS)

Details: borrow:{smart_wallet_id}:{source_token_address}:{amount}:{loan_additional_sol}:{timestamp}:{jito_tip_amount}', signed by the user's wallet.

Response

Successful lending action response.

action_id
integer
required

Identifier of this lending or settle action.

Example:

88213

tx_id
string
required

Transaction signature of the action. Poll it via /borrow/commit.

transaction
string | null

Base64-encoded signed transaction for you to broadcast. Null when Vanish submitted a Jito bundle instead; always populated for settle.

jito_bundle_id
string | null

If the wrapped transaction was too large for a single transaction and Vanish submitted a two-transaction Jito bundle, its bundle ID; otherwise null. When set, there is nothing for you to broadcast. Always null for settle.