# Trade flow

Every trade follows the same path from click to confirmation.

## 1. You click a preset

The FastTrack overlay reads the current token page on axiom.trade and identifies the token mint. When you click a buy or sell button, the extension sends the trade request to our backend with:

* The token mint (or pool address — we figure out which).
* The amount (SOL for buys, percentage of token balance for sells).
* Your slippage tolerance.

## 2. We resolve the venue

Our backend looks up the token on chain and decides which trading venue to route through. Native paths exist for the most common venues; everything else routes through Jupiter for best-execution.

The resolver chooses based on:

* Where the token's primary liquidity lives.
* Whether the pair is SOL-quoted or USDC/USD1-quoted.
* Your routing preferences (you can force Jupiter via a settings toggle).

See [Routing and execution](/how-it-works/routing.md) for the supported venues.

## 3. We build the transaction

The backend constructs a Solana transaction with:

* A compute budget instruction (so the trade has enough compute for any venue).
* A priority fee instruction (based on current network congestion).
* A tip instruction (if you've configured a landing service like Jito).
* Our 1% fee transfer to a master wallet.
* The swap instruction.
* Wrap/unwrap SOL instructions when needed.

The entire trade is atomic: every instruction must succeed or none of them do. There's no scenario where you pay the fee but the swap fails.

## 4. We sign

Your private key is decrypted in-memory using AES-256-GCM, used to sign the transaction, then immediately discarded. The decrypted bytes never leave that scope.

## 5. We submit

We send the signed transaction to multiple endpoints in parallel:

* Direct RPC submission to the Solana network.
* Optional landing services you've configured for faster confirmation.

The first endpoint to land the transaction wins. The other submissions of the same signature are no-ops on the chain.

## 6. We confirm

A background poller watches the network for confirmation. When the transaction confirms:

* The trade is marked confirmed in our database.
* Your lifetime volume is bumped.
* Cashback for you is credited.
* Referral rows are written for your upline (up to three levels).

## 7. You see the result

The extension polls our API for trade status and shows you confirmed / failed / pending in the popup. Your token balance updates within seconds.

## Failures

Trades fail for several reasons:

* **Slippage too tight.** Real-time price moved more than your slippage tolerance. The transaction reverts; you keep your SOL.
* **Insufficient SOL.** Wallet balance too low. The transaction fails before submission.
* **Network congestion.** The transaction is dropped from the mempool. Solana doesn't charge for dropped transactions.
* **Pool drained.** Sometimes a token's liquidity is removed mid-swap. The transaction reverts.

In all cases, your funds remain in your wallet. You can retry immediately.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.willet.cc/how-it-works/trade-flow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
