Create Swap
Request Body:
Parameter Explanation:
Pair.tokenA
: The address of the token being offeredPair.tokenB
: The address of the token being requestedamount.tokenA
: The price of the token being offered
Example Request:
Request Body:
This request will create a swap, where the user offers a token with address 0x1234567890
and requests a token with address 0x0987654321
at a price of 0.5.
Successful Response:
Response Field Explanation:
success
: Whether the request was successfuldata.transactionId
: The transaction ID of the swapdata.status
: The status of the swap
Error Response:
By calling this API endpoint and providing the necessary parameters, you can create a new token swap on the ONTON Finance platform. Once the swap is created, the system will automatically match the trade and execute the token swap. You can use the returned transaction ID to track the status of the swap.
Note that when creating a swap, you must provide accurate token addresses and a reasonable price. If the provided parameters are invalid or the swap cannot be completed, the API will return an error response.