Platform available pairs

Platform Available Pairs

Returns the active currency pairs available for swapping on the LedgerBlock platform, including the current buy rate and sell rate for each pair.

Endpoint

Method: GET

{{base_url}}/api/v1/swap/pairs

Authentication

Bearer Token: Required

Headers

HeaderRequiredDescription
AuthorizationYesAPI_KEY .
Content-TypeYesSpecifies that the request uses JSON.
x-merchant-refYesUnique reference identifying the merchant.

Sample Request

curl --request GET \
  --url '{{base_url}}/api/v1/swap/pairs' \
  --header 'Authorization: Bearer {{token}}' \
  --header 'Content-Type: application/json' \
  --header 'x-merchant-ref: {{x_merchant_ref}}'

Response

{
  "status": "success",
  "message": "Active swap pairs",
  "data": [
    {
      "base_currency": "KES",
      "quote_currency": "EUSD:MOB",
      "buy_rate": 2000,
      "sell_rate": 1950
    },
    {
      "base_currency": "NGN",
      "quote_currency": "CAD",
      "buy_rate": 1.05,
      "sell_rate": 0.99
    },
    {
      "base_currency": "NGN",
      "quote_currency": "EUSD:MOB",
      "buy_rate": 1700,
      "sell_rate": 1490
    },
    {
      "base_currency": "NGN",
      "quote_currency": "USDT",
      "buy_rate": 1500,
      "sell_rate": 1490
    },
    {
      "base_currency": "NGN",
      "quote_currency": "USDT:POL",
      "buy_rate": 1500,
      "sell_rate": 1490
    },
    {
      "base_currency": "USDT:POL",
      "quote_currency": "EUSD:MOB",
      "buy_rate": 1.05,
      "sell_rate": 0.99
    }
  ]
}

Response Parameters

FieldTypeDescription
statusstringIndicates whether the request was successful.
messagestringDescribes the result of the request.
dataarrayContains the list of active swap pairs and their rates.
data[].base_currencystringThe currency being exchanged from.
data[].quote_currencystringThe currency being exchanged to.
data[].buy_ratenumberThe rate applied when purchasing the quote currency using the base currency.
data[].sell_ratenumberThe rate applied when selling the quote currency for the base currency.

How It Works

The Platform Available Pairs endpoint allows a merchant to retrieve all currently active currency pairs supported for swapping.

Each item in the response represents a supported swap pair. The base_currency identifies the currency being exchanged, while the quote_currency identifies the currency it can be exchanged for.

The response also provides separate buy and sell rates, which should be used when calculating the expected amount for a swap.

For example, for the NGN/USDT pair:

  • Buy rate: 1500
  • Sell rate: 1490

This means the applicable rate depends on the direction of the swap.

Example

For the following pair:

{
  "base_currency": "NGN",
  "quote_currency": "USDT",
  "buy_rate": 1500,
  "sell_rate": 1490
}

A merchant can use these rates to determine the applicable conversion when swapping between NGN and USDT.

Important Notes

The endpoint returns active swap pairs only. The available pairs and their rates may change based on the currencies currently supported by the platform.

The quote_currency may also contain a network identifier, such as USDT:POL or EUSD:MOB, indicating that the asset is associated with a specific network.


Did this page help you?