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

Aprs fixes #452

Closed
wants to merge 25 commits into from
Closed

Aprs fixes #452

wants to merge 25 commits into from

Conversation

gmbronco
Copy link
Contributor

Adding working supply to the BAL APRs calculations. Results are better for mainnet, but compared to the current SDK APRs there still differences.

franzns and others added 25 commits September 5, 2023 18:44
* Created a service to fetch yield tokens APR and push into DB

* Adding Apr Service to Mainnet network

* Added yield tokens fetch funcionality directly on beethovenx-backend, instead of use the yield-tokens cloudflare service;
Removed the boosted pools apr, and let only the yield tokens APR update, boosted pools are updated in another service;

* Adapting contracts from apr handler to ethers instead of viem;

* Changing apr type if pool type is linear;

* removing viem

* Fixing Ovix APR;

* Redesigning Ib Apr Handlers to be more scalable and open to new networks, tokens and urls;

* adding interface to default, ankr and aave apr handlers;

* Adding multichain support;
Changing arrow functions to normal functions;

* Types files for ankr and default-fetch; (Missing in the last commit)

* Creating new migration file;

* Removing test route;
Adding migration file;

* removing unused imports;

* Removing ethers-multicall-provider package

* removing undefined from "group" type

* Moving tokens and types to apr-handler file;
Changing map to for..of loop

* Using prismaId instead of chain id;
moving apr handler types file to ib-yield-apr-handlers;

* Checking if the pool is linear boosted by the token address;
Fixing network id type error on json rpc provider creation;

* Renaming ib-yield-apr-handlers to base-apr-handlers
Moving tokens to base-apr-handlers:
- Ankr eth fantom, ankr ftm fantom;
- Overnight Optimism usd+ and dai+ (moved overnight aprs to default base-apr-handlers)
- wstETH Optimism

Didn't move:
- Stader-staked-ftm <- Fixed Base APR Value?
- spooky <- Not being used on Fantom, so I didn’t add it to base apr handlers
- Yearn <- Using Base APR’s based on wrapped tokens in linear pools, not able to define which tokens to take
- Rocket Pool staked <- Fixed rETH base APR Value, I have rETH APR from url on main net, maybe I can use the same? https://drop-api.stafi.io/reth/v1/poolData
- Beefy <- Using beefy linear pools Id’s to get vaultAddress, there’s 2 options here:
1 - Let the beefy apr handler separated
2 - Create APR Handlers for each vault/beefy token.

- Reaper-Crypt <- The current apr handler verifies if the pool is from a ERC 4626 Factory, and build contract from wrappedToken.address, So I didn’t move this reaper to the base apr handler, same problem as Beefy

* Removing ib-yield-apr-handlers folder

* Refactoring all code to be more scalable;
Moving the apr config to network config;

* removing aave tokens unused;

* Renaming aprConfig to IbAprConfig;
Adding ReaperCrypt to Apr Handlers;
Removing services already included in base-apr-handlers;

* Removing Reaper Crypt Apr Service;

* Removing services that are already in the ib-yield service;
Adding fixed apr tokens;
Removing logs

* Removing test route;

* fixing base network incompatibilities;

* fixing optional beefy property in network config;

* Removing all unused functions of liquid staked base apr, left just xBoo, because idk what to do with the spooky apr service yet;

* Renaming AprConfig to IbAprConfig;

* clean up types

* simplify ib-tokens-apr service

* change default handler, adapt token lists

* fix percentage

* add try catch

* Changing the ib yield filter to network config;
Fixing default apr handler error;
testing on all networks;

* ibyield flag

* cleanup

* dont use nested query for apr

* lower case all addresses in configs

* adding rocket eth apr

---------

Co-authored-by: Luiz Gustavo Abou Hatem de Liz <[email protected]>
Co-authored-by: franz <[email protected]>
* fix: typos

* fix: infura key not needed by default

* fix: removing unnecessary try..catch
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.

4 participants