For Agents
Living index of themes for this project. Each H2 is a topic; bullets are wikilinks to related notes. Updated by
obsidian-documenterwhen documenting work. Read byhistorianat bootstrap. Topics kept alphabetical.
Autotrade Modes & Arming
- pmv2-dry-run-verification-signals-2026-07-03 — what
Mode::Dryexercises:dry_rehearse()builds+signs (DRY-SIGNEDlog) +dry Ndigest count, but NO FAK path /pm_fak_attemptsuntil live - pmv2-pm-live-real-money-status-2026-07-02 — PM is LIVE real money; global/wallet1/all-10-crypto-sources =
live; “mode stays OFF/current” = unchanged = live; always verifypmv2_autotrade_config.mode - pmv2-multi-signer-wallet-2026-07-01 — 3-way mode clamp
min(global, wallet, source), fail-closed; wallet-blind money-gate safety bug - pmv2-crypto-source-rename-gotcha-2026-06-24 —
off/dry_run/livesemantics; default-disarmed seeding - pmv2-polymarket-deposit-wallet-live-trading-solution-2026-06-26 — PM live config that arms + executes (
maker_proxy,PM_SIGNATURE_TYPE=poly1271, signer key) - position_manager — mode resolution overview
Fee Model, MLM & Client Onboarding
- pmv2-open-multi-wallet-liquidity-ceiling-brainstorm — OPEN brainstorm: book-depth liquidity ceiling caps profitable fills at ~1-2 wallets/signal → can’t onboard unlimited client wallets (levi/gyula/MLM) into same thin markets; constrains per-wallet
fee_rate+ fee-accounting engine; may need a per-market “capacity”/max-billable-wallets notion; fairness of lower-tier under-fill vs 20% fee
Multi-Wallet & Bankroll Isolation
- pmv2-live-caps-are-advisory-not-blocking-2026-07-09 — the per-wallet advisory caps (
total_exposure_cap_usd/daily_spend_cap_usd/max_open_positions/max_copies_per_event) are ALARMS not BRAKES on LIVE:fast_reserve(execute.rs:125) does a bare INSERT with no caps,evaluate_caps_post(execute.rs:133) runs in a spawn and only records a Telegram counter; caps are only synchronously enforced inreserve()(the DRY path). Current exposure LOW (20k vs $100–235 wallets); fix = fold caps into guarded reserve-INSERT CTE (babylon #1172) - pmv2-open-multi-wallet-liquidity-ceiling-brainstorm — OPEN brainstorm: fan-out (per-wallet durable consumer) has all wallets FAK the SAME thin book → adverse-selection cannibalization (deploy-confirmed 2026-07-08: 4.5× fan-out, 0×429s, first-Placed-later-fail); v1 mitigation = staggered priority tiers (
feat/wallet-priority-tiers, per-walletpriority, Tier1 immediate / Tier2 +~400ms) orders contention but doesn’t beat the ceiling - pmv2-measure-before-mitigating-priority-tiers-2026-07-09 — the priority-tiers stagger was neutralized to
TIER_DELAY_MS=0after measurement showed it was harmful (levi/gyula ROI −7.3%/−7.6%); depth-cannibalization premise measured false - pmv2-pm-live-real-money-status-2026-07-02 — multi-wallet routing running live; backfill migration
20260701000200copiedconfig.mode→wallet1.mode=live - pmv2-sqlx-runtime-type-decode-bug-db-tests-2026-07-02 —
wallet_handles_sourcerouting gate bug that hard-falsed every source → skipped every entry fleet-wide - pmv2-multi-signer-wallet-2026-07-01 — wallet axis: N signer wallets per PM,
pmv2_walletsregistry (AES-256-GCM keys, per-wallet caps,size_scale),pmv2_source_walletsmany-to-many routing, per-wallet durable consumers, advisory caps + single global breaker
Notifications & Telegram Output
- pmv2-dry-run-verification-signals-2026-07-03 —
Category::DryRehearserenders asdry Nper wallet in the 30-min digest (tg_digest.rs:88); dry_run wallets DO appear - pmv2-pm-live-real-money-status-2026-07-02 — Telegram 30-min aggregate feature shipped (main
a5f3604, spec indocs/superpowers/) - pmv2-fak-no-match-reject-single-line-2026-06-30 — FAK no-match rejects collapsed to one line;
fak_reject_lineformatter (source_id/position/token_id/market URL,\u{26A1})
Polymarket CLOB Execution
- pmv2-polymarket-funding-deposit-address-gotcha-2026-07-09 — funding: deposit to the signer EOA (relayer mints pUSD into proxy), NOT the proxy (strands as native USDC); collateral = pUSD
0xC011a7…6dp; verify by pUSD rising at proxy; $10 test caught it - pmv2-open-multi-wallet-liquidity-ceiling-brainstorm — thin-book depth ceiling: multiple wallets FAK-buying the same book simultaneously exhaust ask-side liquidity → later wallets no-match + grind 2 re-priced retries →
RecordedFailure("other")(FAK no-match falls throughclassify_error) - pmv2-resolution-pnl-booking-verified-false-alarm-2026-07-03 — resolution signal is per-token
tokens[].winner: boolONLY;MarketResponsehas no UMA field,MarketStatus.resolvedis a fake copy ofclosed;resolution_sweepskips on empty winner set (c444c86) - pmv2-polymarket-deposit-wallet-live-trading-solution-2026-06-26 — deposit-wallet / Poly1271 flow, maker/signer/funder rules, the 403/400/401 failure chain, derive-don’t-supply L2 key
- pmv2-fak-no-match-reject-single-line-2026-06-30 — FAK no-match reject handling in
place_buy’sOk(Err(e))arm; retry seam (not yet implemented);is_fak_no_matchdetector
Portfolio & PnL (/wallets)
- pmv2-resolution-pnl-booking-verified-false-alarm-2026-07-03 —
resolution_sweep-cost_basisrealized-PnL booking verified trusted-correct vs CLOB winner flags (2026-07-03 #1031 false alarm); grace-period gate rejected YAGNI - pmv2-data-api-positions-pnl-classification-2026-06-28 — data-api
/positionsredeemable-flag PnL split (resolved-but-unredeemed losses sit incashPnl/unrealized until redeemed);aggregate()fix;/positionscannot see lifetime realized
Infra & RPC Endpoints
- pmv2-signer-prearm-proxy-owner-gotcha-2026-06-25 — DRPC WSS flapping fix (swap
POLYGON_WSS_URLto Alchemy, env-only) - pmv2-data-api-positions-pnl-classification-2026-06-28 — pUSD/USDC cash balance contract
0xC011a7…viaeth_call balanceOf+POLYGON_RPC_URL(not USDC.e0x2791Bca1…) - pmv2-polymarket-funding-deposit-address-gotcha-2026-07-09 — public Polygon RPCs that fail (
polygon-rpc.com=403,polygon.llamarpc.com=empty) → usepolygon-bor-rpc.publicnode.com; balance =eth_call balanceOf0x70a08231on pUSD0xC011a7…
Measurement, Latency & Method
- pmv2-entry-config-cache-design-2026-07-09 — Zurich→Dublin ~183ms/round-trip; measured entry path (N=196):
gates_msmedian 733/p90 1179/p99 1914/max 2750ms, config reads the LARGEST controllable stage (>transit+book); 7 SELECTs not 4 (place_entryre-resolves mode after book, outside gates_ms) → true ~1.28s/entry;gates_ms==0on 28% for the 12k-behind dry wallet (self-reinforcing backlog); sqlxtest_before_acquire/min_connections=0tax every cross-region query - pmv2-measure-before-mitigating-priority-tiers-2026-07-09 — RETRO: shipped priority-tiers stagger on a wrong “depth cannibalization” hypothesis; measurement showed 90.5% failures are price-moved-past-limit + emit→signal p50 2.31s pre-build latency → stagger neutralized
TIER_DELAY_MS=0; measure before mitigating, instrument first (R0-R6 harness), watch for harmful mitigations, deploy-const-drift hazard - pmv2-open-multi-wallet-liquidity-ceiling-brainstorm — the measured VERDICT (price ceiling not depth) that overturned the tiering premise
Signer & On-Chain Wallets
- pmv2-polymarket-funding-deposit-address-gotcha-2026-07-09 —
maker_proxy(holds pUSD, bot trades here) vssigner_eoa(always $0, IS the deposit address); public wallet addresses for levi/gyula/bandi - pmv2-multi-signer-wallet-2026-07-01 — N-wallet arming via
signer_for(wallet_id); DB-encrypted keys (AES-256-GCM,PM_WALLET_ENC_KEY);Nonce::from_sliceboot-crash panic on placeholder nonce - pmv2-signer-prearm-proxy-owner-gotcha-2026-06-25 — Polymarket wallet types (email/Magic, Gnosis Safe, Deposit Wallet); pre-arm
owner()check + operator key/proxy ownership lesson - pmv2-polymarket-deposit-wallet-live-trading-solution-2026-06-26 — identifying the tradeable deposit wallet via
owner()held EOA; Poly1271 ownersigner validation
Order Consumption & Source Resolution
- pmv2-entry-config-cache-design-2026-07-09 — boot fail-open trap: an empty first config snapshot reads FRESH → all wallets resolve
Off→SkipAckmaps toAck(consumer.rs:64) → live entries silently dropped and NEVER redelivered on every restart; fix = hard-fail the process if the firstload()fails - pmv2-sqlx-runtime-type-decode-bug-db-tests-2026-07-02 —
wallet_handles_source(consumer.rs) sqlxint4/i64decode bug swallowed tofalse→ every entry silently skipped (~40-min halt); fix =fetch_optional().is_some()+ log errors - pmv2-multi-signer-wallet-2026-07-01 — one durable NATS consumer per wallet (
pmv2_orders_<wallet_id>, distinct durable = fan-out); source→wallet routing viapmv2_source_wallets - pmv2-crypto-source-rename-gotcha-2026-06-24 — body-driven
order.sourceresolution gotcha + seed-migration fix - position_manager — consumer + fail-closed behavior
Repo Conventions & Build
- pmv2-entry-config-cache-design-2026-07-09 — do NOT add
arc_swap/moka(absent fromCargo.lock,Dockerfile:24buildscargo build --locked→ breaks CI); usetokio::sync::watch(Receiver::borrow()is a cheap sync read); sqlxPgPoolOptionsdefaultstest_before_acquire=true(ping/acquire) +min_connections=0(TLS reconnect) = ~150ms/query cross-region - pmv2-live-caps-are-advisory-not-blocking-2026-07-09 —
cargo test --features db-tests= 7 compile errors on main (mode_control_ledger.rs/consumer_ack.rs/ops_commands.rsnever compiled sincePositionManager::newgainedagg;ops_commands.rsrefs removedCommand::Enable/Disable); a test that cannot compile is not protecting you and nothing tells you - pmv2-fak-no-match-reject-single-line-2026-06-30 — no comments/docstrings (seams are structural);
CARGO_NET_GIT_FETCH_WITH_CLI=true; tests in#[cfg(test)] mod testsinexecute.rs(155 passing)
Testing & Regression Safety
- pmv2-live-caps-are-advisory-not-blocking-2026-07-09 — a test that cannot compile is not protecting you, and nothing tells you:
live_cap_event_breach(assertsSkipped("cap:event")) is precisely the regression test for the advisory-caps bug but hadn’t compiled in months; 213 unit tests stayed green, only the money-path db-tests were dead, and CI doesn’t run them (need Docker/testcontainers) → green CI meant nothing. Same class as the sqlx decode bug — wire--features db-testsinto CI - pmv2-entry-config-cache-design-2026-07-09 — three config-cache traps whose WRONG behavior passes the existing tests: hardcoded
size_scale:ONEindecide3(silent 1× orders), read-timeclamp_size_scalemoved to load (rawsize_scale=100→ 100× order), empty boot snapshot reading FRESH; adversarial pre-build review caught them, not the test run - pmv2-measure-before-mitigating-priority-tiers-2026-07-09 — measure before mitigating: a plausible mechanism (depth cannibalization) is not evidence; instrument first (R0-R6 harness); a mitigation shipped on a wrong premise can make things worse (harmful stagger); deploy-const-drift: branch cut before
TIER_DELAY_MS=0still carried 400 - pmv2-resolution-pnl-booking-verified-false-alarm-2026-07-03 — before assuming a PM PnL bug, re-verify against CLOB
tokens[].winnerdirectly (deploy’s re-check is authoritative); a #1031 “false losses” alarm was actually an upstream crypto Data Streams near-tie cross-ref artifact - pmv2-dry-run-verification-signals-2026-07-03 — verifying a new wallet in dry_run: trust
DRY-SIGNEDlogs +dry Ndigest count, NOT emptypm_fak_attempts(live-only) - pmv2-sqlx-runtime-type-decode-bug-db-tests-2026-07-02 — sqlx runtime type-decode bugs compile fine + are invisible to offline tests; only real-Postgres testcontainers
feature=db-tests(tests/wallet_fak_db.rs, anchorwallet_handles_source_regression) catches this class; wire into CI;--features db-testsfull build blocked byops_commands.rsdrift → use--test
Schema & Contracts
- pmv2-multi-signer-wallet-2026-07-01 — new tables
pmv2_wallets+pmv2_source_wallets;pmv2_autotrade_orders.wallet_id+(wallet_id, dedup_key)index; pendingpmv2-contractswalletwire field - pmv2-crypto-source-rename-gotcha-2026-06-24 —
pmv2-contractsschema_2 /SCHEMA_VERSION=2compatibility, no min-share floor