# Incidents

What a trader sees during an incident, what still works, and how Koine says so.

## How you'd be told

Updates go on X at [@koinemarkets](https://x.com/koinemarkets). Most halt messages in the bot and the web point there; the buy halt message doesn't.

**The bot doesn't message you when a halt starts.** `/halt` replies only to the admin who set it. You find out when you try something, or from X.

Source: trade/server/bot.ts (haltCommand, SUPPORT_URL), trade/server/trading.ts (quoteSell)

## The switches

| Switch | Where it's set | What it stops |
| --- | --- | --- |
| Halt buys | The bot, admins only | New buy quotes, presale deposits and claims. Limit buys and buys at open wait |
| Halt sells | The bot, admins only | New sell quotes, exits, presale withdrawals and refunds, rent refunds |
| Halt withdrawals | The bot, admins only | Sending withdrawals |
| Halt keys | The bot, admins only | Key export links and reveals, and saved-address changes |
| Halt all | The bot, admins only | All four above |

The withdrawal approver has halts of its own, set separately, as the bot's reply to `/halt` says. Its `halt` refuses withdrawals, owner policy updates (a new saved address) and key exports, and leaves trading alone; `halt_swaps` stops every trade, exit and presale action while swap co-signing is on. See [Security](https://docs.koine.markets/terminal/security#halts-alerts-and-the-chain-watcher). Only a 403 or 409 from the approver counts as a refusal. Any other error, a 503 included, is treated as no answer, and a withdrawal is tried again, up to 3 tries in all. Koine can also stop the trading service or rotate its Privy secret, and then nothing is signed.

Source: trade/server/bot.ts (HALTS, haltCommand), trade/server/approver.ts (ApproverError), approver/src/approver.ts (approve, approveSwap), trade/server/refunds.ts, trade/server/presale.ts, trade/server/limits.ts

## What still works

| Your action | Halt buys | Halt sells | Halt withdrawals | Halt keys | Halt all | Trading service stopped |
| --- | --- | --- | --- | --- | --- | --- |
| New buy | No | Yes | Yes | Yes | No | No |
| Sell by hand | Yes | No | Yes | Yes | No | No |
| Exits fire | Yes | No | Yes | Yes | No | No |
| Withdrawal goes out | Yes | Yes | No, waits | Yes | No, waits | No |
| Key export | Yes | Yes | Yes | No, waits | No, waits | No |
| Saved-address change | Yes | Yes | Yes | No | No | No |
| Tie or cancel a knot | Yes | Yes | Yes | Yes | Yes | No |
| Cancel a waiting withdrawal | Yes | Yes | Yes | Yes | Yes | No |
| See your wallet on chain | Yes | Yes | Yes | Yes | Yes | Yes |

Source: trade/server/rules.ts, trade/server/trading.ts, trade/server/exits.ts, trade/server/withdraw.ts, trade/server/export.ts, trade/server/knots.ts

## What you'd see

**A buy during a halt.** "Koine has paused buying for everyone right now. Sells still work." During a halt of sells too, it says all trading is paused, sells included.

**A sell during a halt.** "Koine has paused all trading during an incident, sells included. Updates are on X: @koinemarkets."

**A quote you already have.** Halts are checked when a quote is made, not when you press it. A quote signed before a halt can still go out if you press it within its 10 minutes in the bot, or its 20 seconds on the web.

**An exit during a sells halt.** It doesn't fire. The position's high keeps updating. Once sells resume, it fires if still due, at that later price.

**An exit when a provider fails.** It tries up to 3 times, then stops for that position and tells you.

**A withdrawal during a withdrawals halt.** The bot says it was "recorded, not sent" and offers a cancel. It stays waiting and goes out after the halt ends. Its SOL stays set aside.

**A withdrawal the approver refuses.** It's marked failed, and you're told nothing left your wallet and to try again. One where the approver doesn't answer is retried, up to 3 tries in all.

**A key export during a keys halt.** New requests are refused in the bot; on the web a request is recorded and waits. A link that came due isn't sent until the halt ends, and a reveal is refused with a message. A saved-address change is refused, and one already waiting that comes due waits.

**The trading service down.** The bot's trading screens and the web terminal stop. Exits, limit buys and buys at open don't run. Funds stay on chain under their policies.

**Privy, Jupiter, Helius or Telegram down.** Trading is degraded until they're back. If Privy is down, nothing can be signed.

Source: trade/server/rules.ts, trade/server/trading.ts, trade/server/orders.ts (DRAFT_TTL_MS), trade/server/exits.ts, trade/server/withdraw.ts, trade/server/export.ts, trade/server/bot.ts, trade/server/web.ts (/web/export/request), app/web/src/terminal/components/terminal/useTrade.ts

## Alerts to Koine's admins

The trading service messages its admins, at most once per kind every 30 minutes, when: 3 or more orders failed or expired in 10 minutes (not counting slippage); exits haven't finished a check in 60 seconds; a position has had no fresh price for over 2 minutes; receipts sit unconfirmed for over 10 minutes; Helius keys run out of credits; the RPC fails 3 checks in a row; the receipts key holds under 0.01 SOL; the ops key holds under 0.03 SOL; the referral payout wallet is short; or an exit gave up after 3 tries.

Source: trade/server/alerts.ts, trade/server/exits.ts

## Watching your wallet

Your wallet address is public. Any block explorer shows what it did, without Koine. If your wallet is flagged for [receipts](https://docs.koine.markets/terminal/receipts), the explorer also shows its memos, and the checker in this repository can verify them.

Source: trade/server/verify.ts
