This repo offers a self service approach to Ethena Points Campaign integrations.
For your protocol to be included and your users to receive points, you should submit a PR to this repo. Here some guidelines to follow:
- Make a copy of
.env.example
and name it.env
. - Run
pip install -r requirements.txt
to install the required packages. - Add your integration metadata to
integrations/integration_ids.py
. - Create a new summary column in
constants/summary_columns.py
. - Make a copy of Template, naming the file
[protocol name]_integration.py
and place in theintegrations
directory. - Your integration must be a class that inherits from
CachedBalancesIntegration
and implements theget_block_balances
method. - The
get_block_balances
method should return a dict of block numbers to a dict of user addresses to balances at that block. (Note: Not all blocks are queried by this service in production- only a sampling, but your code should be capable of handling any block number.) - Write some basic tests at the bottom of the file to ensure your integration is working correctly.
- Submit a PR to this repo with your integration and ping the Ethena team in Telegram.
- Integrations must follow this architecture and be written in python.
- Pendle integrations are included as examples of functioning integrations. Run
python -m integrations.pendle_lpt_integration
to see the output. - The
get_block_balances
method should be as efficient as possible. So the use of the cached data from previous blocks if possible is highly encouraged. - We prefer that on chain RPC calls are used to get information as much as possible due to reliability and trustlessness. Off chain calls to apis or subgraphs are acceptable if necessary. If usage is not reasonable or the external service is not reliable, users may not receive their points.
- ClaimedEnaIntegration: This integration demonstrates how to track ENA token claims using cached balance snapshots for improved performance. It reads from previous balance snapshots to efficiently track user claim history.
- BeefyCachedBalanceExampleIntegration: This integration is an example of a cached balance integration that is based on API calls.
- PendleLPTIntegration: (Legacy Example) A basic integration showing Pendle LPT staking tracking. Note: This is a non-cached implementation included only for reference - new integrations should use the cached approach for better efficiency.
- PendleYTIntegration: (Legacy Example) A basic integration showing Pendle YT staking tracking. Note: This is a non-cached implementation included only for reference - new integrations should use the cached approach for better efficiency.