Note: It is highly recommended to call theprice
endpoint before invoking thequote
endpoint. This pattern is especially critical when building applications. Theprice
endpoint can be polled periodically (eg: every few seconds) to provide users with realtime pricing information. Once the user approves the router contract and confirms the intention to swap, thequote
endpoint should be called to retrieve the final calldata for onchain execution This architecture reduces unnecessary load on the quote infrastructure and ensures accurate, timely user interactions. Furthermore, GlueX plans to introduce market maker integrations on thequote
endpoint, which will enhance price discovery and further optimize rate limits for this endpoint
POST /v1/price
Returns a price estimate for a token swap. This endpoint is intended for off chain estimation and does not include calldata or simulation metadata
Description
- Provides estimated input/output amounts
- Supports partial fill logic
For detailed information on the request and response formats, refer the
section here
POST /v1/quote
Returns a price quote along with transaction calldata for executing the trade onchain Description- Includes all
price
endpoint fields - Adds transaction-specific fields such as
calldata
andrevert
- Simulation is enabled by default (
computeEstimate: true
)
quote
calldata
: ABI encoded transaction datarevert
: Boolean indicating if the trade would revertcomputationUnits
: Estimated gaslowBalance
: Indicates insufficient balanceblockNumber
: Block number for simulation contextsimulation
: Raw trace/debug metadata
For detailed information on the request and response formats, refer the
section here
These endpoints form the foundation of GlueX Router’s programmable interface, providing flexible and secure trade execution capabilities across supported networks