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

Fixed a bug in the zerolend farms and added earlyZERO rewards. #909

Merged
merged 4 commits into from
Aug 2, 2023

Conversation

zerolend
Copy link
Contributor

@zerolend zerolend commented Aug 2, 2023

There was a bug in the subgraph that we used to calculate rewards so we updated the subgraph url and also earlyZERO rewards showed NaN for the price so we fixed that as well.

@llamatester
Copy link

The zerolend adapter exports pools:

Test Suites: 1 passed, 1 total
Tests: 46 passed, 46 total
Snapshots: 0 total
Time: 0.335 s
Ran all test suites.

Nb of pools: 6
 

Sample pools:
┌─────────┬──────────────────────────────────────────────────┬──────────────┬────────────┬────────┬────────────────────┬──────────────────────┬────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────┬──────────────────────────────────────────────────┬────────────────────┬────────────────────┬─────────────────────┬────────────────────┬──────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬────────────┐
│ (index) │                       pool                       │    chain     │  project   │ symbol │       tvlUsd       │       apyBase        │     apyReward      │                                          rewardTokens                                          │                 underlyingTokens                 │   totalSupplyUsd   │   totalBorrowUsd   │    apyBaseBorrow    │  apyRewardBorrow   │ ltv  │                                                                                            url                                                                                             │ borrowable │
├─────────┼──────────────────────────────────────────────────┼──────────────┼────────────┼────────┼────────────────────┼──────────────────────┼────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────┼────────────────────┼────────────────────┼─────────────────────┼────────────────────┼──────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────┤
│    0    │ '0x9002ecb8a06060e3b56669c6b8f18e1c3b119914-era' │ 'zkSync Era' │ 'zerolend' │ 'WETH' │ 12549.862613579402 │  0.1379291381760959  │ 552.4208265253957  │ [ '0x5aea5775959fbc2557cc8789bc1bf90a239d9a91', '0x9793eac2fecef55248efa039bec78e82ac01cb2f' ] │ [ '0x5aea5775959fbc2557cc8789bc1bf90a239d9a91' ] │ 13932.541335211858 │ 1382.6787216324556 │  1.544007905718159  │ 1094.779268905521  │ 0.8  │ 'https://app.zerolend.xyz/reserve-overview/?underlyingAsset=0x5aea5775959fbc2557cc8789bc1bf90a239d9a91&marketName=undefined&utm_source=defillama&utm_medium=listing&utm_campaign=external' │    true    │
│    1    │ '0x016341e6da8da66b33fd32189328c102f32da7cc-era' │ 'zkSync Era' │ 'zerolend' │ 'USDC' │ 7818.1734868972835 │  0.780942301808175   │ 566.4965939329146  │ [ '0x5aea5775959fbc2557cc8789bc1bf90a239d9a91', '0x9793eac2fecef55248efa039bec78e82ac01cb2f' ] │ [ '0x3355df6d4c9c3035724fd0e3914de96a5a83aaf4' ] │ 13979.289698839306 │ 6161.116211942022  │ 1.9589348745536201  │ 245.69054501292445 │ 0.8  │ 'https://app.zerolend.xyz/reserve-overview/?underlyingAsset=0x3355df6d4c9c3035724fd0e3914de96a5a83aaf4&marketName=undefined&utm_source=defillama&utm_medium=listing&utm_campaign=external' │    true    │
│    2    │ '0x9ca4806fa54984bf5da4e280b7aa8bb821d21505-era' │ 'zkSync Era' │ 'zerolend' │ 'USDT' │     111.028157     │ 0.024813066264604097 │ 12559.953856029497 │                        [ '0x9793eac2fecef55248efa039bec78e82ac01cb2f' ]                        │ [ '0x493257fd37edb34451f62edf8d2a0c418852ba4c' ] │     120.520188     │ 9.492031000000011  │ 0.35004808321993025 │        null        │ 0.75 │ 'https://app.zerolend.xyz/reserve-overview/?underlyingAsset=0x493257fd37edb34451f62edf8d2a0c418852ba4c&marketName=undefined&utm_source=defillama&utm_medium=listing&utm_campaign=external' │    true    │
│    3    │ '0xd97ac0ce99329ee19b97d03e099eb42d7aa19ddb-era' │ 'zkSync Era' │ 'zerolend' │ 'LUSD' │ 49.89688852036124  │          0           │ 30337.122110976896 │                        [ '0x9793eac2fecef55248efa039bec78e82ac01cb2f' ]                        │ [ '0x503234f203fc7eb888eec8513210612a43cf6115' ] │ 49.89688852036124  │         0          │          0          │        null        │ 0.75 │ 'https://app.zerolend.xyz/reserve-overview/?underlyingAsset=0x503234f203fc7eb888eec8513210612a43cf6115&marketName=undefined&utm_source=defillama&utm_medium=listing&utm_campaign=external' │    true    │
│    4    │ '0x54330d2333adbf715eb449aad38153378601cf67-era' │ 'zkSync Era' │ 'zerolend' │ 'PEPE' │ 1.880583801245846  │          0           │ 804924.5128013907  │                        [ '0x9793eac2fecef55248efa039bec78e82ac01cb2f' ]                        │ [ '0xfd282f16a64c6d304ac05d1a58da15bed0467c71' ] │ 1.880583801245846  │         0          │          0          │        null        │ 0.2  │ 'https://app.zerolend.xyz/reserve-overview/?underlyingAsset=0xfd282f16a64c6d304ac05d1a58da15bed0467c71&marketName=undefined&utm_source=defillama&utm_medium=listing&utm_campaign=external' │   false    │
│    5    │ '0x7c65e6ec6feceb333092e6fe69672a3475c591fb-era' │ 'zkSync Era' │ 'zerolend' │ 'WBTC' │ 1.8411848200000003 │          0           │ 822148.8595588139  │                        [ '0x9793eac2fecef55248efa039bec78e82ac01cb2f' ]                        │ [ '0xbbeb516fb02a01611cbbe0453fe3c580d7281011' ] │ 1.8411848200000003 │         0          │          0          │        null        │ 0.7  │ 'https://app.zerolend.xyz/reserve-overview/?underlyingAsset=0xbbeb516fb02a01611cbbe0453fe3c580d7281011&marketName=undefined&utm_source=defillama&utm_medium=listing&utm_campaign=external' │    true    │
└─────────┴──────────────────────────────────────────────────┴──────────────┴────────────┴────────┴────────────────────┴──────────────────────┴────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────────────────────────────────────────┴────────────────────┴────────────────────┴─────────────────────┴────────────────────┴──────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴────────────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama

@slasher125
Copy link
Collaborator

seems apyReward needs to be scaled by / 10?

@zerolend
Copy link
Contributor Author

zerolend commented Aug 2, 2023

Those pools have low liquidity hence the APR is on the higher side. But the pools with 10k$+ show the right APR.

@llamatester
Copy link

The zerolend adapter exports pools:

Test Suites: 1 passed, 1 total
Tests: 46 passed, 46 total
Snapshots: 0 total
Time: 0.453 s
Ran all test suites.

Nb of pools: 6
 

Sample pools:
┌─────────┬──────────────────────────────────────────────────┬──────────────┬────────────┬────────┬────────────────────┬──────────────────────┬────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────┬──────────────────────────────────────────────────┬────────────────────┬────────────────────┬─────────────────────┬────────────────────┬──────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬────────────┐
│ (index) │                       pool                       │    chain     │  project   │ symbol │       tvlUsd       │       apyBase        │     apyReward      │                                          rewardTokens                                          │                 underlyingTokens                 │   totalSupplyUsd   │   totalBorrowUsd   │    apyBaseBorrow    │  apyRewardBorrow   │ ltv  │                                                                                            url                                                                                             │ borrowable │
├─────────┼──────────────────────────────────────────────────┼──────────────┼────────────┼────────┼────────────────────┼──────────────────────┼────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────┼────────────────────┼────────────────────┼─────────────────────┼────────────────────┼──────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────┤
│    0    │ '0x9002ecb8a06060e3b56669c6b8f18e1c3b119914-era' │ 'zkSync Era' │ 'zerolend' │ 'WETH' │ 12563.190859272683 │  0.1379291381760959  │ 551.8515701735046  │ [ '0x5aea5775959fbc2557cc8789bc1bf90a239d9a91', '0x9793eac2fecef55248efa039bec78e82ac01cb2f' ] │ [ '0x5aea5775959fbc2557cc8789bc1bf90a239d9a91' ] │ 13947.341669385922 │ 1384.1508101132385 │  1.544007905718159  │ 1093.6149362771826 │ 0.8  │ 'https://app.zerolend.xyz/reserve-overview/?underlyingAsset=0x5aea5775959fbc2557cc8789bc1bf90a239d9a91&marketName=undefined&utm_source=defillama&utm_medium=listing&utm_campaign=external' │    true    │
│    1    │ '0x016341e6da8da66b33fd32189328c102f32da7cc-era' │ 'zkSync Era' │ 'zerolend' │ 'USDC' │    7920.339721     │  0.7699393557797637  │  562.351027700277  │ [ '0x5aea5775959fbc2557cc8789bc1bf90a239d9a91', '0x9793eac2fecef55248efa039bec78e82ac01cb2f' ] │ [ '0x3355df6d4c9c3035724fd0e3914de96a5a83aaf4' ] │    14083.183652    │ 6162.843930999999  │ 1.9450316727165635  │ 245.62166703357983 │ 0.8  │ 'https://app.zerolend.xyz/reserve-overview/?underlyingAsset=0x3355df6d4c9c3035724fd0e3914de96a5a83aaf4&marketName=undefined&utm_source=defillama&utm_medium=listing&utm_campaign=external' │    true    │
│    2    │ '0x9ca4806fa54984bf5da4e280b7aa8bb821d21505-era' │ 'zkSync Era' │ 'zerolend' │ 'USDT' │  110.971754696244  │ 0.024813066264604097 │ 12566.336929902784 │                        [ '0x9793eac2fecef55248efa039bec78e82ac01cb2f' ]                        │ [ '0x493257fd37edb34451f62edf8d2a0c418852ba4c' ] │ 120.45896974144802 │  9.48721504520401  │ 0.35004808321993025 │        null        │ 0.75 │ 'https://app.zerolend.xyz/reserve-overview/?underlyingAsset=0x493257fd37edb34451f62edf8d2a0c418852ba4c&marketName=undefined&utm_source=defillama&utm_medium=listing&utm_campaign=external' │    true    │
│    3    │ '0xd97ac0ce99329ee19b97d03e099eb42d7aa19ddb-era' │ 'zkSync Era' │ 'zerolend' │ 'LUSD' │ 49.903791084916605 │          0           │ 30332.925957954398 │                        [ '0x9793eac2fecef55248efa039bec78e82ac01cb2f' ]                        │ [ '0x503234f203fc7eb888eec8513210612a43cf6115' ] │ 49.903791084916605 │         0          │          0          │        null        │ 0.75 │ 'https://app.zerolend.xyz/reserve-overview/?underlyingAsset=0x503234f203fc7eb888eec8513210612a43cf6115&marketName=undefined&utm_source=defillama&utm_medium=listing&utm_campaign=external' │    true    │
│    4    │ '0x54330d2333adbf715eb449aad38153378601cf67-era' │ 'zkSync Era' │ 'zerolend' │ 'PEPE' │ 1.8656585329819904 │          0           │ 811363.9089038018  │                        [ '0x9793eac2fecef55248efa039bec78e82ac01cb2f' ]                        │ [ '0xfd282f16a64c6d304ac05d1a58da15bed0467c71' ] │ 1.8656585329819904 │         0          │          0          │        null        │ 0.2  │ 'https://app.zerolend.xyz/reserve-overview/?underlyingAsset=0xfd282f16a64c6d304ac05d1a58da15bed0467c71&marketName=undefined&utm_source=defillama&utm_medium=listing&utm_campaign=external' │   false    │
│    5    │ '0x7c65e6ec6feceb333092e6fe69672a3475c591fb-era' │ 'zkSync Era' │ 'zerolend' │ 'WBTC' │ 1.8433747700000003 │          0           │  821172.137448751  │                        [ '0x9793eac2fecef55248efa039bec78e82ac01cb2f' ]                        │ [ '0xbbeb516fb02a01611cbbe0453fe3c580d7281011' ] │ 1.8433747700000003 │         0          │          0          │        null        │ 0.7  │ 'https://app.zerolend.xyz/reserve-overview/?underlyingAsset=0xbbeb516fb02a01611cbbe0453fe3c580d7281011&marketName=undefined&utm_source=defillama&utm_medium=listing&utm_campaign=external' │    true    │
└─────────┴──────────────────────────────────────────────────┴──────────────┴────────────┴────────┴────────────────────┴──────────────────────┴────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────────────────────────────────────────┴────────────────────┴────────────────────┴─────────────────────┴────────────────────┴──────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴────────────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama

@slasher125
Copy link
Collaborator

slasher125 commented Aug 2, 2023

the output for weth apyRewardBorrow: 1093.6149362771826. on your ui its: 109.3
-> thats what i mean by needs to scaled

same is true for apyReward

@zerolend
Copy link
Contributor Author

zerolend commented Aug 2, 2023

Ah good catch. Yes, we are going to get that fixed right now.

@llamatester
Copy link

The zerolend adapter exports pools:

Test Suites: 1 passed, 1 total
Tests: 46 passed, 46 total
Snapshots: 0 total
Time: 0.449 s
Ran all test suites.

Nb of pools: 6
 

Sample pools:
┌─────────┬──────────────────────────────────────────────────┬──────────────┬────────────┬────────┬────────────────────┬──────────────────────┬────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────┬──────────────────────────────────────────────────┬────────────────────┬───────────────────┬─────────────────────┬────────────────────┬──────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬────────────┐
│ (index) │                       pool                       │    chain     │  project   │ symbol │       tvlUsd       │       apyBase        │     apyReward      │                                          rewardTokens                                          │                 underlyingTokens                 │   totalSupplyUsd   │  totalBorrowUsd   │    apyBaseBorrow    │  apyRewardBorrow   │ ltv  │                                                                                            url                                                                                             │ borrowable │
├─────────┼──────────────────────────────────────────────────┼──────────────┼────────────┼────────┼────────────────────┼──────────────────────┼────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────┼────────────────────┼───────────────────┼─────────────────────┼────────────────────┼──────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────┤
│    0    │ '0x9002ecb8a06060e3b56669c6b8f18e1c3b119914-era' │ 'zkSync Era' │ 'zerolend' │ 'WETH' │ 12562.176018230046 │  0.1379291381760959  │ 69.56837729257482  │ [ '0x5aea5775959fbc2557cc8789bc1bf90a239d9a91', '0x9793eac2fecef55248efa039bec78e82ac01cb2f' ] │ [ '0x5aea5775959fbc2557cc8789bc1bf90a239d9a91' ] │ 13946.215762898397 │ 1384.039744668351 │  1.544007905718159  │ 109.37026959169627 │ 0.8  │ 'https://app.zerolend.xyz/reserve-overview/?underlyingAsset=0x5aea5775959fbc2557cc8789bc1bf90a239d9a91&marketName=undefined&utm_source=defillama&utm_medium=listing&utm_campaign=external' │    true    │
│    1    │ '0x016341e6da8da66b33fd32189328c102f32da7cc-era' │ 'zkSync Era' │ 'zerolend' │ 'USDC' │ 7920.078349789208  │  0.7699393557797637  │ 84.71571805507014  │ [ '0x5aea5775959fbc2557cc8789bc1bf90a239d9a91', '0x9793eac2fecef55248efa039bec78e82ac01cb2f' ] │ [ '0x3355df6d4c9c3035724fd0e3914de96a5a83aaf4' ] │ 14082.72310480095  │ 6162.644755011743 │ 1.9450316727165635  │ 24.562960549834838 │ 0.8  │ 'https://app.zerolend.xyz/reserve-overview/?underlyingAsset=0x3355df6d4c9c3035724fd0e3914de96a5a83aaf4&marketName=undefined&utm_source=defillama&utm_medium=listing&utm_campaign=external' │    true    │
│    2    │ '0x9ca4806fa54984bf5da4e280b7aa8bb821d21505-era' │ 'zkSync Era' │ 'zerolend' │ 'USDT' │ 110.98285751194399 │ 0.024813066264604097 │ 1256.5079679036928 │                        [ '0x9793eac2fecef55248efa039bec78e82ac01cb2f' ]                        │ [ '0x493257fd37edb34451f62edf8d2a0c418852ba4c' ] │ 120.47102276044001 │ 9.488165248496017 │ 0.35004808321993025 │        null        │ 0.75 │ 'https://app.zerolend.xyz/reserve-overview/?underlyingAsset=0x493257fd37edb34451f62edf8d2a0c418852ba4c&marketName=undefined&utm_source=defillama&utm_medium=listing&utm_campaign=external' │    true    │
│    3    │ '0xd97ac0ce99329ee19b97d03e099eb42d7aa19ddb-era' │ 'zkSync Era' │ 'zerolend' │ 'LUSD' │ 49.89678848319377  │          0           │ 3033.7182933323534 │                        [ '0x9793eac2fecef55248efa039bec78e82ac01cb2f' ]                        │ [ '0x503234f203fc7eb888eec8513210612a43cf6115' ] │ 49.89678848319377  │         0         │          0          │        null        │ 0.75 │ 'https://app.zerolend.xyz/reserve-overview/?underlyingAsset=0x503234f203fc7eb888eec8513210612a43cf6115&marketName=undefined&utm_source=defillama&utm_medium=listing&utm_campaign=external' │    true    │
│    4    │ '0x54330d2333adbf715eb449aad38153378601cf67-era' │ 'zkSync Era' │ 'zerolend' │ 'PEPE' │ 1.880583801245846  │          0           │ 80492.45128013907  │                        [ '0x9793eac2fecef55248efa039bec78e82ac01cb2f' ]                        │ [ '0xfd282f16a64c6d304ac05d1a58da15bed0467c71' ] │ 1.880583801245846  │         0         │          0          │        null        │ 0.2  │ 'https://app.zerolend.xyz/reserve-overview/?underlyingAsset=0xfd282f16a64c6d304ac05d1a58da15bed0467c71&marketName=undefined&utm_source=defillama&utm_medium=listing&utm_campaign=external' │   false    │
│    5    │ '0x7c65e6ec6feceb333092e6fe69672a3475c591fb-era' │ 'zkSync Era' │ 'zerolend' │ 'WBTC' │ 1.8429993500000001 │          0           │ 82133.94106731507  │                        [ '0x9793eac2fecef55248efa039bec78e82ac01cb2f' ]                        │ [ '0xbbeb516fb02a01611cbbe0453fe3c580d7281011' ] │ 1.8429993500000001 │         0         │          0          │        null        │ 0.7  │ 'https://app.zerolend.xyz/reserve-overview/?underlyingAsset=0xbbeb516fb02a01611cbbe0453fe3c580d7281011&marketName=undefined&utm_source=defillama&utm_medium=listing&utm_campaign=external' │    true    │
└─────────┴──────────────────────────────────────────────────┴──────────────┴────────────┴────────┴────────────────────┴──────────────────────┴────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────────────────────────────────────────┴────────────────────┴───────────────────┴─────────────────────┴────────────────────┴──────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴────────────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama

@zerolend
Copy link
Contributor Author

zerolend commented Aug 2, 2023

There you go @slasher125 We have patched it and the values are matching as per the UI.

@slasher125 slasher125 merged commit 3ab1270 into DefiLlama:master Aug 2, 2023
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.

3 participants