> For the complete documentation index, see [llms.txt](https://hweippy.gitbook.io/copychain/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hweippy.gitbook.io/copychain/using-copychain/trading-modes.md). Agents can also search and read this documentation through its [MCP server](https://hweippy.gitbook.io/copychain/~gitbook/mcp).

# Trading modes

CopyChain reads the chain, decides what to trade, and sends arbitrage transactions through Prism. The mode of a config only changes the second step: where the markets come from.

```mermaid
flowchart LR
    G[gRPC providers] --> S[Live stream]
    S --> M[Market view: wallets, successes, live pools]
    S --> D{Mode of the config}
    D -->|Copy wallets| C[Mints and pools of the copied wallet]
    D -->|Static markets| K[Pools you listed]
    D -->|Auto Markets| A[Pools picked from live activity]
    C --> X[Session]
    K --> X
    A --> X
    X --> P[Prism arbitrage transaction]
    P --> R[Senders: RPC, Jito, vendors]
    R --> L[Landed results in the terminal]
```

## The stream

CopyChain subscribes to the transactions of the arbitrage programs (Settings > Connection > Arbitrage programs) through one or more Yellowstone gRPC providers. It reads confirmed blocks. From each arbitrage transaction it reads the wallet, the bot, the mints, the pools, the fees, the tips and the result. That feeds the market view, and the copy configs.

## Sessions

A session is a set of mints and pools that CopyChain trades together, with one signing wallet. While a session is active, CopyChain sends arbitrage transactions for it in rounds:

* Each round, each enabled sender sends `count` transactions, after its `process_delay`.
* Each transaction is one Prism instruction. Prism finds the best route through the pools of the session (2 to 5 hops) and checks the profit when the transaction runs.
* Profit and failures show in the wallet row of the signer, in Successes and in the run bar.

How a session starts and ends depends on the mode:

| Mode                                                                                               | Session start                                      | Session end                                                            |
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------- | ---------------------------------------------------------------------- |
| [Copy wallets](https://hweippy.gitbook.io/copychain/using-copychain/trading-modes/copy-wallets.md) | The copied wallet lands an arbitrage.              | No new landing of the wallet for `sessions.timeout` seconds.           |
| [Static markets](https://hweippy.gitbook.io/copychain/using-copychain/trading-modes/markets.md)    | The config starts. One session per pool group.     | The config stops, or the group leaves the source.                      |
| [Auto Markets](https://hweippy.gitbook.io/copychain/using-copychain/trading-modes/auto-markets.md) | A pool passes a start rule and a session has room. | The pool no longer passes its rules, or a better mint takes its place. |

## Sending

A config sends through one or more senders:

* **RPC:** the RPC URLs that you set. See [RPC sender](https://hweippy.gitbook.io/copychain/configuration/parameters/sending.rpc.md).
* **Jito:** bundles to the Jito block engines. A bundle never lands failed. See [Jito](https://hweippy.gitbook.io/copychain/configuration/parameters/sending.jito.md).
* **Vendors:** send services such as Helius, Temporal, bloXroute and others, each with its tip addresses. See [Vendors](https://hweippy.gitbook.io/copychain/configuration/parameters/sending.vendors.md).

Each sender sets its priority fee and tip. A fee or tip can be fixed, copied from the source wallet, read from a feed, or `auto` (the median that other arbitrage bots pay now). See [sending.defaults](https://hweippy.gitbook.io/copychain/configuration/parameters/sending.defaults.md).

Transactions use V1 by default (no lookup tables, up to 4,096 bytes). V0 remains available per sender.

## Safety

* **Dry run:** an Auto Markets config with `dry_run = true` makes every decision and sends nothing.
* **Low balance:** a config stops when its signer reaches Settings > Balance > Stop at.
* **Lag:** sending pauses while the RPC node is behind the network, unless Copy when lagging is on.
* **No profit, no cost but fees:** with `fail_if_no_profit` (on by default), a transaction that finds no profit fails on chain and costs only its fees.

## Fees

Prism takes a 10% performance fee on profitable executions. CopyChain adds no fee instruction of its own. See [Pricing](https://hweippy.gitbook.io/copychain/misc/pricing.md).
