Skip to main content
POST
Settle Position

Authorizations

x-api-key
string
header
required

Body

application/json

Details of the settle request.

smart_wallet_id
integer
required

Identifier of the one-time wallet holding the position. Must belong to user_address.

Example:

4821

user_address
string
required

The Solana wallet address of the user settling the position.

token_address
string
required

The address of the token expected to land back in the one-time wallet from your instructions. Wrapped SOL is normalised to native SOL after the signature check.

amount
required

The amount being settled, 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 this settle if the one-time wallet is running low. Pass 0 when it already holds enough. Can be provided as a string or a number

Pattern: ^[0-9]+$
cleanup_leftover_sol
boolean
required

When true, any SOL left in the one-time wallet after this settle lands is returned to Vanish's trading accounts and credited to the user, and the position is closed. Only set this on the settle that fully closes the position - a partial withdrawal still needs the remaining SOL.

main_tx
string
required

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

timestamp
required

Unix timestamp of when the settle was initiated (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: settle:{smart_wallet_id}:{token_address}:{amount}:{loan_additional_sol}:{cleanup_leftover_sol}:{timestamp}', signed by the user's wallet.

Response

Successful settle 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.