Skip to content

feat: use Multicall3 discovery for periodic MM claims#27

Merged
adamewozniak merged 1 commit intomainfrom
feat/mm-periodic-claim-all
Feb 18, 2026
Merged

feat: use Multicall3 discovery for periodic MM claims#27
adamewozniak merged 1 commit intomainfrom
feat/mm-periodic-claim-all

Conversation

@ten-nex
Copy link
Copy Markdown
Contributor

@ten-nex ten-nex commented Feb 18, 2026

What

Replaces the market maker's claim loop with claim_all_winnings() — the new Multicall3-based on-chain discovery from #26.

Why

The old claim loop only tracked markets traded in the current session. If the MM restarted, positions from previous sessions were never claimed, and the MM would slowly run out of liquidity.

How

  • Calls claim_all_winnings() every 5 minutes instead of checking individual tracked markets
  • Discovers ALL claimable positions on-chain (not just session-tracked ones)
  • 60s initial delay to let market setup complete
  • Clears session tracking after successful claim (avoids stale entries)

Trade-offs

  • Discovery scans all markets via Multicall3 — slightly heavier per call, but only runs every 5 min
  • No longer needs per-market resolution polling — simpler code path

Replace the session-only claim loop with claim_all_winnings() which uses
Multicall3 batched on-chain reads to discover ALL claimable positions —
not just markets traded in the current session.

This ensures the market maker recycles liquidity from:
- Previous sessions that were restarted
- Positions from manual trades or other tools
- Any resolved markets the old tracker missed

Runs every 5 minutes (vs 2 min before) since discovery scans all markets.
Initial 60s delay to let markets initialize first.
@adamewozniak adamewozniak merged commit 2ed3a5f into main Feb 18, 2026
5 checks passed
@adamewozniak adamewozniak deleted the feat/mm-periodic-claim-all branch February 18, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants