Skip to main content

Overview

The Rate endpoint returns the exchange rate for a currency pair with your platform fee already applied on top. Use it to show your users what a conversion will cost before they commit to it. The rate is indicative — it does not reserve or lock a quote, and no funds move. Pass exactly one of source_amount or destination_amount; Superbank computes the other side. Endpoints

Object

Attributes

AttributeDescription
source_currencyThe currency code being converted from.
destination_currencyThe currency code being converted to.
mid_market_rateDestination units per one source unit, before any fee.
inverted_mid_market_rateThe inverse of mid_market_rate, for convenience.
effective_rateThe all-in rate the recipient actually receives per source unit, after the fee.
source_amountThe amount debited in the source currency.
destination_amountThe amount credited in the destination currency.
feeThe fee applied on top of the exchange rate.
fee.totalThe total fee for this conversion, denominated in the source currency. This is a single all-in figure.
fee.currencyThe currency the fee is denominated in (the source currency).
fee.total is the complete cost of the conversion. It equals the gap between what is debited and what would be received at the mid-market rate (source_amount - destination_amount / mid_market_rate), so the difference between mid_market_rate and effective_rate is fully explained by it.

GET /v0/rates

Parameters

Query parameterDescription
source_currency_codeRequired. The currency to convert from, e.g. USDC, USD.
source_railRequired. The source rail, e.g. SOLANA, ACH.
destination_currency_codeRequired. The currency to convert to, e.g. CAD, USDC.
destination_railRequired. The destination rail, e.g. LOCAL, RTP.
destination_country_codeThe ISO 3166-1 alpha-2 country code of the destination. Required when the destination is fiat.
source_country_codeThe ISO 3166-1 alpha-2 country code of the source. Required when the source is fiat (on-ramp).
source_amountThe amount in the source currency. Mutually exclusive with destination_amount.
destination_amountThe amount in the destination currency. Mutually exclusive with source_amount.
At least one leg must be a stablecoin — fiat-to-fiat pairs are not supported. Stablecoin legs use a crypto rail (SOLANA, ETHEREUM, POLYGON, TRON); fiat legs use ACH, RTP, DOMESTIC_WIRE, or LOCAL.

Request

curl --request GET \
    --url 'https://api-sandbox.superbank.co/v0/rates?source_currency_code=USDC&source_rail=SOLANA&destination_currency_code=CAD&destination_rail=LOCAL&destination_country_code=CA&source_amount=1000' \
    --header 'X-Api-Key: YOUR_API_KEY'

Response

{
  "source_currency": "USDC",
  "destination_currency": "CAD",
  "mid_market_rate": 1.3788512205,
  "inverted_mid_market_rate": 0.7252415072,
  "effective_rate": 1.3651,
  "source_amount": 1000,
  "destination_amount": 1365.1,
  "fee": {
    "total": 9.97,
    "currency": "USDC"
  }
}

Errors

StatusWhen
400Both or neither of source_amount / destination_amount were provided.
400An unsupported currency, a rail that doesn’t match the currency, or a fiat-to-fiat pair.
400A fiat leg without its country code.
401Missing or invalid API key.