GET /v2/amplify/calculateWithdrawalFee returns the fee a user would be charged for redeeming a specific offerAmount of shares for a given wantAsset.
Use this endpoint to preview fees in a withdrawal confirmation UI before submitting the order via GET /v2/amplify/withdraw.
The withdrawal endpoint already accounts for fees — you do not need to call
calculateWithdrawalFee before preparing withdrawal calldata. It exists purely for display.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
offerAmount | string | Yes | Share amount to withdraw in base units (decimal string, 18 decimals) |
wantAsset | string | Yes | ERC-20 token address the user wants to receive |
vaultAddress | string | Yes | BoringVault contract address (0x + 40 hex chars) |
chainId | number | Yes | EVM chain ID |
Example
- curl
- Node.js
- Python
- Go
- Java
Response
| Field | Type | Description |
|---|---|---|
feeAmount | string (decimal) | Total fee for this offerAmount + wantAsset, human-readable (scaled by the want-asset decimals) |
offerFeePercentage.bps | number | Fee percentage in basis points (25 = 0.25%) |
offerFeePercentage.percentage | string | Human-readable percentage with 4 decimals (e.g. "0.2500") |
flatFee | string (decimal) | Flat per-withdrawal fee, denominated in the want asset (human-readable units) |
Error Responses
| Status | Meaning |
|---|---|
| 400 | Invalid parameters (bad address, non-numeric offerAmount, etc.) |
| 404 | No fee module configured for the given vaultAddress + wantAsset pair |
| 503 | Upstream service unavailable |