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

Soroswap liquidity providers #46

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Benjtalkshow
Copy link

Closes #37

This pull request introduces the following changes to the providers module:

  • Added error handling for provider data validation in providers/events.rs to ensure that liquidity and total supply values are valid.
  • Implemented the validate_provider_data function to check for negative liquidity and non-positive total supply values.
  • Added functions get_provider_from_mint and get_provider_from_burn to process mint and burn events, respectively.
    These functions validate the event data, calculate the share percentage, and create a ProvidersTable entry.
    The handle_contract_events function processes a list of contract events and logs them to the ProvidersTable.

Data Structures:

  • Defined MintEvent and BurnEvent structs in providers/types.rs to represent the data structure of mint and burn events.
  • Defined the ProvidersTable struct to store provider data, including the provider address, pool address, shares, share percentage, token amounts, timestamp, action, and transaction hash.

Module Structure:

  • Updated providers/mod.rs to include the events and types modules.

Testing:

Added unit tests for get_provider_from_mint and get_provider_from_burn to ensure the functions handle valid and invalid data correctly.

@esteblock Please review

Copy link

vercel bot commented Dec 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
zephyr-programs ❌ Failed (Inspect) Dec 6, 2024 9:08pm

Copy link

vercel bot commented Dec 6, 2024

@Benjtalkshow is attempting to deploy a commit to the PaltaLabs OU Team on Vercel.

A member of the Team first needs to authorize it.

@Benjtalkshow Benjtalkshow marked this pull request as ready for review December 6, 2024 21:08
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.

Create Table for Soroswap Liqudity Providers
1 participant