Skip to main content
Continues from Setup, using the vanish, signMessage, broadcast, and commit helpers defined there.

Open a Position

Vanish moves part of the user’s balance into a one-time wallet and executes your instructions from it in the same transaction.
1

Get a one-time wallet for the position

protocol_label names the provider and is part of the signed message. Store smart_wallet_id - every later call on this position uses it.
2

Build your instructions

Assemble the instructions that deploy the funds into a single unsigned transaction, with the position’s one-time wallet as signer and fee payer.
3

Open the position and commit

loan_additional_sol covers ATA rent the first time the position uses a token - one account costs about 2039280 lamports, and any unused amount is refunded.The funds now sit in the position’s one-time wallet, and the position is open until you settle it.

Settle the Position

Settling returns the funds and, with cleanup_leftover_sol, closes the position. Build main_tx as before, using your withdraw or close instructions.
amount is what your instructions leave in the wallet, which need not match what you advanced. Set cleanup_leftover_sol only on the settle that closes the position. The settle message carries cleanup_leftover_sol and ends with timestamp: settle:{smart_wallet_id}:{token_address}:{amount}:{loan_additional_sol}:{cleanup_leftover_sol}:{timestamp}.

Next Steps

  • Lending - The full reference for the lending and settle flows, and reading position state.
  • Trade - Execute a private trade against the same funded balance.
  • Error Handling - Commit statuses and recovering interrupted flows.