Vaults

Build a withdrawal transaction

Returns the transaction the LP signs and sends to withdraw free principal from an asset vault.

POST
/api/vaults/{chainId}/{asset}/prepare-withdraw

Authorization

ApiKeyAuth
X-API-Key<token>

Your API key. Authorizing a swap or opening a market takes a key issued to your integration, and the shared key the docs fill in reads and quotes only.

In: header

Path Parameters

chainId*integer

The chain's numeric id, for example 8453 for Base. GET /api/vaults/chains lists them.

asset*string

The asset vault's token, as a contract address. A symbol is refused.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/api/vaults/1/string/prepare-withdraw" \  -H "Content-Type: application/json" \  -d '{    "amount": "100000000",    "owner": "0x1111111111111111111111111111111111111111"  }'
{  "vault": "0xb367A4306087d3981B38C032464cD7E3A7a03A4E",  "calls": [    {      "to": "0xb367A4306087d3981B38C032464cD7E3A7a03A4E",      "data": "0xb460af940000000000000000000000000000000000000000000000000000000005f5e10000000000000000000000000011111111111111111111111111111111111111110000000000000000000000001111111111111111111111111111111111111111",      "value": "0",      "description": "Withdraw 100000000 from the vault to 0x1111111111111111111111111111111111111111"    }  ],  "freePrincipal": "120000000"}
{  "error": "string",  "code": "string",  "message": "string",  "details": {},  "requestId": "string"}
{  "error": "string",  "code": "string",  "message": "string",  "details": {},  "requestId": "string"}