How a Solana Swap Actually Works: Quote, Route, Sign, Settle — and What Fails Between Them
A non-custodial swap on Solana is six discrete steps, each performed by a different piece of software, and each with its own characteristic failure. The quote engine ranks venues. The router chooses a path. The wallet constructs and signs. The network orders and executes. The explorer records what happened. Understanding which layer does what is the difference between diagnosing a swap that failed and guessing at it. What follows is the flow, without spin in either direction.
The Six Steps, and What Each One Actually Does
Step 1 — Connect the wallet. The wallet shares its public key with the frontend. Nothing else leaves the wallet: no private key, no seed phrase, no signing authority. The connection is read-only in the sense that it grants the page the ability to see your address and balance, not to move funds. It can be revoked at any time, and revoking it does not affect tokens that have already been swapped — those tokens are in your wallet, not in any SwapKing-controlled account. A wallet that fails at this step is a wallet problem: extension not installed, browser blocking the connection, or the wallet pointed at a chain other than Solana.
Step 2 — Request a quote. The frontend asks the quote engine for a route on the specified pair and amount. The engine queries every indexed venue in parallel — Orca, Raydium, Meteora, Phoenix, Jupiter, PumpSwap — simulates each pool's curve for the amount requested, and returns the venue or combination of venues that produces the best net output after fees. The result includes the route, the expected output amount, a price impact estimate, and the specific pool path the transaction will take. The quote is a snapshot, not a standing offer. It is valid for the blockhash window during which it was issued; if too much time passes before the transaction is built and signed, the quote must be refreshed. A quote engine that fails produces a widget with an empty receive field and no route chips.
Step 3 — Build the transaction. The frontend constructs a Solana transaction that matches the returned route. The transaction is not yet signed and does not move any funds. It contains the input mint, the output mint, the input amount, the minimum output amount (derived from your slippage bound), the pool instructions, the network fee, and — for first-time swaps into some tokens — the associated-token-account creation instruction. The wallet has not yet seen the transaction at this stage. A frontend that fails at this step produces a wallet prompt that never appears, or a wallet prompt that appears with an obviously wrong amount.
Step 4 — Sign in the wallet. The wallet renders the transaction in its own UI — input amount, expected output, minimum received, fee — and lets you approve or reject. The signing happens locally in the wallet. SwapKing never sees the signature before the wallet applies it, and cannot produce a signature on its own. This is the single most important property of the flow: the wallet is the only party that can authorize a transaction, and it is the only party that sees the final state before authorization. A wallet that fails at this step produces a rejection, a signing prompt that never appears, or a signature that is not accepted by the network.
Step 5 — Broadcast and confirm. The signed transaction is submitted to Solana. Validators order it relative to other transactions and execute it in a slot. The execution is atomic: either every instruction in the transaction succeeds and the output token arrives in the signing wallet, or the entire transaction reverts and the only funds that moved are the network fee. There is no partial state. If the pool price has moved past the slippage bound between quote and execution, the transaction reverts with a slippage error. If the network is congested and the transaction is not included within the blockhash window, it expires and is dropped. A network that fails at this step produces a transaction that does not confirm, or a confirmation that arrives far later than expected.
Step 6 — Record and verify. Every confirmed swap leaves a transaction signature. The signature is the definitive record: paste it into a Solana explorer and the balance delta, the fee paid, and the accounts touched are all visible. That record is more reliable than the wallet's display, which can lag behind chain state during busy periods. A wallet that shows no USDC after a confirmed USDC swap is almost always a token-list refresh problem, not a delivery problem — the tokens are in the associated token account whether or not the wallet's display has caught up.
The Three Layers, and Which Failures Belong to Each
The SwapKing layer — the frontend and the quote engine. This layer's job is to find the best available route and construct a transaction that executes it. Its characteristic failure is a stale or missing quote: the receive field lags or stays empty, the route chips do not appear, or the wallet prompt shows an amount that does not match what the quote panel displayed. A failure here does not move funds. The correct response is to refresh the quote, check the Status page, and try again.
The wallet layer. This layer's job is to hold the signing authority and to render the transaction for approval. Its characteristic failure is a rejection, a signing prompt that does not appear, or a signature that is not accepted. A failure here also does not move funds, but it may leave the transaction in a partially-signed state that requires the user to start over. The correct response is to check the wallet's connection to the network, confirm that the wallet is pointed at the correct cluster (mainnet-beta), and try again.
The Solana network layer. This layer's job is to order and execute the transaction. Its characteristic failure is a slippage revert, a blockhash expiry, or a confirmation that does not arrive. A slippage revert consumes only the fee and leaves the balance unchanged apart from that. A blockhash expiry leaves the transaction unexecuted and requires a re-quote. A confirmation that does not arrive but does eventually land at a later slot will still move funds; a confirmation that is genuinely dropped will not. The explorer is the definitive authority on which case applies.
What the Transaction Actually Contains
A Solana swap transaction contains six categories of instruction. The input mint and amount: which token is being sent and how much. The output mint and minimum amount: which token is expected back and the smallest acceptable amount, derived from the slippage bound. The pool path: which AMM pools the trade will touch and in what order, including any split across pools. The associated-token-account instructions, if the wallet does not yet have a token account for the output token. The network fee instructions: the small amount of SOL that pays for the transaction. And a recent blockhash, which is the transaction's validity window. If any of these is wrong — the wrong mint, the wrong minimum, the wrong path — the wallet will show it, and the correct response is to reject and re-check rather than to sign and hope.
The minimum output amount is the single most important number in the transaction, because it is the only thing the transaction guarantees about the price. The pool can fill you at any price above that minimum, and the transaction will succeed. It cannot fill you below the minimum, and the transaction will revert. That is what the slippage bound actually means at the protocol level: it is the floor under the fill, not a promise that the fill will be at the quote.
What SwapKing Does Not See and Cannot Do
SwapKing does not see your private key, your seed phrase, or your wallet password. It does not hold your SPL tokens at any point in the flow. It does not have the ability to sign a transaction on your behalf, and no amount of frontend manipulation can create that ability — the signature is produced by the wallet, not by the page. It does not store a record of your swaps beyond what is publicly visible on-chain. If a site ever asks for your seed phrase or your private key, it is not SwapKing, regardless of what the page looks like.
What SwapKing does do is construct the transaction and hand it to the wallet for approval. That is the entirety of its role in the signing step. The wallet decides whether to approve. The network decides whether to execute. The explorer decides what the historical record shows. Each of those is a distinct authority, and none of them belongs to SwapKing.
Related
Security overview Methodology Status Slippage Explained Verify a Contract