This section outlines the primary endpoints (fetch pricing estimates and generate transaction calldata) provided by the Router API
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
/v1/price
price
endpoint fieldscalldata
and revert
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