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

Add Optimism and fixed to consider the chain in the unique pool test #1462

Merged
merged 2 commits into from
Aug 14, 2024

Conversation

Leoakin43
Copy link
Contributor

  • Add optimosm yields
  • Fix the unique pool test to consider pool + chain

@llamatester
Copy link

The moonwell adapter exports pools:

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

Nb of pools: 28
 

Sample pools:
┌─────────┬──────────────────────────────────────────────┬────────────┬────────────┬──────────┬────────────────────┬──────────────────────┬─────────────────────┬──────────────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────┬────────────────────┬────────────────────┬────────────────────┬─────────────────┬──────┐
│ (index) │                     pool                     │   chain    │  project   │  symbol  │       tvlUsd       │       apyBase        │      apyReward      │                 underlyingTokens                 │                                          rewardTokens                                          │   totalSupplyUsd   │   totalBorrowUsd   │   apyBaseBorrow    │ apyRewardBorrow │ ltv  │
├─────────┼──────────────────────────────────────────────┼────────────┼────────────┼──────────┼────────────────────┼──────────────────────┼─────────────────────┼──────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┼────────────────────┼────────────────────┼─────────────────┼──────┤
│    0    │ '0xedc817a28e8b93b03976fbd4a3ddbc9f7d176c22' │   'Base'   │ 'moonwell' │  'USDC'  │ 14975265.058613658 │  1.7678820674249751  │ 0.3539465077707876  │ [ '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913' ] │ [ '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', '0xA88594D404727625A9437C3f886C7643872296AE' ] │ 34425049.965064734 │ 19449784.906451076 │ 3.5063440834259163 │    0.626628     │ 0.83 │
│    1    │ '0x628ff693426583d9a7fb391e54366292f509d457' │   'Base'   │ 'moonwell' │  'ETH'   │ 14646979.027561456 │  0.521424039269669   │ 0.38241443481662574 │ [ '0x4200000000000000000000000000000000000006' ] │ [ '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', '0xA88594D404727625A9437C3f886C7643872296AE' ] │ 67252397.51805623  │ 52605418.49049477  │ 0.7852676127753755 │     0.48895     │ 0.81 │
│    2    │ '0x3bf93770f2d4a794c3d9ebefbaebae2a8f09a5e5' │   'Base'   │ 'moonwell' │ 'cbETH'  │ 12034786.304702336 │ 0.057804009139150736 │ 0.2923779062890294  │ [ '0x2ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec22' ] │ [ '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', '0xA88594D404727625A9437C3f886C7643872296AE' ] │ 13455263.427663704 │ 1420477.1229613682 │ 0.646051535148584  │    3.387173     │ 0.78 │
│    3    │ '0x627fe393bc6edda28e99ae648fd6ff362514304b' │   'Base'   │ 'moonwell' │ 'wstETH' │ 11168283.501717651 │ 0.07792917172575464  │ 0.30959759301973455 │ [ '0xc1cba3fcea344f92d9239c08c0568f6f2f0ee452' ] │ [ '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', '0xA88594D404727625A9437C3f886C7643872296AE' ] │ 12728433.118978098 │ 1560149.6172604465 │ 0.7504837137581655 │    3.089162     │ 0.78 │
│    4    │ '0xaaa20c5a584a9fecdfedd71e46da7858b774a9ce' │ 'Moonbeam' │ 'moonwell' │  'WBTC'  │ 10310233.250485959 │ 0.004202058213387261 │ 1.6205502376990815  │ [ '0xe57ebd2d67b462e9926e04a8e33f01cd0d64346d' ] │ [ '0x511ab53f793683763e5a8829738301368a2411e3', '0x0000000000000000000000000000000000000000' ] │ 10342710.320026902 │ 32477.069540944813 │ 2.0799982772491177 │        0        │ 0.31 │
│    5    │ '0x73902f619ceb9b31fd8efecf435cbdf89e369ba6' │   'Base'   │ 'moonwell' │  'AERO'  │  5072521.40557571  │   34.2865049861151   │ 0.30298167336597615 │ [ '0x940181a94a35a4569e4529a3cdfb74e38fd98631' ] │ [ '0xA88594D404727625A9437C3f886C7643872296AE', '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913' ] │ 12584122.63892276  │  7511601.23334705  │ 102.41573894548148 │    0.620799     │ 0.65 │
│    6    │ '0xd22da948c0ab3a27f5570b604f3adef5f68211c3' │ 'Moonbeam' │ 'moonwell' │ 'xcDOT'  │ 3914503.836279869  │ 0.31718345443330076  │ 1.8544090080930535  │ [ '0xffffffff1fcacbd218edc0eba20fc2308c778080' ] │ [ '0x511ab53f793683763e5a8829738301368a2411e3', '0x0000000000000000000000000000000000000000' ] │ 4476232.730034261  │ 561728.8937543917  │ 3.958505860541961  │    14.777175    │ 0.55 │
│    7    │ '0xcb1dacd30638ae38f2b94ea64f066045b7d45f44' │   'Base'   │ 'moonwell' │  'rETH'  │ 2255935.340607478  │ 0.16312150047246288  │ 0.32983583912098047 │ [ '0xb6fe221fe9eef5aba221c348ba20a1bf5e73624c' ] │ [ '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', '0xA88594D404727625A9437C3f886C7643872296AE' ] │ 2742106.2995673735 │ 486170.9589598957  │ 1.0873733867570623 │     2.28024     │ 0.78 │
│    8    │ '0x091608f4e4a15335145be0a279483c0f8e4c7955' │ 'Moonbeam' │ 'moonwell' │  'GLMR'  │ 2253724.5420125844 │  1.4259686700805796  │ 2.2328731825904358  │ [ '0xacc15dc74880c9944775448304b263d191c6077f' ] │ [ '0x511ab53f793683763e5a8829738301368a2411e3', '0x0000000000000000000000000000000000000000' ] │ 3315286.507878415  │ 1061561.9658658304 │ 7.039098449880976  │    6.973323     │ 0.57 │
│    9    │ '0xb4104c02bbf4e9be85aaa41a62974e4e28d59a33' │ 'Optimism' │ 'moonwell' │  'ETH'   │ 1530566.1845268388 │  1.1048600344976345  │ 6.7403969441035585  │ [ '0x4200000000000000000000000000000000000006' ] │ [ '0x4200000000000000000000000000000000000042', '0xA88594D404727625A9437C3f886C7643872296AE' ] │ 2261467.7068328885 │ 730901.5223060498  │ 3.849643091830357  │        0        │ 0.81 │
└─────────┴──────────────────────────────────────────────┴────────────┴────────────┴──────────┴────────────────────┴──────────────────────┴─────────────────────┴──────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────┴────────────────────┴────────────────────┴────────────────────┴─────────────────┴──────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama

@@ -57,7 +57,7 @@ describe(`Running ${process.env.npm_config_adapter} Test`, () => {
});

test('Check for unique pool ids', () => {
const poolIds = apy.map((pool) => pool.pool);
const poolIds = apy.map((pool) => `${pool.pool}-${pool.chain}`);
Copy link
Collaborator

@slasher125 slasher125 Aug 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is wrong and needs to be reverted. u need to make sure that inside the adapter pool values are deduplicated. if u are using the same address multiple times on different chains u can add the chain suffix like u did, but it needs to be inside the adapter module

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@llamatester
Copy link

The moonwell adapter exports pools:

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

Nb of pools: 28
 

Sample pools:
┌─────────┬───────────────────────────────────────────────────────┬────────────┬────────────┬──────────┬────────────────────┬──────────────────────┬─────────────────────┬──────────────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────┬────────────────────┬────────────────────┬────────────────────┬─────────────────┬──────┐
│ (index) │                         pool                          │   chain    │  project   │  symbol  │       tvlUsd       │       apyBase        │      apyReward      │                 underlyingTokens                 │                                          rewardTokens                                          │   totalSupplyUsd   │   totalBorrowUsd   │   apyBaseBorrow    │ apyRewardBorrow │ ltv  │
├─────────┼───────────────────────────────────────────────────────┼────────────┼────────────┼──────────┼────────────────────┼──────────────────────┼─────────────────────┼──────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┼────────────────────┼────────────────────┼─────────────────┼──────┤
│    0    │   '0xedc817a28e8b93b03976fbd4a3ddbc9f7d176c22-base'   │   'Base'   │ 'moonwell' │  'USDC'  │ 15975387.711041871 │  1.6640861147111163  │ 0.35574438344666826 │ [ '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913' ] │ [ '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', '0xA88594D404727625A9437C3f886C7643872296AE' ] │ 35366662.353541136 │ 19391274.642499264 │ 3.4009856416509665 │    0.648985     │ 0.83 │
│    1    │   '0x628ff693426583d9a7fb391e54366292f509d457-base'   │   'Base'   │ 'moonwell' │  'ETH'   │ 14059148.202780195 │  0.528738445257404   │ 0.40108021284101825 │ [ '0x4200000000000000000000000000000000000006' ] │ [ '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', '0xA88594D404727625A9437C3f886C7643872296AE' ] │ 66211088.69943661  │ 52151940.49665642  │ 0.7907633730401376 │    0.509264     │ 0.81 │
│    2    │   '0x3bf93770f2d4a794c3d9ebefbaebae2a8f09a5e5-base'   │   'Base'   │ 'moonwell' │ 'cbETH'  │ 11958084.770494206 │ 0.05811622560740748  │  0.303740703047366  │ [ '0x2ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec22' ] │ [ '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', '0xA88594D404727625A9437C3f886C7643872296AE' ] │  13373764.7686692  │ 1415679.998174993  │ 0.6477990459884175 │    3.509271     │ 0.78 │
│    3    │   '0x627fe393bc6edda28e99ae648fd6ff362514304b-base'   │   'Base'   │ 'moonwell' │ 'wstETH' │ 11067388.82250819  │ 0.07886435813007076  │ 0.3223263463138914  │ [ '0xc1cba3fcea344f92d9239c08c0568f6f2f0ee452' ] │ [ '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', '0xA88594D404727625A9437C3f886C7643872296AE' ] │ 12623989.72886841  │ 1556600.9063602192 │ 0.754988451425298  │    3.196981     │ 0.78 │
│    4    │ '0xaaa20c5a584a9fecdfedd71e46da7858b774a9ce-moonbeam' │ 'Moonbeam' │ 'moonwell' │  'WBTC'  │ 10108671.650953934 │ 0.004674302328266933 │ 1.6917073650352261  │ [ '0xe57ebd2d67b462e9926e04a8e33f01cd0d64346d' ] │ [ '0x511ab53f793683763e5a8829738301368a2411e3', '0x0000000000000000000000000000000000000000' ] │ 10143994.68937337  │ 35323.03841943652  │ 2.0865278740605397 │        0        │ 0.31 │
│    5    │   '0x73902f619ceb9b31fd8efecf435cbdf89e369ba6-base'   │   'Base'   │ 'moonwell' │  'AERO'  │ 5167242.273006464  │  33.17291554892006   │  0.310006223748653  │ [ '0x940181a94a35a4569e4529a3cdfb74e38fd98631' ] │ [ '0xA88594D404727625A9437C3f886C7643872296AE', '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913' ] │ 12699563.862634325 │ 7532321.589627861  │ 99.29699970276158  │    0.639241     │ 0.65 │
│    6    │ '0xd22da948c0ab3a27f5570b604f3adef5f68211c3-moonbeam' │ 'Moonbeam' │ 'moonwell' │ 'xcDOT'  │ 3640183.3000410087 │  0.3598582038399023  │ 2.0159605344593916  │ [ '0xffffffff1fcacbd218edc0eba20fc2308c778080' ] │ [ '0x511ab53f793683763e5a8829738301368a2411e3', '0x0000000000000000000000000000000000000000' ] │ 4215737.433709078  │ 575554.1336680686  │ 4.130686600666844  │    14.766222    │ 0.55 │
│    7    │   '0xcb1dacd30638ae38f2b94ea64f066045b7d45f44-base'   │   'Base'   │ 'moonwell' │  'rETH'  │ 2246602.1427157433 │ 0.16340963708607603  │ 0.34192879368679363 │ [ '0xb6fe221fe9eef5aba221c348ba20a1bf5e73624c' ] │ [ '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', '0xA88594D404727625A9437C3f886C7643872296AE' ] │ 2731280.9330703784 │  484678.790354635  │  1.08833772860486  │    2.361532     │ 0.78 │
│    8    │ '0x091608f4e4a15335145be0a279483c0f8e4c7955-moonbeam' │ 'Moonbeam' │ 'moonwell' │  'GLMR'  │ 2210526.0750752036 │  1.3694819394443503  │  2.356375127865059  │ [ '0xacc15dc74880c9944775448304b263d191c6077f' ] │ [ '0x511ab53f793683763e5a8829738301368a2411e3', '0x0000000000000000000000000000000000000000' ] │ 3216459.499025828  │ 1005933.4239506248 │ 6.919464986861068  │     7.53448     │ 0.57 │
│    9    │ '0xb4104c02bbf4e9be85aaa41a62974e4e28d59a33-optimism' │ 'Optimism' │ 'moonwell' │  'ETH'   │ 2034745.6692843526 │  0.8641703864691097  │  5.406073488104689  │ [ '0x4200000000000000000000000000000000000006' ] │ [ '0x4200000000000000000000000000000000000042', '0xA88594D404727625A9437C3f886C7643872296AE' ] │ 2798952.5961675034 │ 764206.9268831509  │ 3.5635393652136527 │        0        │ 0.81 │
└─────────┴───────────────────────────────────────────────────────┴────────────┴────────────┴──────────┴────────────────────┴──────────────────────┴─────────────────────┴──────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────┴────────────────────┴────────────────────┴────────────────────┴─────────────────┴──────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama

@slasher125 slasher125 merged commit e09be13 into DefiLlama:master Aug 14, 2024
1 check passed
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.

None yet

3 participants