Trade

The Nexus DEX provides three trading interfaces to accommodate different usage scenarios:

1. Two-Step Trading Process

For scenarios requiring quote confirmation before execution:

Step 1: Get Quote - Use /taker/api/swap/quote to obtain a price quote for your desired trading pair. This endpoint returns a quote_id along with detailed information about the exchange rate and amounts.

Taker Quote

post
Header parameters
AuthorizationstringRequired
User-IdstringRequired
User-AgentstringRequiredExample: Apifox/1.0.0 (https://apifox.com)
Content-TypestringRequiredExample: application/json
AcceptstringRequiredExample: */*
HoststringRequiredExample: 127.0.0.1:8942
ConnectionstringRequiredExample: keep-alive
Body
symbolstringRequired

E.g.: runes-THIRD•THIRD•TEST•TEO/btc-BTC, the latter is the quote currency

sidestringRequired

buy/sell, if runes is at the front, it means buy runes or sell runes

quantitystringRequired

Quantity

enable_channelbooleanRequired

Whether to use channel payment

Responses
200Success
application/json
post
/taker/api/swap/quote
200Success

Step 2: Submit Trade - Use /taker/api/swap/submit with the quote_id from step 1 to execute the trade. This allows you to review the quote before committing to the transaction.

Taker Submit Quote

post
Header parameters
AuthorizationstringRequired
User-IdstringRequired
User-AgentstringRequiredExample: Apifox/1.0.0 (https://apifox.com)
Content-TypestringRequiredExample: application/json
AcceptstringRequiredExample: */*
HoststringRequiredExample: 127.0.0.1:8942
ConnectionstringRequiredExample: keep-alive
Body
quote_idstringRequired
fee_rateintegerRequired
slippagestringRequired
enable_channelbooleanRequired
Responses
200Success
application/json
post
/taker/api/swap/submit
200Success

2. Quick Trading

For streamlined trading without separate quote generation:

Quick Trade - Use /taker/api/swap/quick to get a quote and submit the trade in a single request. This endpoint combines both steps for faster execution when immediate trading is desired.

Taker Quick Trade

post
Header parameters
AuthorizationstringRequired
User-IdstringRequired
User-AgentstringRequiredExample: Apifox/1.0.0 (https://apifox.com)
Content-TypestringRequiredExample: application/json
AcceptstringRequiredExample: */*
HoststringRequiredExample: 127.0.0.1:8942
ConnectionstringRequiredExample: keep-alive
Body
symbolstringRequired

E.g.: runes-THIRD•THIRD•TEST•TEO/btc-BTC, the latter is the quote currency

sidestringRequired

buy/sell, if runes is at the front, it means buy runes or sell runes

quantitystringRequired

Quantity

fee_rateintegerRequired
slippagestringRequired
enable_channelbooleanRequired

Whether to use channel payment

Responses
200Success
application/json
Responseobject
post
/taker/api/swap/quick
200Success

Last updated