Skip to content

Withdraw

This endpoint allows you to request an on-chain withdrawal payload for a trading vault.

Request URL

https://ddp.definitive.fi/v1/trade/withdraw

Request Body

{
  "portfolioID":    "00000000-0000-0000-0000-000000000001", // UUID
  "chain":          "solana",                               // one of the strings above
  "asset":          "xxxxx",                                // token mint or contract address
  "amount":         "1.0",                                  // decimal string
  "walletAddress":  "H3xZ6EqeGABRk1x...",                   // your wallet addr
  "sponsorAddress":  ""                                     // optional if you would like to sponser
}

Response SVM (Solana)

{
  transaction:    "base64-encoded-transaction",
  transactionFee: "0.0005"
}

Example

const resp = await AuthHelpers.signAndSend({
  path: "/v1/trade/withdraw",
  method: "POST",
  apiKey: API_KEY,
  apiSecret: API_SECRET,
  body: {
    portfolioID: "00000000-0000-0000-0000-000000000001",
    chain: "solana",
    asset: "So11111111111111111111111111111111111111112",
    amount: "1",
    walletAddress: "H3xZ6EqeGABRk1x...",
    sponsorAddress: "H3xZ…AbC123",
  },
});