> For the complete documentation index, see [llms.txt](https://docs.trover.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trover.tech/engineering/trading-runbook.md).

# Trading operations runbook

## Launch

1. Rotate and configure Privy, X, RPC, Blockscout, and Uniswap credentials.
2. Apply migrations and seed settings.
3. Enable Twitter/X login and linking in the Privy dashboard.
4. Register `/v1/privy/webhook` for transaction and balance events and install its signing key.
5. Configure `ROBINHOOD_REGISTRY_URL` and the documented feed-registry source, then trigger the registry sync.
6. Confirm each enabled asset is canonical, onchain verified, and policy-allowed. Before execution, also confirm a healthy price or live quote, an allowlisted route, simulation, and current wallet policy. Blockscout is independent supporting evidence and is not an availability gate.
7. Link an X account and canonical Privy wallet, then run a minimal-size test trade.

## Integration and testnet verification

Run `pnpm test:integration:docker` to build and start PostgreSQL, Redis, migration, API, worker, and web containers. Compose waits for every health check, then runs infrastructure tests and live RPC/Blockscout/Dexscreener/X/Privy checks using `.env`. No provider mocks are launched. `TRADING_DRY_RUN=true` is forced for the suite.

Run `pnpm test:testnet` for read-only validation against the official Robinhood Chain testnet (`46630`). A funded transaction test runs only when `TESTNET_PRIVATE_KEY` is explicitly provided as a `0x`-prefixed disposable key. Never use a production or previously exposed key. The official faucet requires an interactive wallet connection and may require sign-in; do not automate around those controls.

## Default behavior and settings

Mention trading, DM trading, and direct social execution default to true. Optional controls default to false and can be enabled without redeployment:

```
require_enrollment
require_confirmation
require_mfa
require_disclosure
geo_restrictions
sanctions_screening
region_denylist
enforce_trade_limits
enforce_min_liquidity
enforce_privy_policy
enable_siwe_linking
direct_social_execution
```

## Emergency stop

Set `ENABLE_TRADING=false` and restart API/workers to stop all new executions. Set `ENABLE_X_TRADING=false` to stop only X-originated commands. Pause a single token through the admin stock-token endpoint. `TRADING_DRY_RUN=true` retains quotes and audit records without submitting swaps.

## Alerts

Alert on failed, reverted, or uncertain trade metrics; Privy signature failures; non-4663 transaction payloads; active tokens becoming unsupported; oracle pauses or multiplier changes; executions stuck beyond the expected finality window; and treasury USDG above threshold without a successful buyer job.

## Reconciliation

The reconciliation scheduler runs every minute. It resolves by transaction hash first, then Privy transaction ID or `reference_id`, and records the provider payload and receipt. An ambiguous submit is marked uncertain and is never blindly rebroadcast. Requeue only the original idempotent intent after reconciliation proves no transaction exists.

## Canonical address change

Pause the old token, add the new Robinhood-published address as a separate registry row, and let the verifier validate it. Never mutate an old address into a new identity. Existing balances remain attached to the old record.

## Treasury

Treasury buying is off by default. Configure its Privy wallet, target symbols, and threshold, then set `TREASURY_BUY_ENABLED=true`. Targets must already be active in the canonical registry. Review ledger entries against receipts and vault balances daily.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.trover.tech/engineering/trading-runbook.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
