πŸ“–Withdrawals

Generate calldata for withdrawing from vaults.

Withdrawals

Generate calldata for withdrawing from vaults.

POST /defi-vaults/v1/defi/withdraw/calldata

Headers

Header
Required
Description

X-JOIN-KEY

Yes

Your API key

Content-Type

Yes

application/json

Request Body

Field
Type
Required
Description

vaultAddress

string

Yes

Vault contract address

amount

string

Yes

Amount to withdraw in smallest unit

userAddress

string

Yes

User wallet address

Note: For async vaults, the amount is in vault shares (18 decimals). For example, "1000000000000000000" = 1 share.

Request Example

{
  "vaultAddress": "0xef368456a942f098241de16f8a695160ef23eb27",
  "amount": "1000000000000000000",
  "userAddress": "0x1234567890123456789012345678901234567890"
}

Response

If the user has unclaimed deposit shares, the API automatically prepends a claim transaction before the redeem request:

The first operation claims pending shares, the second requests the redeem.

Response Fields

Field
Type
Description

approval

Transaction[]

Approval transactions (typically empty for withdrawals)

operations

Transaction[]

Withdraw transactions β€” may include auto-claim if user has unclaimed shares

protocol

string

Protocol identifier

chainId

number

Chain ID

estimatedGas

string

Estimated gas

isCrossChain

boolean

Always false β€” withdrawals are same-chain only

isAsync

boolean

true when withdrawals require settlement before claiming

Errors

Status
Error
Description

400

Missing or invalid vaultAddress

Vault address not provided or invalid

400

Missing or invalid amount

Amount not provided or not positive

400

Missing or invalid userAddress

User address not provided or invalid

404

Vault not found

Vault not in your configuration

Cross-Chain Withdrawals

Cross-chain withdrawals are not currently supported. Users must withdraw on the chain where the vault is deployed.


Claim Redeem

After settlement, claim your underlying tokens (e.g. USDC). The API auto-reads the claimable amount from the chain.

Headers

Header
Required
Description

X-JOIN-KEY

Yes

Your API key

Content-Type

Yes

application/json

Request Body

Field
Type
Required
Description

vaultAddress

string

Yes

Vault contract address

userAddress

string

Yes

User wallet address

Request Example

Response

Errors

Status
Error
Description

400

No claimable redeem found for this user

Nothing to claim β€” redeem not yet settled

400

Claim redeem is only applicable to async vaults

Vault does not support claim

400

Missing or invalid userAddress

User address not provided or invalid

404

Vault not found

Vault not in your configuration

Last updated