Swap and Trading Pairs
Access prerequisites
- Permission (module):
manageToken - License/Feature:
MANAGE_TOKENS - Menu container: TOKENIZATION → group Tokenization → Manage Tokens (icons Swap and Trading pairs on the row / in the action bar)
What it is / when to use
This screen covers two distinct settings related to token trading:
- Automatic swap — defines which tokens a given token can be directly exchanged for (quick swap, no manual approval). Only available for tokens with Automatic swap (
isAutomaticSwap) turned on. - Trading pairs — defines the market pairs of the internal exchange (order book): base/quote pair, minimum/maximum order sizes, price/quantity precision, and pair fee.
Prerequisites
- Permission:
manageToken(dual — CPM enum + module in the DB). - License/Feature:
MANAGE_TOKENS. - For Swap: the token and the pair tokens must have Automatic swap (
isAutomaticSwap = true). Tokens without this flag do not appear as an option. - For Trading pairs: tokens must be enabled for purchase and for the exchange (
buyable,operate_exchange/integrate_book).
Swap Configuration
- In Manage Tokens, click the Swap icon on the token's row (only triggers if the token has automatic swap).
- The modal lists the available tokens (only those with automatic swap) and the already configured pairs.
- Add tokens to form swap pairs or remove existing ones.
- Click Save (
createOrUpdateSwapPairs).
| Field | What it is | System/backend effect |
|---|---|---|
| Selected token | Token whose pairs are being edited | TokensPairs.id |
| Pairs (list) | Tokens with which the swap is permitted | pairs[] — each item stores the id, name, and image of the pair token |
Trading Pairs Configuration
Accessible via the Trading pairs button (route /manage-tokens/trading-pairs, optionally filtered by tokenId). Lists the pairs of the selected token, with actions to create, edit, activate/deactivate, set as default, and delete.
| Field (modal) | What it is | System/backend effect |
|---|---|---|
| Base token | Base token of the pair | tokenId |
| Quote token | Quote token of the pair | pairTokenId |
| Enabled | Turns the pair on/off in the book | enabled |
| Default | Marks the pair as the token's default | isDefault (via setDefaultPair) |
| Display order | Position of the pair in the list | displayOrder |
| Exchange symbol | Symbol of the pair at the external provider | exchangeSymbol |
| Minimum / maximum order size | Volume limits per order | minimumOrderSize / maximumOrderSize |
| Price / quantity precision | Accepted decimal places | pricePrecision / quantityPrecision |
| Pair fee (%) | Fee applied to operations in the pair | feePercentage |
Actions and modals
- Add/remove token in swap: manipulates the local list; only persisted on save.
- Create / Edit pair: modal with the fields above.
- Set as default:
setDefaultPair. - Activate/Deactivate:
updateTradingPair({ enabled }). - Delete pair: confirms and removes (
deleteTradingPair).
Business rules / considerations
Attention
- Swap and Trading pairs are different mechanisms: swap is a direct token↔token exchange; trading pairs feed the book of the internal exchange.
- Tokens without Automatic swap cannot form swap pairs — turn the flag on in token editing first.
- House revenue (book): in the OrderBook, the seller's settlement uses the limit price of the order (
order.price), not the execution price. The delta between the limit and execution price is house revenue — take this into account when analyzing order numbers and pair fees. - Financial values: order sizes, precision, and fee are handled with precision (BigNumber) — no rounding in configuration.
Examples
Scenario 1 — Enable swap between a stablecoin and two tokens
- Ensure that
BSCUSDT,UST(Polygon), andBRZhave Automatic swap turned on. - Open the Swap for
BSCUSDT. - Add
USTandBRZto the pairs list. - Save. Result: users can exchange
BSCUSDTdirectly forUSTorBRZ.
Scenario 2 — Create a default market pair on the internal exchange
- Open Trading pairs filtering by the base token (e.g.,
AXIA). - Create pair: base
AXIA, quoteUSDT,minimumOrderSize = 0.0001,pricePrecision = 2,quantityPrecision = 4,feePercentage = 0.10. - Mark Default and Enabled.
- Save. Result:
AXIA/USDTbecomes the default pair in the book, with the defined fee and limits.