feat(bot): exact v2 quote math + Multicall3 reserve refresh (7906, 7904) #12
No reviewers
Labels
No labels
auto-merge
auto-merge
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
fortiblox/arc-mev-bot!12
Loading…
Reference in a new issue
No description provided.
Delete branch "rev/quote-reserves"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Phase 2, WPs 7906 + 7904 (revenue-director lane
rev, PR 1 of 2).quote.py (7906)
getAmountOut/getAmountInwithfee_bpstaken from the pool entry;quote.pynever defaults a fee (architecture §2.1). v3/curve are explicitUnsupportedKindstubs (no such pool discovered on Arc testnet).bot/tests/fixtures/quote/v2_swap_logs_62260442-62410442.jsonis the raweth_getLogs(Swap+Sync) output for the 8 registry pairs from the LXC 140 node; tests reconstruct pre-swap reserves from the precedingSyncand assertevent.amountOut == v2_get_amount_out(..., 30)for all 10 real swaps, and that the pair k-invariant admits no fee above 30 bps — pinsfee_bps=30for all 4 testnet factories from chain data.QuoteError.reserves.py (7904)
aggregate3per chunk withallowFailure=trueand an explicit block tag; sub-call 0 isMulticall3.getBlockNumber()and any mismatch raisesBlockMismatch(§4.8 guard). Failed/short/zero-reserve sub-calls stale-mark the pool with a reason; RPC errors stale-mark the chunk; unsupported kinds stale-mark without aborting.intrinsic gas too low); public 256 ≈ 195 ms (accepts ≥ 2048). Defaults{local: 1024, public: 256}, config-overridable.aggregate3_62411099.json: exact calldata + byte-identical results from the local node andrpc.testnet.arc.io, cross-checked against 8 directgetReserves()calls at the same block. Liverefresh()on the box matched all 8 direct calls; chunking at cap=3 gave identical states; a pruned block stale-marked all pools instead of crashing.Tests:
python3 -m unittest discover -s bot/tests -t .→ all OK offline. PR 2 (cycles + search + config + docs/search.md + architecture §2.3/§4.2/§7 rows) follows.🤖 Generated with Claude Code
automerger v2 auto-approved: all 7 gates pass. Approver: fortiblox-dev (opposite-identity rule). Gates: mergeable=true,label=auto-merge,author=buddysan,identity=ok,status_checks=not_required,signatures=upstream_BP_only,opt_in=repo_marker.
dd71ee8b86444426cefcautomerger v2 auto-approved: all 7 gates pass. Approver: fortiblox-dev (opposite-identity rule). Gates: mergeable=true,label=auto-merge,author=buddysan,identity=ok,status_checks=not_required,signatures=upstream_BP_only,opt_in=repo_marker.
Auto-merged by forgejo-automerger at 2026-09-16 14:10:21 UTC. Approver:
fortiblox-dev(opposite-identity rule, Option C upgrade 2026-05-13). Merger:buddysanviafast-forward-only(NOT adminforce_merge). Criteria passed:mergeable=true,label=auto-merge,author=buddysan,identity=ok,status_checks=not_required,signatures=upstream_BP_only,opt_in=repo_marker. Branch444426cefcmerged ontomainand feature branch deleted. Seeproject_forgejo_automergermemory for rationale.