Skip to content
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

Strategy & User stats Tracking #30

Closed
wants to merge 2 commits into from
Closed

Conversation

njokuScript
Copy link
Contributor

Overview

This PR implements comprehensive statistics tracking for both strategies and users in the Liquid Protocol. It adds detailed logging and testing capabilities to monitor strategy performance and user participation.

Key Changes

Strategy-Level Statistics

  • Added detailed tracking of:
    • Total users participating in each strategy
    • Total fees generated
    • Deposit tokens and their amounts
    • Last update timestamps
  • Implemented _logStats helper for formatted output of strategy metrics

User-Level Statistics

  • Enhanced user activity tracking with:
    • Join and last action timestamps
    • Per-step token balances
    • Share balances with protocol details
    • Underlying token tracking
  • Added _logUserStats helper for clear visualization of user positions

- Implemented logic to initialize and update deposit tokens and amounts in the Strategy contract.
- Added a new function `getStrategyStats` to retrieve strategy statistics by ID.
- Updated the `StrategyStats` struct to include arrays for deposit tokens and amounts.
@njokuScript njokuScript requested a review from tanim0la January 10, 2025 14:53
@njokuScript njokuScript changed the base branch from main to curator January 10, 2025 14:53
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