Loading...
Loading...
© 2026 Hydrex. All rights reserved.
Call GET /quote with the required parameters. The response includes the best-route quote along with calldata for the Hydrex router contract.
const resp = await fetch(
'https://router.api.hydrex.fi/quote'
+ '?chainId=8453'
+ '&fromTokenAddress=0x4200000000000000000000000000000000000006' // WETH
+ '&toTokenAddress=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913' // USDC
+ '&amount=1000000000000000000' // 1 WETH
+ '&taker=0xYourWalletAddress'
+ '&slippage=50'
);
const quote = await resp.json();Or via cURL:
curl "https://router.api.hydrex.fi/quote" \
-G \
--data-urlencode "fromTokenAddress=0x4200000000000000000000000000000000000006" \
--data-urlencode "toTokenAddress=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" \
--data-urlencode "amount=1000000000000000000" \
--data-urlencode "chainId=8453" \
--data-urlencode "taker=0xYourWallet" \
--data-urlencode "slippage=50"Example response:
{
"amountIn": "1000000000000000000",
"amountOut": "2948105260",
"minOutputAmount": "2933340727",
"recipient": "0xYourWalletAddress",
"transaction": {
"to": "0x599bfa1039c9e22603f15642b711d56be62071f4",
"data": "0x...",
"value": "0"
}
}Never hardcode transaction.to. The router contract address can change with protocol upgrades — always read it from the response.
Use the calldata returned in the quote response to submit the transaction to the Hydrex router contract via your preferred web3 library (viem, wagmi, etc.).
// viem
const hash = await walletClient.sendTransaction({
to: quote.transaction.to,
data: quote.transaction.data,
value: BigInt(quote.transaction.value ?? '0'),
});
const receipt = await publicClient.waitForTransactionReceipt({ hash });All contracts are deployed on Base mainnet (chain ID 8453) and verified on Basescan.
| Contract | Address | Basescan |
|---|---|---|
| Hydrex Router | 0x599bfa1039c9e22603f15642b711d56be62071f4 | View |
| HydrexDCA (Proxy) | 0x612697A124aB01b3AcF44c6e0135539416BF3fAB | View |
| HydrexDCA (Implementation) | 0x4dD152531eD13C7BB89Cd30B25246662e8DD87E4 | View |
The Router contract address may change with protocol upgrades. Always read transaction.to from the quote API response instead of hardcoding the address in your integration.
Most endpoints are publicly accessible without an API key.
For token-data endpoints on non-production deployments, an optional X-Domain-Bypass-Key header can be provided to bypass domain allow-list restrictions.
Contact the Hydrex team if you need access to restricted environments.
All amounts must be in base units (wei) — the token's smallest unit. Never pass floats.
// 100 USDC (6 decimals) → 100 * 10^6
amount = "100000000"
// 1 WETH (18 decimals) → 1 * 10^18
amount = "1000000000000000000"
// 0.5 WETH (18 decimals)
amount = "500000000000000000"Slippage is expressed in basis points (BIPS). 50 BIPS = 0.5%. 100 BIPS = 1%. Default is 50 (0.5%).
The router uses this to compute minOutputAmount — the on-chain floor below which the transaction reverts.
Filter upstream aggregators via the source parameter (aliases: service, services, aggregators). Omit entirely to query all enabled sources.
| Identifier | Provider |
|---|---|
ZEROX | 0x Protocol |
OPENOCEAN | OpenOcean |
OKX | OKX DEX (requires taker) |
KYBERSWAP | KyberSwap |
Amounts must be in base units (wei). For a token with 18 decimals, 1 token = 1000000000000000000.
Slippage is expressed in BIPS (basis points). 50 BIPS = 0.5%. 100 BIPS = 1%.
The source parameter and its aliases (service, services, aggregators) are interchangeable.
For the complete OpenAPI specification, visit: router.api.hydrex.fi/api-json