docs › Paper trading and the safety model
Paper trading and the safety model
The PAPER ticket, the simulated wallet, the confirm gate, order plans on paper, PnL cards and the trade ledger. dexterm holds no key and signs nothing.
Trading in dexterm is PAPER by default: a simulated wallet priced from live, keyless Jupiter quotes. Nothing is signed, no key is held, no transaction is sent, and the paper code imports no wallet or signing library of any kind. Every ticket and positions frame says so in a banner that is never hidden.
dexterm has no live trading path of its own: it holds no key, has no trading wallet and builds or sends no transaction. Live trading happens in a Telegram trading bot of your choice; see Live trading. Real mode is experimental; signals to your own executor; dexterm never holds a key; not financial advice (see Real mode).

The ticket#
B or S on a token opens a buy or sell ticket. It shows the side, the size (SOL or % of balance when buying; % of the position when selling), slippage in bps, and a rolling Jupiter quote refreshed every 5 s while you edit: what you pay, what you receive, price in SOL and USD, price impact (as a percent; Jupiter reports a 0..1 fraction and the app converts it once), the simulated fee, the route and the minimum received. Keys: digits type, tab switches field, ←/→ flips the side, u toggles the unit, ⏎ reviews, esc cancels. Token amounts are shown as quantities, so a small buy of an expensive token reads 0.0144 AVGOx, never 0; until the token's decimals are known the ticket says so instead of printing a guess.
The confirm gate is on by default. ⏎ arms the order; y (or ⏎ again) confirms. For a notional above 1 SOL you must type the size back digit for digit before the confirm counts. Any other key during the confirm step cancels the arm: a stray key can never confirm, and q or a screen number cannot navigate out from under an armed order. The fill is computed from a fresh quote at confirm time, never from the quote on screen, and is booked into the paper wallet in one SQLite transaction. If Jupiter rate-limits during the confirm the ticket says so, retries for up to 8 s, then lands in an error state you can retry or cancel; it never hangs.
The wallet#
- starts at 10 SOL (configurable), persisted in the same SQLite file as the cache and watchlist (
--db;:memory:for a throwaway session); - books every fill append-only with the simulated fee (5 000 lamports per fill, labelled as a simulation);
- marks positions from DexScreener's USD price over the live SOL price every 10 s on the positions screen;
- shows a
◈ POSITION · PAPERrow under the chart on any token you hold, and the same row plus entry line and fill markers in the chart popup.
The analyst can open a PAPER ticket for you (open_ticket, pre-filled, editing phase) when you ask it to buy or sell. It cannot size it past what you typed, arm it or confirm it; it tells you to confirm yourself.
Letting an agent paper trade (experimental)#
If you want to, you can let an agent connected over dexterm mcp run the whole PAPER loop (open, size, confirm and close) inside a trading mandate you armed, by starting dexterm --spectate-mcp --agent-paper <mandate-id>. It is paper only. The agent can never sign, send a transaction, touch keys or raise a cap, a size over your caps is refused, and you can pause, take over or stop it at any time. See Agent paper trading. It is experimental and off by default, and simulated figures are not a result.
Link a wallet (read-only)#
dexterm wallet link (or /wallet link typed on the screener's / line or in the chat box) starts a one-shot server on 127.0.0.1:41291 (a fixed loopback port; a random one only if it is busy, and the page then says so) with a single-use token, and opens your browser to it. The page asks Phantom to connect and sign a message (a dexterm nonce): no transaction, no approval of funds. dexterm verifies the Ed25519 proof and stores only your public key in ~/.dexterm/wallet-link.json, to show your address. dexterm wallet status, unlink, /wallet, /wallet unlink show or remove it. No private key, seed or password ever reaches dexterm; it has no code that could hold one, and it never asks Phantom to sign a transaction.
Panic#
/wallet panic in the app, or dexterm wallet panic from any shell, any time: it writes a kill-switch file that every autotrade runner and the paper agent desk re-read on every step, so they halt at once. The only way back is dexterm wallet resume in a real terminal: it needs a physical keypress on a TTY and refuses piped input.
Order plans and standing mandates#
Labelled in progress: the engine, the typed and spoken proposal paths, the O screen, the popup and the audit journal are on main, and every plan fills on paper. There is no live fire path: plans never sign or send anything.
An order plan is "buy this coin if it dips to 300k market cap, sell half at 600k, keep the rest as a moon bag", written down once: one entry trigger (market cap or price, below or above, or immediate), a ladder of take-profit tranches (each an above-trigger with a fraction; whatever the fractions leave is the moon bag), an optional stop (a below-trigger, below the entry), slippage and impact ceilings and an expiry (4 h by default, 7 days at most). dexterm plan propose --mint M --size 20 --entry mc-below:300k --tp mc-above:600k:50% --stop mc-below:150k writes one; so does saying it to Jarvis or an agent's propose_order_plan tool. All three produce the same thing: an inert proposal with a SHA-256 hash of its material fields and a plain-language read-back. A proposal fires nothing.
A standing mandate is the budget a set of plans may spend: a total, a per-trade cap, a per-coin cap, a daily-loss cap, the highest confirmation tier it accepts and a time-to-live. Every cap is clamped to a hard ceiling ($2000 total, $500 per trade, $1000 per coin, $2000 daily loss, 24 h) and nothing is ever coerced upward: there is no "raise cap" anywhere; a different cap is a new draft that needs a new arming gesture. dexterm mandate draft --total 100 --per-trade 20 --ttl-hours 4 writes one; --max-open N and --max-impact PCT set the open-position and price-impact limits (clamped the same way).
Paper-only mandates#
dexterm mandate draft --paper drafts a paper-only mandate for agent paper trading. It has its own, higher paper ceilings ($10,000 total, $2000 per trade, $2000 per coin, $10,000 daily loss, 10% price impact) so an agent can practise at a realistic size, and it still needs your physical keypress to arm. Only the agent paper desk reads it: the plan engine refuses to arm a plan into it, fire a plan under it or run copy trading through it, and every other mandate keeps the ceilings above. The agent still gets a quarter of its per-trade cap, and every fill is priced on a live quote, so a bigger simulated size pays its real price impact.
Arming a plan under a mandate is the only step that lets anything fire, and it is a physical gesture: a key held at the terminal on the O screen (a) or dexterm plan arm <id> --mandate <id> on a real TTY, which refuses a pipe or a subprocess. The gesture proof is bound to the plan hash, single-use and expiring, so an edited plan voids every earlier confirmation. Once armed, a monitor fed by the prices the terminal already shows (the screener rows, the watchlist, the open token; never fixture data) fires the entry, each take-profit tranche and the stop only inside the armed plan and only through the paper executor, which re-checks the mandate caps and the panic marker on every fill. dexterm plan amend <id> --size 25 --entry mc-below:280k edits a proposed plan: the edit is a new plan with a new hash, the old proposal is superseded and every earlier confirmation is void, so arming it is a new keypress; an armed plan cannot be edited (cancel it first). Cancel (c), revoke (r) and panic (!, or dexterm wallet panic) stop a plan at once; nothing resumes a paused plan without a new keypress.
Two confirmation tiers beyond the keypress exist in the model and are off by default: ptt-held (push-to-talk held while you speak the confirmation) fires at 0.5× the per-trade cap and hands-free at 0.25×, and neither can arm a mandate or a batch. Turning hands-free on is the only "less safe" switch in dexterm: G on the O screen raises a prompt that says so, it is accepted by a keypress only (a spoken or agent "yes" is refused), it is journaled, it expires after 24 h and G again restores the gate.
The journal (~/.dexterm/plans.journal) is append-only and hash-chained; every proposal, arm, fire, fill, cancel, revoke, gate change and refusal is a row, dexterm plan journal --verify recomputes the chain and --export dumps it, and it is the source the service recovers from after a crash. The popup is a read-only HUD fed view models only (never a key, a secret or an arm capability); its single write is "cancel this plan", re-validated at the server allow-list and again at the terminal.
What is proven, on fixtures and a fake clock: the north-star plan fills end to end on the paper executor; a replayed price stream fires each leg once; and a compromised-model suite shows that spoken text, agent text, a forged proof, a replayed proof, a widened mandate and an edited plan with an old confirmation all fail to arm, raise a cap, widen a mandate, resume a paused plan, or accept the risk prompt.
Trade moments#
The cyberspace look reacts to a trade, but only to its result. A confirmed buy fires a green shockwave from the ticket with coins streaming up; a profitable sell a gold burst and gold rain; a loss red static that collapses down the screen (no shake, no mockery); and a refused or failed order a red lockout flicker in the bands. Normal and fever tiers differ in length and density; --calm shows none of it and the result card still lands at once; any key skips a running moment.
Two things are mechanical, not conventions. Only a settled outcome can fire a moment: the ticket reports exactly one outcome per booked paper fill or failure, and the effects engine refuses anything without a confirmed-or-failed status; a quote or an armed order fires nothing, and a test checks the one call site. The ticket is shielded: every cell of the ticket and the PAPER banner is marked off-limits on the cell buffer, so rain, glitch, datamosh, scanlines and the moments cannot write a glyph, a colour or a background into it in any phase (tested byte-identical against a calm render at 176, 120 and 90 columns). --sound (or DEXTERM_SOUND=1) adds short synthesized cues after the same outcome: a buy chirp, a sell sweep then a chime or a thud, a buzz on a failure. Muted by default; the WAVs are written once to ~/.dexterm/sounds and played detached so the render loop never waits.
PnL cards#
H on a token, on the positions screen (P) or on the followed-wallets screen (U) opens a preview of a PnL card for a coin you have fills for: ticker and image, entry and exit as the coin's market cap (or the mark for an open position), the PnL %, hold time, size, the dates, and a dexterm footer. It is saved as a 1200×675 PNG (the X card size), a 1080×1080 PNG and a text file in ~/.dexterm/exports/.
- The stamp cannot be removed. A card says where its numbers came from: PAPER (the simulated wallet, no real funds) or TRACKED WALLET (a followed wallet's public history, read-only). The stamp is a solid block, the frame colour and a repeating strip, and no option hides it.
- Numbers come only from the records. The PnL is computed from the fills, net of fees (realized for a closed position; realized plus unrealized at the latest price mark for an open one, which waits for a mark). You cannot type a number into a card. Each card prints its time window, the fee basis, what it leaves out (a tracked wallet's token-to-token swaps, transfers or airdrops) and the age of its data.
- Market cap or price. When dexterm knows the coin's supply, entry and exit are shown as market cap: the average fill price times the supply, never a quoted market cap. The supply is the coin's recorded FDV ÷ price, or pump.fun's fixed 1 billion for a pump.fun coin. The card names that source and the USD rate it used (the current SOL price for a paper or tracked card). Exit is the blended average of every sell; with two or more sells, the last sell gets its own row. m in the preview switches to the SOL price per token and back. A coin with no known supply stays on the price view, and the card says why.
- Private by default. The wallet address is hidden, and the size shows as a band (
0.5-1 SOL). a shows the wallet, z the exact size; no balance or key is ever on a card. - Sharing is yours. x saves the card, copies the image to the clipboard where your OS allows it (macOS; Linux with
wl-copyorxclip) and opens X's compose page in your browser with a short neutral text (the stamp in words, no coin and no numbers). You paste the image and post. dexterm does not post, has no X credentials for this and sends nothing. t copies the text version, s only saves; f flips 16:9 and 1:1, ←/→ move between coins, esc closes.
A card shows one position's own fills. It is not a track record, and paper trading is not a result; the footer says so, along with "not financial advice".
The trade ledger#
dexterm ledger puts every trade dexterm booked in one table: the paper ticket, the agent paper desk and autotrade runs. One row is one round trip: the strategy and its version, the exit profile and entry reason the trade was opened with, the exit reason, size and share of the book, entry and exit as price and market cap, fees, hold time, the best and worst move while held (MFE / MAE, from the fills), and whether it rugged. Every row dexterm books is PAPER.
dexterm ledger tradeslists them, newest first;positionsshows what is open.dexterm ledger summarygives the win rate with its 95% interval, P/L, profit factor, max drawdown, rug rate and hold time, broken down by profile, exit reason, strategy, source and mode.equitydraws the realized equity curve.dexterm ledger compareputs strategy versions side by side, which is how you read strategies you forward-test in parallel.dexterm ledger export csv|json|parquet-litewrites the rows out for your own spreadsheet or notebook.dexterm ledger card <tradeId>makes a PnL card from a ledger row, with market cap at entry and exit.- Filters:
--source,--mode,--strategy id[@version],--profile,--exit,--mint,--run,--account,--days,--status.--account IDkeeps the trades of the strategies on one paper account; the export has anaccountcolumn.
Declared, not guessed. An agent declares its exit profile when it buys and its exit reason when it sells, as typed fields on the paper desk (or a PROFILE / EXIT line), and the ledger shows where each tag came from: declared with the fill, from an exit rule, from a tag line, declared later, or missing. Undeclared trades are counted, not filled in.
Your file, append-only. Reads never write. dexterm ledger sync appends what the sources hold to ~/.dexterm/ledger/trades.jsonl, where every line is sha256-chained to the one before; dexterm ledger verify recomputes the chain and names the first edited line, and an edited file is never appended to. No network, no model, no key.
PAPER rows are simulated. A small number of trades says little, and the summary says so. Not financial advice.
The safety model#
These are the invariants; hold us to them:
- No custody. dexterm holds no private key, has no trading wallet and has no signing code. The Phantom link stores only your public key, from a signed message.
- Nothing is sent. dexterm builds no transaction and sends none. Every ticket, plan, autotrade run and agent fill is paper.
- Keypress gate on by default. Models and voice create proposals; arming a plan or confirming a ticket needs a physical keypress. Opting out, if ever offered, needs an explicit "this is less safe" confirmation and is local, logged and reversible.
- The AI has no trading interface. No build, sign or send tool exists for the model. Its write-shaped tools are paper only:
open_ticketopens a PAPER ticket, and (only if you start--agent-paperon a mandate you armed) an agent you connected can use thepaper_*tools to book the simulated ledger inside that mandate. A registry test enumerates every MCP tool and fails if any could reach a signing or sending path.