peapod
PEAPOD ENGINEERING

Peapod integration

Upstream: sentienceai/peapod at d9458071d8c1ebeba4d2044aacc4a33bf5f9a47c. The original source snapshot lives in vendor/peapod, including its tests, offline exports, and archived depth/calculator UI. The deployed research section is under /insights/ and shares product navigation, palettes and wallet connection.

Engineering workspaceImplementation notes and historical research.

Consolidation contract

The imported math engine and source JSON remain byte-for-byte identical to upstream. scripts/check-peapod-data.mjs checks their hashes, chain/anchor provenance, pool uniqueness, depth totals, window-column lengths, kernel joins, error bounds, ranking order, address uniqueness, win rates, terminal sparklines, timeframe scope and token identity. Its generated consolidation.json preserves all source anchors and limitations; summaries.json indexes published ranking rows without summing overlapping windows.

All 193 imported token identities match the existing registry by address. The 66 depth pools and 5,650 LP windows form their own linked research universe. Peapod's ranked-row datasets expose 1,716 distinct addresses across their capped windows. They must not be confused with the much larger qualifying or observed address universe.

The one-day window is block aligned and begins nine seconds after its nominal cutoff. “All” is the same resolved seven-day range as “7d”. Those facts are displayed instead of silently expanding scope. The original 236-pool leaderboard scope is broader than the explicit 66-pool depth catalog.

Missing exports and recovery

Upstream intentionally excludes web/data/address/ and raw ingest tapes from Git. A fresh upstream clone passes 91 of 106 Node tests; the remaining 15 depend on those absent exports. Preserve the original tests and record this baseline rather than treating missing raw data as a passing full export test.

The integration distinguishes missing files, absent ranking rows, and verified trade activity. Recovery must use lake evidence first and bounded Goldsky retrieval for gaps, preserving chain identity, log indexes, hashes, timestamps, source ranges and accounting differences. Regenerated details may only claim agreement with original summaries after explicit reconciliation.

Branding and compatibility

Public product names, page titles, guides, profile labels and wallet copy use Peapod. Existing canopy-* storage keys, DOM identifiers, events and deployed AWS resource names are retained as compatibility identifiers so the rename does not erase local state or provision a second infrastructure stack. The GitHub deployment target remains usb-labs/canopy staging.

Validation

  • npm test: application and integration regressions.
  • npm run data:check: imported and derived data consistency; -- --write regenerates the report.
  • npm run test:peapod: upstream tests with explicit handling of unavailable export-dependent checks.
  • npm run build: shared wallet bundle; the v4 math engine is served directly, without transformation.

Recovery performed

The local lake contained 10,007 raw-log Parquet partitions (scope 92699bd1e29005f1), including 8,080,701 swap observations in the ranking block range. Cached receipt batches ended before this period. Remote S3 inspection was unavailable because the workstation AWS login had expired; this is not evidence that S3 lacks the exports.

The bounded Goldsky pipeline queries token transfers for the 1,716 ranked addresses and 193 canonical token contracts over blocks 56,464,000–62,441,067. It discovered 66,019 candidate transactions. Receipt retrieval is restricted to candidates independently present in the cached USDG/token swap tape. Transfer endpoints are a discovery aid, not transaction-sender proof; final attribution uses receipt from. The scope cannot establish complete sender activity through routers or relayers.

scripts/export-peapod-evidence.py checks transaction and block identities, exact receipt log payloads/topics/indexes, timestamps, receipt success, uniqueness and int128 bounds. It preserves raw signed amounts and contract addresses. The completed recovery verified 11,911 swap logs in 11,339 transactions across 671 ranked addresses and 250 lake-identified pools. All 11,360 candidates in the cached USDG/token tape received receipts; only ranked receipt senders with matching swap evidence are published. Additional cached receipts came from the broader discovery pass. These 250 pools are not asserted to equal the original 236-pool ranking universe. The generated recovery.json is the authoritative count/checksum manifest. /recovered/ files contain at most 100 recent verified logs per address and never replace the published ranking or claim FIFO/PnL reconciliation. The original 236-pool ranking scope and netting rules cannot be reproduced confidently from the committed metadata alone.

Raw provider responses remain outside the served tree in the local lake recovery cache, with a receipt checksum manifest. No credentials or raw RPC tapes are published. Goldsky job usage is recorded in the existing shared budget ledger through peapod-ranked-details-v1 and peapod-ranked-details-v1-receipts jobs. Retry attempts count toward their hard call caps.

To resume (requires the existing provider environment and Python lake dependencies):

python3 scripts/recover-peapod-details.py --lake-root /root/work/canopy --cache /root/work/canopy/.local/stock-lake/peapod-recovery/recovery --phase transfers
python3 scripts/recover-peapod-details.py --lake-root /root/work/canopy --cache /root/work/canopy/.local/stock-lake/peapod-recovery/recovery --phase receipts --swap-tape /root/work/canopy/.local/stock-lake/peapod-recovery/candidate-swaps.parquet
python3 scripts/export-peapod-evidence.py --cache /root/work/canopy/.local/stock-lake/peapod-recovery/recovery --swap-tape /root/work/canopy/.local/stock-lake/peapod-recovery/candidate-swaps.parquet --pools /root/work/canopy/.local/stock-lake/peapod-recovery/pools.json
npm run data:check -- --write

Transfer discovery and receipt retrieval are resumable from cached responses. Do not run two instances of the same phase against one cache or budget job. A regenerated evidence export requires re-running validation and review of its coverage; availability is not proof of accounting agreement.

Current features (September 17)

The leaderboard and trader cards now integrate underdahood-inc/peapod at faa944d3b9220155c9bb864655df9bf8b58776af. vendor/peapod-live-upstream.json pins this separate feature source; the earlier immutable research export and its verification remain intact.

Features include manifest-driven windows, category/quote scopes, richer trader cards and sorting, matched-flow/out-of-scope/quote-asset metrics, cumulative realized-PnL charts, trade and round-trip tabs, keyboard search, build status, and the exact two-sided binomial win-rate acceptance region. Five or fewer closes yield no significance verdict. This is a win-rate test, not proof of skill or future returns.

Shared navigation, wallet/XP controls, existing type scale and all four product palettes are preserved. Current API failures retain the saved-ranking and receipt-evidence lookup. The server exposes only the allowlisted read routes under /api/trader-research/; it is not a general proxy. CI browser checks use archived fixtures to keep provider outages separate from interface regressions.

See lake-refresh.md for scheduled ingestion and the separate freshness boundaries of current provider data, raw evidence, saved accounting, and S3.

Search page titles · Use Tab to choose a result