Requirements
Tiered Loyalty Program
Development Planning Diagram

Status Update - Phase 1
Done:
- Initial Setup and Environment Configuration
- Set up the development environment with necessary dependencies and configurations.
- Configured connection to Ethereum network via Infura.
- Implemented logging for better monitoring and debugging.
- Loading and Parsing ABIs
- Loaded ABI files for Curve and Uniswap V3 from JSON files.
- Ensured correct parsing of ABI files for contract interactions.
- Event Fetching and Processing
- Implemented functionality to fetch events from Curve and Uniswap V3 pools.
- Developed functions to decode and process various liquidity events (
AddLiquidity
, RemoveLiquidity
, Mint
, Burn
).
- Token Address and Name Mapping
- Created a dictionary to map token addresses to their respective names.
- Implemented functions to dynamically fetch
token0
and token1
addresses for Uniswap V3 pools.
- Implemented functions to fetch
coins
for Curve pools.
- Ensured correct matching of token addresses to token names for price fetching.
- Price Fetching and Calculation
- Integrated functionality to fetch historical token prices from CoinGecko based on token names.
- Implemented reward calculation based on fetched token prices and event data.
- Ensured accurate calculation of total value of tokens during liquidity events.
- Rewards Calculation
- Developed logic to calculate weighted average liquidity for each provider.
- Implemented calculation of estimated rewards for liquidity providers based on their average liquidity.
- Ensured correct distribution of total rewards among providers.
- Error Handling and Logging Enhancements
- Enhanced error handling during event processing and token fetching.
- Implemented detailed logging to capture errors and provide insights for debugging.
- Ensured the application logs relevant information for monitoring and auditing purposes.
- IPFS Integration for Data Storage
- Integrated with Pinata to log events and rewards data to IPFS.
- Implemented functionality to pin JSON data to IPFS and retrieve CIDs.
- Ensured data integrity and availability through IPFS pinning.
- Flask API Development
- Developed a Flask API to expose endpoints for fetching latest CIDs of events and rewards.
- Ensured the API returns accurate and up-to-date data for external consumption.
- Testing and Validation
- Conducted thorough testing of event fetching, processing, and rewards calculation.
- Validated the accuracy of token price fetching and reward distribution.
- Ensured the application handles various edge cases and error scenarios gracefully.
WIP:
- Continue refining and optimizing the reward calculation logic.