A comprehensive guide to integrating with the GlueX Router API
/v1/price
/v1/price
endpoint provides real time price estimates for token swaps. This endpoint should be frequently polled in applications to show users up to date price quotes and ensure optimal trading conditions
inputToken
: Contract address of the token being soldoutputToken
: Contract address of the token being purchasedinputAmount
or outputAmount
: Specify either input or output amount (not both)uniquePID
: Your partner identifier from the registration processapprove
method, specifying the router address and the exact amount to be swapped. This step is required for all ERC-20 tokens and ensures secure token handling
/v1/quote
/v1/quote
endpoint provides the exact calldata required to execute the trade on-chain
inputToken
: Contract address of the token being soldoutputToken
: Contract address of the token being purchasedinputAmount
or outputAmount
: Specify either input or output amount (not both)uniquePID
: Your partner identifier from the registration processcalldata
: ABI-encoded transaction data ready for executionrouter
: Contract to send the transaction tovalue
: Native token amount to include with the transaction (for ETH/native token swaps)ethers.js
or web3.js
value