This document outlines the structure of requests and responses for Router (common fields and endpoint specific fields)
/v1/price
and /v1/quote
endpoints
Name | Type | Required | Default Value | Description |
---|---|---|---|---|
chainID | string | Conditional | Identifier for the target chain (eg: ethereum ) | |
networkID | string/integer | Conditional | Numerical chain ID (eg: 1 for Ethereum) | |
inputToken | string | ✅ | ERC20 token address to be sold | |
outputToken | string | ✅ | ERC20 token address to be bought | |
inputAmount | string/integer | Conditional | Amount of input token (used for SELL orders) | |
outputAmount | string/integer | Conditional | Desired amount of output token (used for BUY orders) | |
orderType | string | Conditional | Type of order: BUY or SELL | |
userAddress | string | ✅ | Initiator’s wallet address | |
outputReceiver | string | ✅ | Address to receive the output token | |
uniquePID | string | ✅ | Partner ID for analytics and attribution | |
computeEstimate | boolean | Optional | true | Enable simulation |
computeStable | boolean | Optional | false | Include USD value metadata in response |
surgeProtection | boolean | Optional | false | Enable or disable Surge Protection |
isPartialFill | boolean | Optional | false | Allow partial fill swaps |
isPermit2 | boolean | Optional | false | Use Permit2 for allowance approvals |
slippage | string/integer | Optional | Maximum slippage allowed (in basis points) | |
partnerFee | string/integer | Optional | 0 | Fee in bps applied to output |
partnerAddress | string | Conditional | EOA to receive partner fee and surplus | |
modulesFilter | array | Optional | [] | Restrict routing to specified liquidity modules |
activateSurplusFee | boolean | Optional | false | Enable surplus sharing contract |
/v1/price
and /v1/quote
responses.
Field | Type | Description |
---|---|---|
inputToken | string | ERC20 address of input token |
outputToken | string | ERC20 address of output token |
feeToken | string | Token used to pay any applicable fees |
inputSender | string | Address initiating the trade |
outputReceiver | string | Address receiving the output |
inputAmount | string | Original input amount |
outputAmount | string | Expected output amount |
partnerFee | string | Amount of fee allocated to partner |
routingFee | string | GlueX’s routing fee (typically zero) |
effectiveInputAmount | string | Actual used input in the swap (for partial fills) |
effectiveOutputAmount | string | Actual received output after fees and routing |
minOutputAmount | string | Slippage-protected minimum output |
liquidityModules | array | Liquidity sources/modules used |
isNativeTokenInput | boolean | Indicates if native token (eg: ETH) was used |
value | string | Value (in wei) sent with transaction (if applicable) |
/v1/price
Field | Type | Description |
---|---|---|
surgeValue | integer | Projected reverse loss estimate in percentage |
/v1/quote
Field | Type | Description |
---|---|---|
calldata | string | ABI encoded transaction data |
revert | boolean | Indicates if trade would revert onchain |
computationUnits | integer | Estimated gas cost |
lowBalance | boolean | True if user balance is insufficient |
blockNumber | integer | Block number used during simulation |
simulation | object | Detailed trace/debug object for advanced usage |