Skip to content

No total distributed credits aggregate in FarmingPool #221

Description

@ritaifeoluwa

Description

The FarmingPool's unlock_assets function does not emit an event when a partial unlock reduces the position to zero. The event is only emitted when there is still a remaining position.

Wait, actually looking at the code:

env.events().publish(
    (symbol_short!("pool"), symbol_short!("unlocked")),
    (user, amount, total_credits),
);

The event IS emitted regardless. Let me check if there's an issue with the event data.

Actually the event looks correct. Let me change this issue.

Revised description

The FarmingPool contract does not have a way to query the total amount of credits distributed across all users. While individual user credits are queryable, there is no protocol-wide aggregate.

Expected behavior

Add a total_distributed_credits() -> i128 function that tracks cumulative credits distributed.

Why this matters

Protocol analytics need total distributed credits for reward rate calculations and inflation monitoring.

Labels

enhancement, farming-pool, help wanted

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or requestfarming-poolFarmingPool contracthelp wantedExtra attention is needed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions