How It Works
Three steps from API call to on-chain execution.
Integration flow
Request a route
Call the aggregator endpoint with your input token, output token, amount, and chain ID. Nordstern queries all available liquidity sources across the chain and simulates every viable execution path.
Receive ready-to-submit calldata
The response includes a tx object (to, data, value, and from) that can be submitted
directly on-chain. No manual encoding, no additional calls, no SDK required.
Approve and execute
Before the first swap, approve the Guard Contract to spend your input token. This is a standard ERC-20 approval and only needs to happen once per token. Then submit the transaction.
How routing works
Steps 01–03 describe the integration flow from your application's perspective. Under the hood, step 01 triggers a four-stage pipeline that runs before the response is returned. Understanding it helps explain why Nordstern consistently finds better routes than querying a single DEX directly.
Simultaneous source querying
Every request queries all integrated DEXs, AMMs, and liquidity pools at once, not sequentially. This gives Nordstern a complete view of available liquidity in a single pass, which is what makes sub-50ms quotes possible.
Simulation-verified paths
The selected route is simulated against current on-chain state before it is considered. Paths that would fail on-chain (due to liquidity constraints, token quirks, or stale pool state) are filtered out before any route reaches you.
Split routing
When a single pool cannot fill the swap efficiently, Nordstern splits the order across multiple pools and routes simultaneously. Each leg is sized to minimise combined price impact.
Gas-adjusted optimisation
A route that adds an extra hop to save 0.1% on output but costs more in gas than it saves is not a better route. Nordstern factors gas cost into route scoring, so the returned route maximises net value to the user, not just gross output.