DefiLlama / yield-server

140 stars 779 forks source link

Feature(umami-finance): Add support for avax vaults #1446

Closed Clonescody closed 2 months ago

Clonescody commented 2 months ago

Umami Finance recently launched USDC & WETH vaults on Avalanche (only Arbitrum before)

This PR adds support for both new vaults, and refactors most of the code in order to have a chain-based logic as well as a more readable code overall.

The logic to get underlying GM markets APRs also has been updated to match our current UI (and GMX's).

Note: both avax vaults have <10k TVL right now we're aware

llamatester commented 2 months ago

The umami-finance adapter exports pools:

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

Nb of pools: 6

Sample pools:
┌─────────┬──────────────────────────────────────────────┬────────────────────┬─────────┬─────────────────┬──────────────────────────────────────────────────┬────────────────────────────────────────────────────┬───────────┬──────────────────────────────────────────────────┬─────────────┬─────────────────┐
│ (index) │                     pool                     │       tvlUsd       │ apyBase │     symbol      │                 underlyingTokens                 │                        url                         │ apyReward │                   rewardTokens                   │    chain    │     project     │
├─────────┼──────────────────────────────────────────────┼────────────────────┼─────────┼─────────────────┼──────────────────────────────────────────────────┼────────────────────────────────────────────────────┼───────────┼──────────────────────────────────────────────────┼─────────────┼─────────────────┤
│    0    │ '0xcd8011aab161a75058eab24e0965bab0b918af29' │  4767132.9711069   │   11    │    'gmWBTC'     │ [ '0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f' ] │      'https://umami.finance/vaults/gm/gmwbtc'      │   2.29    │ [ '0x912ce59144191c1204e64559fe8253a0e49e6548' ] │ 'Arbitrum'  │ 'umami-finance' │
│    1    │ '0x5f851f67d24419982ecd7b7765defd64fbb50a97' │ 3686837.0661197947 │   11    │ 'gmUSDC (wBTC)' │ [ '0xaf88d065e77c8cc2239327c5edb3a432268e5831' ] │      'https://umami.finance/vaults/gm/gmusdc'      │   11.63   │ [ '0x912ce59144191c1204e64559fe8253a0e49e6548' ] │ 'Arbitrum'  │ 'umami-finance' │
│    2    │ '0x4bca8d73561aaeee2d3a584b9f4665310de1dd69' │ 3596316.272769725  │  8.73   │    'gmWETH'     │ [ '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1' ] │ 'https://umami.finance/vaults/arbitrum/gm/gmweth'  │   3.64    │ [ '0x912ce59144191c1204e64559fe8253a0e49e6548' ] │ 'Arbitrum'  │ 'umami-finance' │
│    3    │ '0x959f3807f0aa7921e18c78b00b2819ba91e52fef' │ 3486811.3408438573 │  8.73   │    'gmUSDC'     │ [ '0xaf88d065e77c8cc2239327c5edb3a432268e5831' ] │ 'https://umami.finance/vaults/arbitrum/gm/gmusdc'  │   10.07   │ [ '0x912ce59144191c1204e64559fe8253a0e49e6548' ] │ 'Arbitrum'  │ 'umami-finance' │
│    4    │ '0x4f3274c3889e6cd54c9c739757ab8ea4b246d76b' │ 1840.2826044367441 │   10    │    'gmUSDC'     │ [ '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e' ] │ 'https://umami.finance/vaults/gm/avax_gmusdc_weth' │           │                                                  │ 'Avalanche' │ 'umami-finance' │
│    5    │ '0xfce0a462585a422bac0ca443b102d0ac1ff20f9e' │ 929.3463802363127  │   10    │    'gmWETH'     │ [ '0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab' ] │   'https://umami.finance/vaults/gm/avax_gmweth'    │           │                                                  │ 'Avalanche' │ 'umami-finance' │
└─────────┴──────────────────────────────────────────────┴────────────────────┴─────────┴─────────────────┴──────────────────────────────────────────────────┴────────────────────────────────────────────────────┴───────────┴──────────────────────────────────────────────────┴─────────────┴─────────────────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama
llamatester commented 2 months ago

The umami-finance adapter exports pools:

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

Nb of pools: 6

Sample pools:
┌─────────┬──────────────────────────────────────────────┬────────────────────┬─────────┬─────────────────┬──────────────────────────────────────────────────┬────────────────────────────────────────────────────┬───────────┬──────────────────────────────────────────────────┬─────────────┬─────────────────┐
│ (index) │                     pool                     │       tvlUsd       │ apyBase │     symbol      │                 underlyingTokens                 │                        url                         │ apyReward │                   rewardTokens                   │    chain    │     project     │
├─────────┼──────────────────────────────────────────────┼────────────────────┼─────────┼─────────────────┼──────────────────────────────────────────────────┼────────────────────────────────────────────────────┼───────────┼──────────────────────────────────────────────────┼─────────────┼─────────────────┤
│    0    │ '0xcd8011aab161a75058eab24e0965bab0b918af29' │  4768322.03363147  │   11    │    'gmWBTC'     │ [ '0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f' ] │      'https://umami.finance/vaults/gm/gmwbtc'      │   2.29    │ [ '0x912ce59144191c1204e64559fe8253a0e49e6548' ] │ 'Arbitrum'  │ 'umami-finance' │
│    1    │ '0x5f851f67d24419982ecd7b7765defd64fbb50a97' │ 3686837.170829404  │   11    │ 'gmUSDC (wBTC)' │ [ '0xaf88d065e77c8cc2239327c5edb3a432268e5831' ] │      'https://umami.finance/vaults/gm/gmusdc'      │   11.65   │ [ '0x912ce59144191c1204e64559fe8253a0e49e6548' ] │ 'Arbitrum'  │ 'umami-finance' │
│    2    │ '0x4bca8d73561aaeee2d3a584b9f4665310de1dd69' │ 3603809.9506943487 │  8.73   │    'gmWETH'     │ [ '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1' ] │ 'https://umami.finance/vaults/arbitrum/gm/gmweth'  │   3.64    │ [ '0x912ce59144191c1204e64559fe8253a0e49e6548' ] │ 'Arbitrum'  │ 'umami-finance' │
│    3    │ '0x959f3807f0aa7921e18c78b00b2819ba91e52fef' │ 3486817.3506186786 │  8.73   │    'gmUSDC'     │ [ '0xaf88d065e77c8cc2239327c5edb3a432268e5831' ] │ 'https://umami.finance/vaults/arbitrum/gm/gmusdc'  │   10.08   │ [ '0x912ce59144191c1204e64559fe8253a0e49e6548' ] │ 'Arbitrum'  │ 'umami-finance' │
│    4    │ '0x4f3274c3889e6cd54c9c739757ab8ea4b246d76b' │  1839.52441850463  │   10    │    'gmUSDC'     │ [ '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e' ] │ 'https://umami.finance/vaults/gm/avax_gmusdc_weth' │           │                                                  │ 'Avalanche' │ 'umami-finance' │
│    5    │ '0xfce0a462585a422bac0ca443b102d0ac1ff20f9e' │ 929.3464076094026  │   10    │    'gmWETH'     │ [ '0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab' ] │   'https://umami.finance/vaults/gm/avax_gmweth'    │           │                                                  │ 'Avalanche' │ 'umami-finance' │
└─────────┴──────────────────────────────────────────────┴────────────────────┴─────────┴─────────────────┴──────────────────────────────────────────────────┴────────────────────────────────────────────────────┴───────────┴──────────────────────────────────────────────────┴─────────────┴─────────────────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama
llamatester commented 2 months ago

The umami-finance adapter exports pools:

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

Nb of pools: 6

Sample pools:
┌─────────┬──────────────────────────────────────────────┬────────────────────┬─────────┬─────────────────┬──────────────────────────────────────────────────┬────────────────────────────────────────────────────────┬───────────┬──────────────────────────────────────────────────┬─────────────┬─────────────────┐
│ (index) │                     pool                     │       tvlUsd       │ apyBase │     symbol      │                 underlyingTokens                 │                          url                           │ apyReward │                   rewardTokens                   │    chain    │     project     │
├─────────┼──────────────────────────────────────────────┼────────────────────┼─────────┼─────────────────┼──────────────────────────────────────────────────┼────────────────────────────────────────────────────────┼───────────┼──────────────────────────────────────────────────┼─────────────┼─────────────────┤
│    0    │ '0xcd8011aab161a75058eab24e0965bab0b918af29' │ 4767190.3983681295 │   11    │    'gmWBTC'     │ [ '0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f' ] │   'https://umami.finance/vaults/arbitrum/gm/gmwbtc'    │   2.29    │ [ '0x912ce59144191c1204e64559fe8253a0e49e6548' ] │ 'Arbitrum'  │ 'umami-finance' │
│    1    │ '0x5f851f67d24419982ecd7b7765defd64fbb50a97' │ 3686819.2187350392 │   11    │ 'gmUSDC (wBTC)' │ [ '0xaf88d065e77c8cc2239327c5edb3a432268e5831' ] │ 'https://umami.finance/vaults/arbitrum/gm/gmusdc_wbtc' │   11.63   │ [ '0x912ce59144191c1204e64559fe8253a0e49e6548' ] │ 'Arbitrum'  │ 'umami-finance' │
│    2    │ '0x4bca8d73561aaeee2d3a584b9f4665310de1dd69' │ 3595787.9662961285 │  8.73   │    'gmWETH'     │ [ '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1' ] │   'https://umami.finance/vaults/arbitrum/gm/gmweth'    │   3.64    │ [ '0x912ce59144191c1204e64559fe8253a0e49e6548' ] │ 'Arbitrum'  │ 'umami-finance' │
│    3    │ '0x959f3807f0aa7921e18c78b00b2819ba91e52fef' │ 3486638.3167371145 │  8.73   │    'gmUSDC'     │ [ '0xaf88d065e77c8cc2239327c5edb3a432268e5831' ] │   'https://umami.finance/vaults/arbitrum/gm/gmusdc'    │   10.07   │ [ '0x912ce59144191c1204e64559fe8253a0e49e6548' ] │ 'Arbitrum'  │ 'umami-finance' │
│    4    │ '0x4f3274c3889e6cd54c9c739757ab8ea4b246d76b' │ 1838.9478335755118 │   11    │    'gmUSDC'     │ [ '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e' ] │     'https://umami.finance/vaults/avax/gm/gmusdc'      │           │                                                  │ 'Avalanche' │ 'umami-finance' │
│    5    │ '0xfce0a462585a422bac0ca443b102d0ac1ff20f9e' │ 929.4167748714818  │   11    │    'gmWETH'     │ [ '0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab' ] │     'https://umami.finance/vaults/avax/gm/gmweth'      │           │                                                  │ 'Avalanche' │ 'umami-finance' │
└─────────┴──────────────────────────────────────────────┴────────────────────┴─────────┴─────────────────┴──────────────────────────────────────────────────┴────────────────────────────────────────────────────────┴───────────┴──────────────────────────────────────────────────┴─────────────┴─────────────────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama