Skip to content

feat: implement CoW Protocol trade monitoring with CSV storage #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Feb 4, 2025

Conversation

lumoswiz
Copy link
Owner

@lumoswiz lumoswiz commented Feb 4, 2025

Add Silverback bot implementation for monitoring CoW Protocol trades on Gnosis Chain. Currently this bot will catchup on historical logs and crash due to having no tasks to execute.

Features:

  • Historical trade processing with CSV persistence
  • Block-level progress tracking across bot restarts
  • GPv2Settlement contract integration
  • GNO trade filtering and processing

Key changes:

  • Initialize bot with contract interfaces and configs
  • Add CSV functions for trade data persistence
  • Implement historical trade processing on startup
  • Add block tracking for resuming after restarts

Testing:

  • Fixed WETH Gnosis Chain address in tests

Usage:

See README for bot run command

Initialize SilverbackBot for monitoring CoW Protocol trades
Define Gnosis Chain contract addresses
Add GPv2Settlement contract interface and ABI loading
Add functions to load and save trade history to CSV
Set up trade database schema with block number index
Store core trade data: owner, tokens, amounts and timestamp
Add helper functions to fetch and process historical GNO trades
Create LogFilter for GPv2Settlement Trade events
Filter for trades involving GNO token
Format trade logs for database storage
Add startup handler to process GNO trades
Process trades from START_BLOCK to current block
Store processed trades in database
Add functions to load and save last processed block to CSV
Track bot processing progress across restarts
Use last processed block as starting point for historical trade processing
@lumoswiz lumoswiz marked this pull request as ready for review February 4, 2025 13:26
@lumoswiz lumoswiz merged commit f9a6ae3 into main Feb 4, 2025
1 check passed
@lumoswiz lumoswiz deleted the feat/simple-bot branch February 4, 2025 13:28
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.

1 participant