Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
8e5a10c
fix: minor cleanups — MAX_TWAP_PRECOMPUTE_PARTS constant, decoder ABI…
lgahdl Jun 1, 2026
9552081
fix: C3 StatusUpdater batch upsert and per-block cap (COW-988)
lgahdl Jun 1, 2026
7970029
docs: complete COW-1004 doc updates (chain wording, TWAP skip note, G…
lgahdl Jun 1, 2026
268ffcd
test: add constants and C3 status-filter tests (COW-988)
lgahdl Jun 1, 2026
6f802dd
Merge branch 'luizhatem/cow-1004-minor-cleanups' into luizhatem/final-qa
lgahdl Jun 1, 2026
2e177d5
Merge branch 'luizhatem/cow-993-f15-rest-apiordersby-owner-response-m…
lgahdl Jun 1, 2026
a71896f
merge: resolve conflict in orders-by-owner.test.ts — combine schema +…
lgahdl Jun 1, 2026
c7fb497
Merge branch 'luizhatem/cow-997-998-schema-and-sql-hygiene' into luiz…
lgahdl Jun 1, 2026
5e67025
Merge branch 'luizhatem/cow-1000-f7-rename-c1-c5-block-handlers-to-se…
lgahdl Jun 1, 2026
902f523
Merge branch 'luizhatem/cow-991-f8-wrap-settlement-rpc-calls-in-witht…
lgahdl Jun 1, 2026
5113767
merge: resolve architecture.md conflict — keep "all active chains" wo…
lgahdl Jun 1, 2026
f0c7ce4
Merge luizhatem/cow-990-f16-parent-cancelled-cascade-preflight-check …
lgahdl Jun 1, 2026
f9310d7
Merge luizhatem/cow-994-f19-k8s-probes-and-json-structured-logging in…
lgahdl Jun 1, 2026
5e6f1d9
fix: remove composableCow. prefix from block interval names (Ponder d…
lgahdl Jun 1, 2026
651c8db
Merge origin/develop into final-qa (cow-976, 980, 981, 982, 983, 984,…
lgahdl Jun 2, 2026
c6fc841
fix: increase ponder container nofile ulimit to 65536
lgahdl Jun 2, 2026
42de8c5
fix: rename progressPct to historicalSyncProgressPct in sync-progress…
lgahdl Jun 2, 2026
d9aea03
fix: remove undefined variables from settlement cowLog after COW-991 …
lgahdl Jun 2, 2026
13b8cbf
fix: add ORDER BY to StatusUpdater SELECT, fix Number() env check, do…
lgahdl Jun 2, 2026
51c9850
fix: update test mocks — use __makeSelectChain, add hash field, DB-th…
lgahdl Jun 2, 2026
40917bc
fix: update stale C1/C5 names in comments, verify CirclesBackingOrder…
lgahdl Jun 2, 2026
1cadee0
fix: correct hash field describe() to use tuple abi.encode notation (…
lgahdl Jun 2, 2026
00cb7c3
fix: update stale C1/C5 name references in constants.ts and docs (COW…
lgahdl Jun 2, 2026
9ec9634
fix: use tighter 5s timeout for inner-loop RPC calls in settlement ha…
lgahdl Jun 2, 2026
0e72d2b
fix: fix preflight timeout, migrate console.log to cowLog, deduplicat…
lgahdl Jun 2, 2026
f04b232
fix: route warn/error to stderr in cowLog, add initialDelaySeconds to…
lgahdl Jun 2, 2026
37c35f0
Merge remote-tracking branch 'origin/luizhatem/cow-990-f16-parent-can…
lgahdl Jun 2, 2026
67fc6ce
fix: resolve __makeSelectChain TypeScript type error in orders-by-own…
lgahdl Jun 2, 2026
00b2fad
fix: filter nullish items from fetchOrdersByUids response to prevent …
lgahdl Jun 2, 2026
9ff47c3
docs: add MAX_DISCRETE_ORDERS_PER_BLOCK to .env.example (COW-988)
lgahdl Jun 8, 2026
67ca628
Merge origin/develop into luizhatem/final-qa
lgahdl Jun 8, 2026
980d70c
Merge PR #83: rename block handlers to semantic names (COW-1000)
lgahdl Jun 8, 2026
efe4628
Merge PR #84: wrap settlement RPC calls in withTimeout (COW-991)
lgahdl Jun 8, 2026
2a11b44
Merge PR #88: OrderStatusTracker batch upsert and per-block cap (COW-…
lgahdl Jun 8, 2026
bfa4464
Merge PR #89: TWAP parts aged-out fallback via owner order list (COW-…
lgahdl Jun 8, 2026
c882a3b
fix: chunk orphan-candidate cascade INSERT/DELETE to avoid Postgres b…
lgahdl Jun 9, 2026
3e060e5
fix(deploy): auto-drop app schema in cmdUp to clear Ponder build_id c…
lgahdl Jun 9, 2026
51faf0e
fix: exclude stale candidates from unconfirmed /by_uids batch; docume…
lgahdl Jun 9, 2026
16678cc
feat: classify Curve/Balancer fee burners and CoW AMM as named order …
lgahdl Jun 9, 2026
20457ae
perf: add composite indexes for C1/C5, C3, and C2 stale sweep (COW-886)
lgahdl Jun 10, 2026
6811848
fix: derive isComplete from isRealtime+pct instead of ponder_sync_is_…
lgahdl Jun 10, 2026
0bcf133
refactor: use event.block.timestamp directly and type ComposableOrder…
lgahdl Jun 10, 2026
8576cc1
Merge PR #91: exclude stale candidates from /by_uids batch; document …
lgahdl Jun 10, 2026
2d060af
Merge PR #92: classify Curve/Balancer fee burners and CoW AMM as name…
lgahdl Jun 10, 2026
b79970d
Merge PR #93: add composite indexes for C1/C5, C3, and C2 stale sweep…
lgahdl Jun 10, 2026
8d7638c
Merge PR #94: fix isComplete derived from isRealtime+pct (COW-1008)
lgahdl Jun 10, 2026
16f8179
Merge PR #95: type ComposableOrder.creationDate as bigint (COW-1007)
lgahdl Jun 10, 2026
cefb22a
fix: add missing ORDERBOOK_HTTP_TIMEOUT_MS import; sync hash field de…
lgahdl Jun 10, 2026
839bc30
fix: replace context.db.sql writes with ORM in SettlementResolver blo…
lgahdl Jun 15, 2026
a8e56df
Merge branch 'luizhatem/cow-1009-investigate-error-in-order-promotion…
lgahdl Jun 15, 2026
08f2cfe
chore: upgrade ponder from 0.16.3 to 0.16.6
lgahdl Jun 15, 2026
b2e93c3
Merge branch 'luizhatem/cow-1009-investigate-error-in-order-promotion…
lgahdl Jun 15, 2026
4d4a855
fix: patch ponder flush() to use unique savepoint names per invocation
lgahdl Jun 15, 2026
15bb8b4
Merge branch 'luizhatem/cow-1009-investigate-error-in-order-promotion…
lgahdl Jun 15, 2026
eaaef90
chore: add pnpm-workspace.yaml and patches/ to Dockerfile build stage
lgahdl Jun 15, 2026
8effd78
chore: add pnpm-workspace.yaml and patches/ to Dockerfile build stage
lgahdl Jun 15, 2026
3279e91
chore: update pnpm-lock.yaml with ponder patch hash
lgahdl Jun 15, 2026
86b9d15
chore: update pnpm-lock.yaml with ponder patch hash
lgahdl Jun 15, 2026
590c74a
Merge remote-tracking branch 'origin/luizhatem/cow-1009-investigate-e…
lgahdl Jun 15, 2026
8b02433
fix: snapshot qb at flush() start to prevent mid-flush external mutation
lgahdl Jun 15, 2026
88fbc8f
Merge branch 'luizhatem/cow-1009-investigate-error-in-order-promotion…
lgahdl Jun 15, 2026
07b1ab8
fix: resolve merge conflict - use complete ponder patch with currentQ…
lgahdl Jun 15, 2026
209e167
fix: restore chain configs to production values (revert accidental te…
lgahdl Jun 15, 2026
bfad241
chore(qa): remove Linear ticket IDs from code comments and tests
jeffersonBastos Jun 15, 2026
23da85a
chore(qa): remove build-phase context and local paths from code comments
jeffersonBastos Jun 15, 2026
4fabcdd
docs(qa): remove ticket and milestone references from public docs
jeffersonBastos Jun 15, 2026
1a2879f
docs(qa): scrub internal references from agent docs
jeffersonBastos Jun 15, 2026
f940fcf
chore(qa): remove internal Ponder debugging playbook
jeffersonBastos Jun 15, 2026
fca4975
refactor(qa): route stray console.* through the structured logger
jeffersonBastos Jun 15, 2026
df175ac
refactor(qa): use MAX_TWAP_PRECOMPUTE_PARTS instead of a hardcoded li…
jeffersonBastos Jun 15, 2026
d8693a3
refactor(qa): remove unused no-op invalidateOwnerCache export
jeffersonBastos Jun 15, 2026
0fd4d8e
docs(qa): dedupe and reorder block-handler descriptions
jeffersonBastos Jun 15, 2026
2c1ca0e
refactor(qa): dedupe GPv2 order constant hashes
jeffersonBastos Jun 15, 2026
898b481
refactor(qa): return orderType from insertGenerator; drop redundant d…
jeffersonBastos Jun 15, 2026
e9b3510
docs(qa): trim over-documented local database setup
jeffersonBastos Jun 15, 2026
b50767b
docs(qa): restore debug-ponder playbook, scrubbed and updated for cur…
jeffersonBastos Jun 15, 2026
7cd38d4
chore(qa): remove internal founder_mode command
jeffersonBastos Jun 15, 2026
1354b9a
docs: replace C1-C5 shorthand with descriptive handler names
jeffersonBastos Jun 15, 2026
6eda4bc
chore(qa): P3 nits — replace unicode arrows, drop unused export
jeffersonBastos Jun 15, 2026
e6c074c
docs: rename m3-orderbook-integration-flow to orderbook-integration-flow
jeffersonBastos Jun 15, 2026
1c181e8
docs: document all eight decoded order types
jeffersonBastos Jun 15, 2026
6560c7e
docs: align logging convention with uniform log() usage
jeffersonBastos Jun 15, 2026
1cc5033
chore(qa): remove unused DISABLE_POLL_RESULT_CHECK and DISABLE_DETERM…
jeffersonBastos Jun 15, 2026
7778732
chore(qa): remove dead BLOCK_TIME_SECONDS export and orphan AaveV3Ada…
jeffersonBastos Jun 15, 2026
048484e
fix(qa): return a generic 500 message instead of leaking err.message
jeffersonBastos Jun 15, 2026
a26aa2a
fix: prevent crash when ROLLBACK TO savepoint fails in multichain flush
lgahdl Jun 15, 2026
163ec71
fix: skip gnosis synthetic logs with out-of-range logIndex in Ponder …
lgahdl Jun 15, 2026
84985b8
fix: eliminate context.db.sql calls that trigger flush() in multichai…
lgahdl Jun 15, 2026
ec2d60d
refactor: inline settlement adapter discovery, remove SettlementResol…
lgahdl Jun 15, 2026
bd3f4bb
perf: stagger gnosis block handlers with coprime intervals (COW-1014)
lgahdl Jun 16, 2026
e8a3a69
fix: cap OwnerBackfill page fetch and add max retry count (COW-1015)
lgahdl Jun 16, 2026
e2068da
perf: apply coprime intervals to mainnet block handlers (COW-1014)
lgahdl Jun 16, 2026
c135613
Merge branch 'luizhatem/cow-1014-perf-stagger-gnosis-block-handlers-w…
lgahdl Jun 16, 2026
62fe4ba
perf: uniform block handler intervals — gnosis=10, mainnet=4 (COW-1014)
lgahdl Jun 16, 2026
aa053c6
Merge branch 'luizhatem/cow-1014-perf-stagger-gnosis-block-handlers-w…
lgahdl Jun 16, 2026
66fef8b
perf: bulk insert precomputed UIDs and cached statuses (COW-1016)
lgahdl Jun 16, 2026
2d951d1
perf: parallelize /by_uids batch fetches in fetchOrdersByUids (COW-1016)
lgahdl Jun 16, 2026
1ec1260
perf(COW-1018): skip OwnerBackfill for owners already bootstrapped wi…
lgahdl Jun 16, 2026
971863b
Merge cow-1017-performance-improvements into final-qa (COW-1018)
lgahdl Jun 16, 2026
7ef493c
fix(deploy): write .env to parent dir to match deploy script expectation
lgahdl Jun 16, 2026
fe48bf2
fix(deploy): use bash login shell for SSH so NVM Node.js is in PATH
lgahdl Jun 16, 2026
09318a0
fix(deploy): run docker commands via SSH instead of manage.ts on server
lgahdl Jun 16, 2026
ba712be
fix(deploy): use docker compose rm -sf instead of stop to clear conta…
lgahdl Jun 16, 2026
c152804
fix(deploy): forcefully remove all ponder containers by name pattern
lgahdl Jun 16, 2026
7868aa3
fix(deploy): write .env to parent dir to match deploy script expectation
lgahdl Jun 16, 2026
ac1fc6a
fix(deploy): use bash login shell for SSH so NVM Node.js is in PATH
lgahdl Jun 16, 2026
6414f2b
fix(deploy): run docker commands via SSH instead of manage.ts on server
lgahdl Jun 16, 2026
cbc2142
fix(deploy): use docker compose rm -sf instead of stop to clear conta…
lgahdl Jun 16, 2026
726bd20
fix(deploy): forcefully remove all ponder containers by name pattern
lgahdl Jun 16, 2026
3bdebfa
chore: add temporary server monitoring workflow
lgahdl Jun 16, 2026
8e363aa
chore: add server monitoring workflow
lgahdl Jun 16, 2026
55712a0
chore: add monitor_only mode to deploy workflow for status checks
lgahdl Jun 16, 2026
b92bfba
fix(deploy): use string type for monitor_only input to fix boolean co…
lgahdl Jun 16, 2026
89358c7
fix(COW-1019): chunk bulk inserts to avoid node-postgres bind param o…
lgahdl Jun 16, 2026
b1e9ce4
merge: combine monitor_only and skip_schema_drop inputs in deploy wor…
lgahdl Jun 16, 2026
d99de58
Merge pull request #97 from bleu/jefferson/cow-1012-qa-review
jeffersonBastos Jun 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
222 changes: 111 additions & 111 deletions .claude/commands/debug-ponder.md

Large diffs are not rendered by default.

73 changes: 0 additions & 73 deletions .claude/commands/founder_mode.md

This file was deleted.

11 changes: 5 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ DATABASE_URL=postgresql://postgres:postgres@localhost:5432/programmatic-orders
DATABASE_SCHEMA=programmatic_orders

# Performance / escape-hatch flags (all optional; safe to omit in production)
# DISABLE_POLL_RESULT_CHECK=true # escape-hatch: skips OrderDiscoveryPoller multicalls for
# # non-deterministic generators; leaves those orders undetected
# # until re-enabled. Use only to benchmark or diagnose.
# DISABLE_DETERMINISTIC_CANCEL_SWEEP=true # escape-hatch: skips CancellationWatcher singleOrders()
# # reads; on-chain remove() on TWAP/StopLoss/CirclesBackingOrder
# # generators will not be detected while disabled.
# DISABLE_SETTLEMENT_FACTORY_CHECK=true # escape-hatch: skips getCode + FACTORY() RPC calls in the
# # GPv2Settlement handler. Benchmark-only; do not use in prod.

Expand All @@ -33,6 +27,11 @@ DATABASE_SCHEMA=programmatic_orders
# MAX_GENERATORS_PER_BLOCK_1=200 # mainnet
# MAX_GENERATORS_PER_BLOCK_100=400 # gnosis (shorter block time → higher budget)

# Per-block cap on how many open discrete orders OrderStatusTracker checks per chain.
# Default: 200. Excess orders defer to next block, prioritized by oldest promotedAt first.
# MAX_DISCRETE_ORDERS_PER_BLOCK_1=200
# MAX_DISCRETE_ORDERS_PER_BLOCK_100=400

# eth_getLogs block range cap (optional; default: 1000)
# Increase if your RPC provider supports a larger range to speed up backfill.
# Override per chain with the numeric chain-id suffix:
Expand Down
105 changes: 90 additions & 15 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ concurrency:

on:
workflow_dispatch:
inputs:
monitor_only:
description: "Set to 'true' to only check server status without deploying"
required: false
default: 'false'
type: string
skip_schema_drop:
description: "Set to 'true' to deploy without dropping the schema (preserves re-index progress)"
required: false
default: 'false'
type: string
push:
branches:
- main
Expand All @@ -19,18 +30,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 10

- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Set up SSH key
run: |
mkdir -p ~/.ssh
Expand All @@ -53,8 +52,84 @@ jobs:
chmod 600 ~/.ssh/config

- name: Create .env file
if: inputs.monitor_only != 'true'
run: |
echo "${{ secrets.DEPLOY_ENV_FILE_CONTENT }}" > ../.env

- name: Rsync source files
if: inputs.monitor_only != 'true'
run: |
rsync -avz --delete --mkpath \
--exclude=.git \
--exclude=node_modules \
--exclude=.env \
--exclude=.env.local \
--exclude=.vite \
--exclude='*.log' \
--exclude=tmp/ \
./ cow-deploy:${{ secrets.DEPLOY_PATH }}/

- name: Copy env file to server
if: inputs.monitor_only != 'true'
run: |
scp ../.env cow-deploy:${{ secrets.DEPLOY_PATH }}/deployment/.env

- name: Deploy via docker on server
if: inputs.monitor_only != 'true'
env:
DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }}
run: |
REVISION=$(git rev-parse --short HEAD)

# Source env locally just to read PROJECT_PREFIX and DB connection info
set -a; source ../.env; set +a

REMOTE_DIR="${DEPLOY_PATH}"
DB_CONTAINER="${PROJECT_PREFIX}-db"
REMOTE_ENV="${REMOTE_DIR}/deployment/.env"
# docker compose reads PROJECT_PREFIX from --env-file; supply APP_REVISION + DATABASE_SCHEMA inline
DC="docker compose -p ${PROJECT_PREFIX} -f ${REMOTE_DIR}/docker-compose.yml --env-file ${REMOTE_ENV} --profile deploy"

echo ">>> Stopping and removing any existing ponder containers..."
# Remove any container whose name matches the ponder service pattern,
# regardless of how it was originally started (docker run vs docker compose).
ssh cow-deploy "docker ps -a --format '{{.Names}}' | grep -E '^${PROJECT_PREFIX}-ponder' | xargs -r docker rm -f" || true

if [ "${{ inputs.skip_schema_drop }}" != "true" ]; then
echo ">>> Dropping app schema..."
ssh cow-deploy "docker exec ${DB_CONTAINER} \
psql -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-programmatic-orders} \
-c 'DROP SCHEMA IF EXISTS \"programmatic_orders\" CASCADE'" || true
else
echo ">>> Skipping schema drop — will resume from existing checkpoint (PONDER_EXPERIMENTAL_DB=platform)."
fi

echo ">>> Building new image (revision=${REVISION})..."
ssh cow-deploy "APP_REVISION=${REVISION} DATABASE_SCHEMA=programmatic_orders ${DC} build --no-cache"

echo ">>> Starting containers..."
ssh cow-deploy "APP_REVISION=${REVISION} DATABASE_SCHEMA=programmatic_orders ${DC} up -d --remove-orphans"

echo ">>> Pruning old images..."
ssh cow-deploy "docker image prune -f && docker container prune -f" || true

echo ">>> Deploy complete (revision=${REVISION})."

- name: Check server status
if: inputs.monitor_only == 'true'
run: |
echo "${{ secrets.DEPLOY_ENV_FILE_CONTENT }}" > .env
echo "=== Running containers ==="
ssh cow-deploy "docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Image}}'"

- name: Run deploy script
run: npx tsx deployment/deploy-remotely.ts cow-deploy:${{ secrets.DEPLOY_PATH }} ../.env
echo ""
echo "=== Last 100 ponder log lines ==="
ssh cow-deploy "
CONTAINER=\$(docker ps --format '{{.Names}}' | grep ponder | head -1)
if [ -z \"\$CONTAINER\" ]; then
echo 'WARNING: No running ponder container found'
docker ps -a --format 'table {{.Names}}\t{{.Status}}' | grep -i ponder || echo 'No ponder containers at all'
else
echo \"Container: \$CONTAINER\"
docker logs --tail 100 \"\$CONTAINER\" 2>&1
fi
"
37 changes: 37 additions & 0 deletions .github/workflows/monitor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Monitor Server (temporary)

on:
workflow_dispatch:

jobs:
monitor:
name: Check indexer status
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Set up SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519

- name: Set up SSH config
run: |
cat <<EOF > ~/.ssh/config
Host cow-deploy
HostName ${{ secrets.DEPLOY_SERVER_HOST }}
User ${{ secrets.DEPLOY_SERVER_USER }}
Port 22
IdentityFile ~/.ssh/id_ed25519
StrictHostKeyChecking no
ServerAliveInterval 30
EOF
chmod 600 ~/.ssh/config

- name: Check running containers
run: ssh cow-deploy "docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Image}}'"

- name: Check recent ponder logs
run: |
ssh cow-deploy "docker logs --since 3m --tail 80 cow-programmatic-ponder-1 2>&1" || \
ssh cow-deploy "docker ps -a --format '{{.Names}}' | grep ponder | head -1 | xargs -r docker logs --since 3m --tail 80 2>&1"
7 changes: 2 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,17 @@ pnpm lint # ESLint
pnpm dev # Start indexer locally (requires .env.local with MAINNET_RPC_URL)
```

Copy `.env.local.example` `.env.local` and set `MAINNET_RPC_URL` before `pnpm dev`.
Copy `.env.local.example` -> `.env.local` and set `MAINNET_RPC_URL` before `pnpm dev`.
Start PostgreSQL with `docker compose up -d` to use it instead of the default SQLite.

## Reference Documentation

| File | When to read |
|------|--------------|
| `agent_docs/architecture.md` | Full data-flow, file responsibilities, schema details |
| `agent_docs/project-structure.md` | Current file map, schema tables, env vars, key commands |
| `agent_docs/code-patterns.md` | Schema/naming conventions (snake_case, composite PK, eventId) — **check before schema or handler changes** |
| `agent_docs/token-indexer-overview.md` | Full Ponder patterns (handlers, repos, services) — **read before writing any implementation plan** |
| `docs/supported-order-types.md` | All 5 order type ABI structs, handler addresses, decoded fields, edge cases — **read before any decoder or M3 block-handler work** |
| `agent_docs/slack_decisions_summary.md` | Technical decisions from CoW Protocol team (flash loans, CoWShed, orderbook, scope) |
| `thoughts/` (local) | Local working notes, plans, task context (not in repo; see `.claude/commands/` for workflow) |
| `docs/supported-order-types.md` | All 8 order type ABI structs, handler addresses, decoded fields, edge cases — **read before any decoder or block-handler work** |

## Working Conventions

Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ WORKDIR /usr/src/app
# ---- build stage ----
FROM base AS build

COPY package.json pnpm-lock.yaml ./
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY patches/ patches/
RUN pnpm install --frozen-lockfile

COPY . .
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Programmatic Orders API

Indexes on-chain events from [CoW Protocol](https://cow.fi)'s ComposableCoW contract, decodes programmatic order types (TWAP, Stop Loss, Perpetual Swap, Good After Time, Trade Above Threshold), and serves the data through a GraphQL API. Built with [Ponder](https://ponder.sh) by [@bleu](https://github.com/bleu) for CoW Protocol.
Indexes on-chain events from [CoW Protocol](https://cow.fi)'s ComposableCoW contract, decodes eight programmatic order types (TWAP, Stop Loss, Perpetual Swap, Good After Time, Trade Above Threshold, Circles Backing Order, Swap Order Handler, ERC4626 CoW Swap Fee Burner), and serves the data through a GraphQL API. Built with [Ponder](https://ponder.sh) by [@bleu](https://github.com/bleu) for CoW Protocol.

## Tech stack

Expand Down
48 changes: 0 additions & 48 deletions abis/AaveV3AdapterFactoryAbi.ts

This file was deleted.

2 changes: 1 addition & 1 deletion agent_docs/code-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Every `fetch`, `context.client.multicall`, `context.client.readContract`, or oth
2. Catch `TimeoutError` at the handler boundary, log `[COW:Cx] <label> timeout …`, and `return` without further DB writes.
3. Be partial-failure tolerant — writes for affected items are skipped; the next block retries naturally.

Rationale: Ponder 0.16 wraps every block in a single DB transaction (`node_modules/.../ponder/src/runtime/multichain.ts:363,639`) and offers no API to leave/re-enter. An unbounded external call in a handler holds the TX across the network round-trip; on a slow peer, Postgres terminates the connection and Ponder retries the full block 9× before shutting the process down (see `ponder-final-23-04.log`, 2026-04-23). Tuning knobs live in `src/constants.ts` (`ORDERBOOK_HTTP_TIMEOUT_MS`, `BLOCK_HANDLER_RPC_TIMEOUT_MS`, `BOOTSTRAP_OWNER_FETCH_TIMEOUT_MS`).
Rationale: Ponder 0.16 wraps every block in a single DB transaction (`node_modules/.../ponder/src/runtime/multichain.ts:363,639`) and offers no API to leave/re-enter. An unbounded external call in a handler holds the TX across the network round-trip; on a slow peer, Postgres terminates the connection and Ponder retries the full block 9× before shutting the process down. Tuning knobs live in `src/constants.ts` (`ORDERBOOK_HTTP_TIMEOUT_MS`, `BLOCK_HANDLER_RPC_TIMEOUT_MS`, `BOOTSTRAP_OWNER_FETCH_TIMEOUT_MS`).

---

Expand Down
Loading
Loading