Swap API
Sequence Diagram
Supported Swap Pairs and FX Quote
In order to perform a swap, you first need to get the swap pairs currently supported by StraitsX via the get supported swap pairs endpoint. For example, if you receive XSGDUSDC
in the response, that means you will be allowed to swap between XSGD and USDC in both directions.
At the moment, the following swap pairs are supported:
XSGDXUSD
XSGDUSDC
XUSDUSDC
USDCUSDT
Upon confirming the supported swap pairs, call the request swap quote endpoint to get the rate for the currency pair, amount, and fixed side. Note that each quote returned has an expiry time.
Execute a quote
While the quote is still valid, execute the swap quote with the quote id returned earlier. Once the swap is executed, the balance for the respective wallets will be updated.
Updated 5 months ago