Skip to content

Add daily historical strategy shares tracking#447

Open
uditdc wants to merge 1 commit intodevfrom
373-capture-1d-historical-exchange-rate-between-shares---tokens-for-tracked-tokens
Open

Add daily historical strategy shares tracking#447
uditdc wants to merge 1 commit intodevfrom
373-capture-1d-historical-exchange-rate-between-shares---tokens-for-tracked-tokens

Conversation

@uditdc
Copy link
Copy Markdown
Member

@uditdc uditdc commented Jul 29, 2025

This PR implements daily historical tracking of exchange rates between strategy shares and their underlying tokens, addressing issue #373. The system captures daily snapshots of the sharesToUnderlying conversion rates for all tracked strategy tokens in the EigenLayer ecosystem.

Closes #373

Key Changes

Database Schema

  • New Table: StrategySharesDaily with fields:
    • strategyAddress: Strategy contract address
    • tokenAddress: Underlying token address
    • sharesToUnderlying: Exchange rate as BigInt string
    • timestamp: Daily timestamp (UTC midnight)

Data Collection

  • New Seeder: seedStrategySharesDaily.ts
    • Reads sharesToUnderlyingView(1e18) from strategy contracts
    • Captures daily snapshots for all strategies in the database
    • Implements incremental sync (only processes new days)
    • Robust error handling with database fallbacks
    • Integrated into daily seeding workflow

API Endpoint

  • New Route: GET /metrics/historical/strategy-shares/:strategyAddress
    • Returns historical exchange rate data for a specific strategy
    • Cached responses (120 seconds)
    • Ordered by timestamp (ascending)
    • Response format:
      {
        "data": [
          {
            "strategyAddress": "0x...",
            "tokenAddress": "0x...", 
            "exchangeRate": "1000000000000000000",
            "timestamp": "2024-01-01T00:00:00.000Z"
          }
        ]
      }

- Add StrategySharesDaily model to capture daily exchange rates
- Create seedStrategySharesDaily seeder for daily data collection
- Add API endpoint GET /metrics/historical/strategy-shares/:address
- Integrate seeder into daily data collection workflow
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.

Capture 1d historical exchange rate between shares <-> tokens for tracked tokens

1 participant