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 for ATA creation. Required the first time the position uses a token - one ATA costs about 2039280 lamports - with any unused amount refunded. Pass 0 when the wallet already holds enough. Can be provided as a string or a number

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

Jito tip in lamports. Only applied when the transaction overflows Solana's size limit and a two-transaction bundle is used, 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

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