DefiLlama / yield-server

140 stars 779 forks source link

update tvl amount for lending pools #1486

Closed 0xKMG closed 1 month ago

0xKMG commented 1 month ago

We choose to include the borrowed amount in lending pool in the calculation for the yield tab. To avoid double-counting, any further update for strategy's tvl will deduce the borrowed amount accordingly (as calculated in DefiLlama-Adapters).

llamatester commented 1 month ago

The vaultka adapter exports pools:

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

Nb of pools: 2

Sample pools:
┌─────────┬────────────────────────────────────────────────┬──────────┬───────────┬────────┬────────────────────────────────────────────────────┬───────────────────────────────┬───────────────────┬───────────────────┬───────────────────┐
│ (index) │                      pool                      │  chain   │  project  │ symbol │                  underlyingTokens                  │              url              │      apyBase      │      tvlUsd       │  totalBorrowUsd   │
├─────────┼────────────────────────────────────────────────┼──────────┼───────────┼────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┼───────────────────┼───────────────────┤
│    0    │ 'nKMLJtN1rr64K9DjmfzXvzaq4JEy5a4AJHHP9gY1dW6'  │ 'Solana' │ 'vaultka' │ 'USDC' │ [ 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB' ] │ 'https://solana.vaultka.com/' │       25.02       │ 5557978.179449907 │ 926994.6048682334 │
│    1    │ 'DMhoXyVNpCFeCEfEjEQfS6gzAEcPUUSXM8Xnd2UXJfiS' │ 'Solana' │ 'vaultka' │ 'SOL'  │ [ 'So11111111111111111111111111111111111111112' ]  │ 'https://solana.vaultka.com/' │ 13.05576923076923 │ 665324.8225907517 │ 606013.8103137923 │
└─────────┴────────────────────────────────────────────────┴──────────┴───────────┴────────┴────────────────────────────────────────────────────┴───────────────────────────────┴───────────────────┴───────────────────┴───────────────────┘
llamatester commented 1 month ago

The vaultka adapter exports pools:

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

Nb of pools: 2

Sample pools:
┌─────────┬────────────────────────────────────────────────┬──────────┬───────────┬────────┬────────────────────────────────────────────────────┬───────────────────────────────┬────────────────────┬────────────────────┬────────────────────┐
│ (index) │                      pool                      │  chain   │  project  │ symbol │                  underlyingTokens                  │              url              │      apyBase       │       tvlUsd       │   totalBorrowUsd   │
├─────────┼────────────────────────────────────────────────┼──────────┼───────────┼────────┼────────────────────────────────────────────────────┼───────────────────────────────┼────────────────────┼────────────────────┼────────────────────┤
│    0    │ 'nKMLJtN1rr64K9DjmfzXvzaq4JEy5a4AJHHP9gY1dW6'  │ 'Solana' │ 'vaultka' │ 'USDC' │ [ 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB' ] │ 'https://solana.vaultka.com/' │ 25.088748509782484 │ 5500018.325389746  │ 863086.4430776183  │
│    1    │ 'DMhoXyVNpCFeCEfEjEQfS6gzAEcPUUSXM8Xnd2UXJfiS' │ 'Solana' │ 'vaultka' │ 'SOL'  │ [ 'So11111111111111111111111111111111111111112' ]  │ 'https://solana.vaultka.com/' │ 13.055769230769233 │ 271854.70334105066 │ 271830.39597691235 │
└─────────┴────────────────────────────────────────────────┴──────────┴───────────┴────────┴────────────────────────────────────────────────────┴───────────────────────────────┴────────────────────┴────────────────────┴────────────────────┘
slasher125 commented 1 month ago

gm @0xKMG just checking against ur ui, eg for USDC you report totalBorrowUsd of $4.8M vs $863k here. also, just to confirm: tvlUsd = available liquiidty = totalSupplyUsd - totalBorrowUsd

0xKMG commented 1 month ago

@slasher125 Thanks for your reply. I was hoping to clarify if the tvlUsd can equal totalSupplyUsd. I understand that DefiLlama has rules to avoid double counting TVL on both the lending and borrowing sides. However, our team believes it would be more accurate to display the TVL on the lending side. (On our strategy side, the borrowed amount will be subtracted.) The reasoning is that, as a yield aggregator, unlike a lending protocol, our utilization rate is usually very high, sometimes up to 100%. It could be confusing and somewhat misleading to users if the lending TVL always appears as 0. Please rest assured that we avoid any double counting in the DefiLlama Adapters and choose not to include the TVL information from the strategy at the moment.

slasher125 commented 1 month ago

ok, i'm gonna make exception here given its on our yield category