TW_DOOR_ENABLED | Default off. The one switch for the bot door: GET /torii/door, GET /torii/skill.md, GET /torii/mcp-tools and the mandate_* tools on /mcp?profile=full. Off: the three routes answer 404 like a missing path, the tools are not listed and a call to one is refused as not available. On (1, true, yes, on): all open. Read on every request, so it needs a restart of the API process, not a code change. The owner routes under /torii/mandates are not behind it |
TW_MANDATE_FACTORY_ADDRESS | The vault factory. While unset, create-call answers configured: false and no vault exists |
TW_USDC_ADDRESS | USDC address when it is not in deployments/base-sepolia.json. The deposit watcher falls back to the built-in Base Sepolia USDC (with a logged warning) when neither exists |
TW_RPC_URL | The RPC the chain reader and receipt checks use |
TW_BEST_WAY_IN | JSON {"chain","asset"} that fills a missing destination in deposit routes |
TW_BUDGET_ENFORCE | Default off. On: a paid read over the agent's daily Cherry budget is refused (mandate_budget_exceeded) |
TW_ALERTS_DRY_RUN | Default on (1): the alerts worker counts and sends nothing |
TW_DEPOSIT_WATCH_DRY_RUN | The deposit watcher's dry run |
TW_VAULT_POLL_DRY_RUN, TW_VAULT_POLL_SEC, TW_VAULT_POLL_MAX | The per-mandate vault poller (nw_tw_vault_poll). Dry run is on by default |
TW_VAULT_EVENTS_DRY_RUN, TW_VAULT_EVENTS_SEC, TW_VAULT_EVENTS_MAX_BLOCKS_PER_TICK (20000; old name TW_VAULT_EVENTS_MAX_BLOCKS), TW_VAULT_EVENTS_MAX_SPAN (2000 blocks per eth_getLogs, halved to 100 on 413 / -32005), TW_VAULT_EVENTS_START_BLOCK | The factory-wide event sweep (torii_vault_events), run on Chuncheon, not on Render. Dry run (1) is the default: it reads and counts, writes nothing and does not move its stored block |
TW_WORKER_SCHEMA_ENSURE | Default off. The four Chuncheon workers send no DDL; a missing table makes them log one line and exit 2. 1 runs the look-first ensure at start (testing only). Apply the schema as a job: python -m svc.common.schema_ensure torii_agent_wallet |
TW_WORKER_STATEMENT_TIMEOUT_MS, TW_WORKER_LOCK_TIMEOUT_MS | Worker DB session limits (20000, 5000). A tick that hits one is skipped, exit 0 |
TW_APPROVAL_ENABLED | Default on (1). Clause 6: a relayed execute-call above the mandate's approval amount is held until the owner decides. Off: nothing is held and clause 6 reads stored_pending |
TW_APPROVAL_TTL_HOURS, TW_APPROVAL_MAX_OPEN | How long a pending or approved approval item stays good (24), and how many pending items one mandate may hold (10). Past the limit the agent is refused with rate_limited |
TW_STOP_LINE_DRY_RUN, TW_STOP_LINE_SEC, TW_STOP_LINE_MAX | The stop-line keeper (python -m svc.worker.torii_stop_line --once, run on Chuncheon). Dry run is on by default (1): it reads positions and reports in its log what it would close; it sends no order and writes no row. Clause 7 reads stored_pending while it is on. 0 closes for real, with the relay's own key (NW_TORII_AGENT_KEY, NW_TORII_ACCOUNT_ADDRESS) and reduce-only orders only. Seconds between ticks (30); mandates per tick (20) |
TW_POLL_SECONDS, TW_CONFIRMATIONS, TW_CHUNK_BLOCKS, TW_START_LOOKBACK | Chain reader pacing |
TW_LINKS_FROM_NW | NightWatch to wallet links |
NW_PAYMASTER_URL, NW_PAYMASTER_KEY, NW_PAYMASTER_METHOD | Gas sponsorship (Coinbase paymaster, Base only). Fail-closed when the URL is unset. Not on today |