Skip to content

feat: add historical price monitoring #9

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 3 commits into from
Feb 9, 2025

Conversation

lumoswiz
Copy link
Owner

@lumoswiz lumoswiz commented Feb 9, 2025

This PR adds historical price monitoring for trades between monitored tokens on CoW Swap.

Key Changes

  • Track historical trades in trades.csv
  • Calculate token prices during trade processing
  • Use canonical token pair ordering

Implementation Details

  • Process trade logs with price calculation
  • Store prices alongside original trade data
  • Maintain consistent token ordering for price comparisons

Technical Notes

  • Prices calculated from raw amounts (18 decimals)
  • Token pairs ordered alphabetically by address
  • Historical data preserved in trades.csv

- Add MONITORED_TOKENS list (GNO, COW, WETH, WXDAI, SAFE)
- Update trade processing to track all monitored token pairs
- Store raw trade data for price analysis
Add continuous block tracking
Process new trades on each block
Extend trade history periodically
Add canonical token pair ordering
Calculate prices during trade log processing
Store prices directly in trades.csv
@lumoswiz lumoswiz merged commit 4b5b720 into main Feb 9, 2025
4 checks passed
@lumoswiz lumoswiz deleted the feat/historical-price-monitoring branch February 9, 2025 23:21
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