Skip to main content
All endpoints take an x-api-key header, provisioned during onboarding. Everything below is about the signed message that goes with it.

Signing Requests

Every endpoint except POST /commit and POST /borrow/commit requires a signed message proving ownership of user_address. Sign with the user’s Solana keypair (Ed25519) and base64-encode the result. Use the current Unix timestamp in milliseconds. Every message shares the same prefix; only the Details: line changes:
The formats are not interchangeable. The order of the values differs between them - timestamp is second from last in the trade and lending formats, but last in the withdraw and settle formats - and two endpoints take the result as signature rather than user_signature. Check the exact format below for the endpoint you are calling.

Read Signing Format

Used by /account/balances, /account/points, /account/pending, /borrow/pending, and /borrow/positions.
  • Pass as signature - except on /borrow/positions, which takes the same message as user_signature
  • Accepted within 24 hours of the signed timestamp

Trade Signing Format

Used by POST /trade/create.
  • Pass as user_signature
  • timestamp is second from last, before jito_tip_amount

Withdraw Signing Format

Used by POST /withdraw/create.
  • Pass as user_signature
  • timestamp is last

One-Time Wallet Signing Format

Used by POST /borrow/smart-wallet, which creates the one-time wallet a borrowing position lives in. Getting a wallet for a trade is unsigned - GET /trade/one-time-wallet needs only the API key.
  • Pass as user_signature
  • Valid for 10 minutes

Lending Signing Format

Used by POST /borrow/initiate.
  • Pass as user_signature
  • Valid for 10 minutes
  • Same value order as the trade format, with smart_wallet_id first: timestamp before jito_tip_amount

Settle Signing Format

Used by POST /borrow/settle.
  • Pass as user_signature
  • Valid for 10 minutes
  • timestamp is last here, unlike the lending format, and there is no tip value
  • cleanup_leftover_sol is rendered as it appears in the JSON body (true or false)

Signing in Code

One helper covers every format - build the Details: line and pass it in.
Every value you sign must exactly match the value you send in the request body. On the lending endpoints, a timestamp outside its window is rejected with 400, while a mismatched message or the wrong signing key returns 401 - see Handling 401.

Next Steps

  • Trading - Deposit, trade privately, and withdraw.
  • Lending - Open a position, use the funds, then settle.