Skip to content

Conversation

@SynnekOG
Copy link

Pull Request

Summary

This PR enhances LiquidityManagerV2 with new external view functions, allowing retrieval of liquidity provider details and user positions. These additions improve transparency and make it easier for frontends and integrators to query contract state.

Changes

  • LiquidityManagerV2
    • Added getLiquidityProvider(poolId, provider):
      • Returns detailed LiquidityProvider data for a given pool and address.
      • Includes Natspec documentation.
    • Added getUserPositions(user):
      • Returns an array of LiquidityPosition structs associated with a given user.
      • Includes Natspec documentation.
  • Ran forge fmt to ensure consistent formatting.

Motivation

  • Enables external consumers (dApps, dashboards, indexers) to query pool participation and liquidity provider details directly on-chain.
  • Lays groundwork for user-facing analytics and portfolio tracking.
  • Provides read-only utility functions without affecting contract state.

Next Steps

  • Add pagination or filtering for large datasets (e.g., users with many positions).
  • Extend view functions with additional metadata (e.g., reward eligibility, vesting progress).
  • Integrate these functions into frontend dashboards.

@2PykeETH 2PykeETH self-requested a review September 18, 2025 16:45
@2PykeETH 2PykeETH added documentation Improvements or additions to documentation enhancement New feature or request labels Sep 18, 2025
@2PykeETH 2PykeETH merged commit 370cc6a into CraftMeme:main Sep 18, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants