Skip to main content
GET
/
v2
/
amplify
/
calculateWithdrawalFee
Calculate withdrawal fee
curl --request GET \
  --url https://api.paxoslabs.com/v2/amplify/calculateWithdrawalFee \
  --header 'x-api-key: <api-key>'
import requests

url = "https://api.paxoslabs.com/v2/amplify/calculateWithdrawalFee"

headers = {"x-api-key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};

fetch('https://api.paxoslabs.com/v2/amplify/calculateWithdrawalFee', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.paxoslabs.com/v2/amplify/calculateWithdrawalFee",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-api-key: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.paxoslabs.com/v2/amplify/calculateWithdrawalFee"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-api-key", "<api-key>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.paxoslabs.com/v2/amplify/calculateWithdrawalFee")
  .header("x-api-key", "<api-key>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.paxoslabs.com/v2/amplify/calculateWithdrawalFee")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "feeAmount": "0.05",
  "offerFeePercentage": {
    "bps": 25,
    "percentage": "0.2500"
  },
  "flatFee": "1.05"
}
{
  "error": {
    "code": 400,
    "message": "Invalid filter syntax.",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.paxoslabs.dev/errors/BadRequest",
        "fieldViolations": [
          {
            "field": "filter",
            "description": "vaultAddress 0x0x is an invalid hex address."
          }
        ]
      }
    ]
  }
}
{
  "error": {
    "code": 400,
    "message": "Invalid filter syntax.",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.paxoslabs.dev/errors/BadRequest",
        "fieldViolations": [
          {
            "field": "filter",
            "description": "vaultAddress 0x0x is an invalid hex address."
          }
        ]
      }
    ]
  }
}
{
  "error": {
    "code": 400,
    "message": "Invalid filter syntax.",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.paxoslabs.dev/errors/BadRequest",
        "fieldViolations": [
          {
            "field": "filter",
            "description": "vaultAddress 0x0x is an invalid hex address."
          }
        ]
      }
    ]
  }
}

Authorizations

x-api-key
string
header
required

API key in format: pxl_<public_id>_

Query Parameters

offerAmount
string
required

Share amount to withdraw (base units decimal string)

Example:

"1000000000000000000"

wantAsset
string
required

ERC-20 token address the user wants to receive

Example:

"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"

vaultAddress
string
required

BoringVault contract address (0x + 40 hex chars)

Example:

"0xbbbb000000000000000000000000000000000001"

chainId
number
required

EVM chain ID

Example:

1

Response

feeAmount
string
required

Fee amount charged for the given offer and want asset.

Example:

"0.05"

offerFeePercentage
object
required

Offer fee percentage in bps.

flatFee
string
required

Flat fee charged on every withdrawal for the given offer and want asset. Denominated in the want asset.

Example:

"1.05"