Get Swap Rate

Before creating a swap, it's possible to programmatically retrieve data about the valid minimum/maximum swap amount and the Layerswap fee. The endpoint is public and does not require any authorization.

POST https://api.layerswap.io/api/swap_rate

Headers

Request Body

{
  "data": [
    {
      "min_amount": 0.001431,
      "fee_amount": 0.0006,
      "max_amount": 0.1
    }
  ],
  "error": null
}

A detailed explanation of the Swap Rate Object is available here.

Raw request

curl -X 'POST' \
  'https://api.layerswap.io/api/swap_rate' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "source": "ETHEREUM_MAINNET",
  "destination": "ARBITRUM_MAINNET",
  "source_asset": "USDC",
  "destination_asset": "USDC",
  "refuel": true
}'

Raw Response

{
  "data": [
    {
      "min_amount": 0.001431,
      "fee_amount": 0.0006,
      "max_amount": 0.1
    }
  ],
  "error": null
}

Last updated

© 2023 Bransfer, Inc. All rights reserved.