Methodology: How a Solana Quote Is Produced, Ranked, and Verified
Every claim on SwapKing is meant to be checkable against the site's behavior. This page names the sources, describes the quote pipeline from request to transaction, explains what "best rate" and "under 2 seconds" actually mean at the protocol level, and lists explicitly what the site does not measure or guarantee. The intent is that a reader can compare the page against the site and decide which claims hold.
What this page is for
A methodology page has one useful function: to make the site's claims falsifiable. If a claim cannot be checked against the site's behavior, the page that states it is marketing rather than description, regardless of how technical it sounds. The sections below describe the quote pipeline step by step, name the sources that feed it, define the specific and narrow senses in which the words "best rate" and "under 2 seconds" are true, and list the categories of risk and behavior that the site does not measure. Where a claim depends on a third party, the third party is named. Where a claim cannot be verified, it is labeled as such.
The quote pipeline, step by step
Step 1 — Request. The user types an amount into the swap card. The frontend debounces the input for a fraction of a second, then sends a request to the quote engine. The request contains the pair, the amount, and the current slippage setting. Nothing else is included; the request is a pure function of those three inputs.
Step 2 — Fan-out. The quote engine queries every indexed venue in parallel. Each venue is asked for its pool state at the current slot. The engine does not wait for one venue before asking the next; the queries go out together and the responses are collected as they arrive.
Step 3 — Simulation. For each returned pool state, the engine simulates the swap against the pool's curve for the requested amount. The simulation accounts for the pool's fee tier, its constant-product or concentrated-liquidity parameters, and any token-specific transfer tax. The output is a candidate net amount for that venue.
Step 4 — Ranking. The engine ranks the candidates by net output and selects the top result. For orders that are large relative to a single pool's depth, the engine also simulates split routes — two or more pools used in parallel to reduce impact — and returns the split if its net output is better than the best single-pool route.
Step 5 — Display. The selected route is returned to the frontend with its expected output amount, its price impact estimate, and the pool path. The frontend renders it in the swap card and holds it in a short-lived cache. Any change to the pair, the amount, or the slippage setting invalidates the cache and forces a fresh request.
Step 6 — Transaction. When the user clicks Swap, the frontend assembles the returned route into a Solana transaction. A single-pool route produces a single instruction; a split route produces several parallel instructions; a multi-hop route produces sequential instructions where each pool's output feeds the next pool's input. All of them are assembled into a single transaction, and the wallet signs once. The transaction is atomic: if any instruction reverts, the whole thing reverts.
What "best rate" means, in the only sense that is honest
"Best rate" on SwapKing means the maximum net output for the specific amount and pair requested, among the venues and routes the router could reach at the moment of the request, after subtracting the pool fee tiers and simulating any split across multiple pools. The phrase is deliberately narrow. It does not mean a global optimum across all Solana liquidity — some pools are not indexed by the router and some venues are not queried, and the router cannot compare against sources it does not see. It does not mean a future rate, because pool state changes every slot. It does not mean a rate that a different user with a different amount would receive, because the optimal route depends on the size of the order relative to the depth of the pools. What the figure means is what the router actually returns, and that is the only claim the site is making.
It is worth being explicit about what the figure is not. It is not a comparison against a centralized exchange at the same moment, because the site has no way to verify the exchange's price in real time and no way to account for the costs of moving funds there. It is not a promise about the execution price, because between the quote and the execution the pool state can change. It is not a substitute for reading the wallet's rendering of the transaction, which shows the minimum received — the floor under the fill — and that floor is what the transaction actually guarantees.
What "under 2 seconds" means, in the only sense that is honest
"Under 2 seconds" describes the typical interval between the moment a signed transaction is broadcast and the moment a wallet's confirmation display updates — not the underlying protocol finalization time, which is a separate and longer measure. Solana's slot time is around 400 milliseconds, and most transactions land in one to three slots under normal conditions. Under congestion, priority fee competition, or a temporarily degraded RPC endpoint, the interval can extend well beyond two seconds, and the wallet's display may not update until the transaction lands or expires. The claim is a typical-case description, not a guarantee for any specific transaction.
It is also unaffected by the transaction's outcome. A transaction that reverts still confirms within the same typical window — the network does not distinguish between a swap that succeeded and a swap that reverted because the slippage bound was exceeded. Both are recorded, both consume the fee, and both appear in the wallet's confirmation display within the same typical interval. The claim describes the speed of confirmation, not the success of the swap.
Named sources
The sources below are the only ones used for data displayed on the site. Naming them makes the claim checkable: a reader can verify that each source exists, that the venues the aggregator claims to combine are listed on the aggregator's own documentation, and that the RPC endpoint in use is a real endpoint with its own published status.
Solana DEX routing and quotes. A third-party Solana DEX aggregator API that combines liquidity across Jupiter, Raydium, Orca, Meteora, Phoenix, and PumpSwap. The aggregator's own documentation describes which venues it indexes and how it ranks routes. SwapKing does not add venues beyond those the aggregator reports, and does not override its ranking.
Reference prices for routeable SPL tokens. The same aggregator's price endpoints. These are used for the USD display under the input fields and for the reference price against which price impact is estimated. They are cached for roughly a minute, because they change less frequently than swap routes.
Reference prices for cross-chain assets. A public market data provider, used only when an asset is not directly routeable by the Solana aggregator — for example, BTC, ETH, or XMR. These prices are cached on a longer cycle and should be treated as indicative rather than exact. The specific provider is named on the Status page.
Solana on-chain state. A Solana RPC provider, configured at deployment. The endpoint reads account state, constructs transactions, and submits them to the network. The specific endpoint in use at any moment is listed on the Status page.
Token metadata. The SwapKing token catalog, cross-checked against on-chain data when a token page is first published. The mint address, decimals, and name displayed on a token page are the ones in the catalog, and the catalog is verified against the on-chain mint at publication.
What the site does not measure and does not guarantee
The list below is more useful than a claim of comprehensiveness would be. Each entry corresponds to a category that is commonly assumed to be covered by a router frontend and is not covered by this one.
- Token safety. A token with an active mint authority, a freeze authority, or a transfer tax passes through the router the same way a clean token does. The site does not audit tokens, does not verify their authorities, and does not warn about them beyond what the token page displays. Verifying a token is a separate step, and the guide on verifying a contract describes how.
- MEV exposure. The router does not run a private mempool, and the transaction is submitted through the public RPC endpoint like any other. It can be sandwiched or front-run in the public block space, and the site does not have a mechanism to prevent that. Some wallets and RPCs offer private submission, but that is a property of the submission path, not of the router.
- Third-party uptime. If the aggregator is down, the Status page reflects the status of SwapKing's components — it does not reflect the aggregator's own status, which is published by the aggregator. The same applies to the RPC endpoint and the price feed.
- Accuracy of reference prices for non-routeable assets. Those prices come from a public market data provider and are cached on a longer cycle. The figures displayed should be treated as indicative rather than exact, and the transaction itself does not use them.
- Safety of the wallet or the device. The site does not assess whether the wallet extension has been compromised, whether the device is running malware, or whether the browser has been modified. Those are properties of the user's environment, and no frontend can verify them.
- Correctness of any specific trade. The site does not have the ability to predict what the pool will return at execution time. The slippage bound is the mechanism that governs the outcome, and it is set by the user, not by the site.
- Continued availability of any venue. A pool can be paused, drained, or deprecated without notice, and the router will route around it if an alternative exists and produce a failure if none does.
Quote cache and timestamp conventions
The quote cache is a short-lived in-memory store on the frontend, holding the most recent quote for a given pair, amount, and slippage setting. Its purpose is to prevent the router from being queried on every keystroke, which would produce a flood of redundant requests during normal typing. The cache window is a few seconds, and any change to the pair, the amount, or the slippage bound forces a fresh request. The trade-off is that a quote served from cache may be a few seconds stale — a limitation that matters only during active volatility.
USD reference prices are cached on a slightly longer cycle — on the order of a minute — because they change less frequently than swap routes. The cache windows for each endpoint are documented on the Status page and may be adjusted without a version bump to this page.
Corrections to the methodology
Every claim on this page is meant to be checkable against the site's behavior, and a claim that turns out to be wrong is a substantive error, not a stylistic one. Corrections are made on the page and logged on the Editorial Policy page with the date, the specific claim that was corrected, and the correction itself. A claim that cannot be verified in practice is removed rather than rephrased to be unfalsifiable. If you believe a claim on this page is incorrect or out of date, write to [email protected] with the URL and a short description.
Related
Security · How Swap Works · Status · Authors · Editorial Policy · Slippage Explained
Questions the Methodology Should Answer
What is the difference between a quote and an execution price?
A quote is a snapshot of what the pool curve would return for a specific amount at a specific moment. It is produced by simulating the swap against the pool's current state. An execution price is what the pool actually returns when the transaction is processed in a specific slot, after any intervening swaps have moved the curve. Between the two there is a blockhash window — typically less than a minute on Solana — during which other transactions can land and change the pool's state. The slippage bound is the tolerance for that change: if the execution price moves past the bound, the transaction reverts and the swap does not happen. The quote is informative; the execution price is definitive. They can differ, and on a busy pool they routinely do by a few basis points even in the absence of any adverse event.
What does 'best rate' mean, exactly?
It means the maximum net output for the specific amount and pair requested, among the venues and routes the router could reach at the moment of the request, after subtracting the pool fee tiers and simulating any split across multiple pools. It does not mean a global optimum across all Solana liquidity, because some pools are not indexed by the router and some venues are not queried. It does not mean a future rate, because liquidity moves constantly. It does not mean a rate that a different user with a different amount would receive, because the optimal route depends on the size of the order relative to the depth of the pools. What the figure means is narrow and specific, and it is what the router actually returns.
What does 'under 2 seconds' actually measure?
It measures the typical interval between the moment a signed transaction is broadcast and the moment a wallet's confirmation display updates — not the underlying protocol finalization time, which is a separate and longer measure. Solana's slot time is around 400 milliseconds, and most transactions land in one to three slots under normal conditions. Under congestion, the interval can extend well beyond two seconds, and the wallet's display may not update until the transaction lands or expires. The claim is a typical-case description, not a guarantee for any specific transaction, and it is unaffected by the transaction itself being correct — a transaction that reverts still confirms within the same typical window.
Why name the sources and not just describe the architecture?
Because the architecture claim — 'quotes come from an aggregator that combines liquidity across venues' — is consistent with several very different implementations, and a reader cannot distinguish them from the description alone. Naming the sources makes the claim checkable: a reader can verify that the aggregator described exists, that the venues it claims to combine are listed on its own documentation, and that the RPC endpoint in use is a real endpoint with a published status page. A methodology page that describes an architecture without naming the sources is a description of a claim, not a verification of it. The distinction is worth the two extra sentences.
What does the site not measure that a reader might expect it to?
Several things that are commonly assumed. It does not measure token safety — a token with an active mint authority, a freeze authority, or a transfer tax passes through the router the same way a clean token does. It does not measure MEV exposure — the router does not run a private mempool, and the transaction can be sandwiched or front-run in the public block space like any other. It does not measure third-party uptime — if the aggregator is down, the site's status reflects the site's components, not the aggregator's. It does not measure the accuracy of reference prices for non-routeable assets — those come from a public market data provider and are cached, and the figures displayed should be treated as indicative rather than exact. Each of these is outside the scope of what a router frontend can verify, and naming them is more useful than omitting them.
How is a multi-hop or split route built into a single transaction?
The router returns a sequence of pool instructions rather than a single instruction: a split route has several instructions that consume the input amount in parallel pools, and a multi-hop route has sequential instructions where each pool's output feeds the next pool's input. The frontend assembles these into a single Solana transaction, and the wallet signs once. The transaction executes atomically — if any instruction in the sequence fails, the whole transaction reverts. There is no partial execution where some pools fill and others do not. That is the sense in which a split route is still one transaction: it is one signature, one atomic unit, one outcome.
What is the quote cache, and why does it exist?
The quote cache is a short-lived in-memory store on the frontend that holds the most recent quote for a given pair, amount, and slippage setting. Its purpose is to prevent the router from being queried on every keystroke in the amount field, which would produce a flood of redundant requests during normal typing. The cache window is a few seconds, and any change to the pair, the amount, or the slippage bound forces a fresh request. The trade-off is that a quote served from cache may be a few seconds stale — a limitation that matters only during active volatility and is mitigated by the fact that the cache is invalidated on every input change.
Why does the methodology page avoid promising 'safe' or 'cheap'?
Because both words are relative to a baseline the page does not define. 'Safe' relative to what — a custodial exchange, a smart contract with an audit, a permissionless pool? 'Cheap' relative to what — a centralized venue with maker-taker fees, a different Solana frontend, the same swap at a different time? A methodology page that uses those words without defining the baseline is making a claim that cannot be checked. The page describes the specific costs (the network fee, the pool fee embedded in the route, and the price impact for the requested size) and the specific guarantees (atomic execution, non-custodial flow, no platform fee), and leaves the evaluation of relative safety and cost to the reader who has the baseline in mind.
How do you handle corrections to the methodology itself?
Every claim on this page is meant to be checkable against the site's behavior, and a claim that turns out to be wrong is a substantive error, not a stylistic one. Corrections are made on the page and logged on the Editorial Policy page with the date, the specific claim that was corrected, and the correction itself. A claim that cannot be verified in practice is removed rather than rephrased to be unfalsifiable. The intent is that a reader can compare the page against the site's actual behavior and reach a conclusion about which claims hold and which do not.