Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

Soroswap liquidity providers#46

Open
Benjtalkshow wants to merge 4 commits intosoroswap:mainfrom
Benjtalkshow:soroswap-liquidity-providers
Open

Soroswap liquidity providers#46
Benjtalkshow wants to merge 4 commits intosoroswap:mainfrom
Benjtalkshow:soroswap-liquidity-providers

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

@vercel
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

@vercel
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create Table for Soroswap Liqudity Providers

1 participant