Skip to main content
GET /v2/amplify/calculateWithdrawalFee returns the fee a user would be charged for redeeming a specific offerAmount of shares for a given wantAsset. The backend resolves the account’s configured FeeModule via the indexer and calls calculateOfferFees() on-chain. Use this endpoint to preview fees in a withdrawal confirmation UI before submitting the order via GET /v2/amplify/withdraw.
The withdrawal endpoint itself already accounts for fees internally — you do not need to call calculateWithdrawalFee before preparing withdrawal calldata. It exists purely for display.

Parameters

ParameterTypeRequiredDescription
offerAmountstringYesShare amount to withdraw in base units (decimal string, 18 decimals)
wantAssetstringYesERC-20 token address the user wants to receive
vaultAddressstringYesBoringVault contract address (0x + 40 hex chars)
chainIdnumberYesEVM chain ID

Example

curl "https://api.paxoslabs.com/v2/amplify/calculateWithdrawalFee?\
offerAmount=1000000000000000000&\
wantAsset=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&\
vaultAddress=0xbbbb000000000000000000000000000000000001&\
chainId=1" \
  -H "x-api-key: pxl_your_key"

Response

{
  "feeAmount": "0.05",
  "offerFeePercentage": { "bps": 25, "percentage": "0.2500" },
  "flatFee": "1.05"
}
FieldTypeDescription
feeAmountstring (decimal)Total fee for this offerAmount + wantAsset, human-readable (scaled by the want-asset decimals)
offerFeePercentage.bpsnumberFee percentage in basis points (25 = 0.25%)
offerFeePercentage.percentagestringHuman-readable percentage with 4 decimals (e.g. "0.2500")
flatFeestring (decimal)Flat per-withdrawal fee, denominated in the want asset (human-readable units)

Error Responses

StatusMeaning
400Invalid parameters (bad address, non-numeric offerAmount, etc.)
404No fee module configured for the given vaultAddress + wantAsset pair
503Upstream RPC or indexer unavailable