DefiLlama / DefiLlama-Adapters

861 stars 4.92k forks source link

update untangled tvl and borrowed #11089

Closed tanpx12 closed 1 month ago

tanpx12 commented 1 month ago

NOTE

Please enable "Allow edits by maintainers" while putting up the PR.


  • If you would like to add a volume adapter please submit the PR here.
  • If you would like to add a liquidations adapter, please refer to this readme document for details.
  1. Once your adapter has been merged, it takes time to show on the UI. If more than 24 hours have passed, please let us know in Discord.
  2. Sorry, We no longer accept fetch adapter for new projects, we prefer the tvl to computed from blockchain data, if you have trouble with creating a the adapter, please hop onto our discord, we are happy to assist you.
  3. Please fill the form below only if the PR is for listing a new protocol else it can be ignored/replaced with reason/details about the PR
  4. For updating listing info It is a different repo, you can find your listing in this file: https://github.com/DefiLlama/defillama-server/blob/master/defi/src/protocols/data2.ts, you can edit it there and put up a PR
  5. Do not edit/push package-lock.json file as part of your changes, we use lockfileVersion 2, and most use v1 and using that messes up our CI
  6. No need to go to our discord and announce that you've created a PR, we monitor all PRs and will review it asap

Name (to be shown on DefiLlama):
Twitter Link:
List of audit links if any:
Website Link:
Logo (High resolution, will be shown with rounded borders):
Current TVL:
Treasury Addresses (if the protocol has treasury)
Chain:
Coingecko ID (so your TVL can appear on Coingecko, leave empty if not listed): (https://api.coingecko.com/api/v3/coins/list)
Coinmarketcap ID (so your TVL can appear on Coinmarketcap, leave empty if not listed): (https://api.coinmarketcap.com/data-api/v3/map/all?listing_status=active,inactive,untracked&start=1&limit=10000)
Short Description (to be shown on DefiLlama):
Token address and ticker if any:
Category (full list at https://defillama.com/categories) *Please choose only one:
Oracle Provider(s): Specify the oracle(s) used (e.g., Chainlink, Band, API3, TWAP, etc.):
Implementation Details: Briefly describe how the oracle is integrated into your project:
Documentation/Proof: Provide links to documentation or any other resources that verify the oracle's usage:
forkedFrom (Does your project originate from another project):
methodology (what is being counted as tvl, how is tvl being calculated):
Github org/user (Optional, if your code is open source, we can track activity):
llamatester commented 1 month ago

The adapter at projects/untangled exports TVL:

celo                      255.86 k
celo-borrowed             255.83 k
borrowed                  255.83 k

total                    255.86 k 
g1nt0ki commented 1 month ago

hi, think there was a mistake in the original adapter, tvl should be value not yet lent out, that is not the case here?

tanpx12 commented 1 month ago

Hi, we have a different approach for the TVL value. We define TVL as the value of the pool value which includes the collateral value and its available reserve. So that is why we need this update.

g1nt0ki commented 1 month ago

atm, there is an on chain collateral + reserve of 255k? can you share the contract where it is locked?

tanpx12 commented 1 month ago

Our pool instance address is 0x4f60444be7c10946b1b8d20032a7076357d6c5aa. You can see a NFT called Loan Asset Token which represent the real world asset that the borrower have deposited as collateral in the pool. The pool reserve is kept in a multisig wallet (0x5b7BA6471681C61b4994dC5072B0D0C0fFad4A2b), you can check the reserve value in this address.

Pool Instance: https://celoscan.io/address/0x4f60444be7c10946b1b8d20032a7076357d6c5aa Loan Asset Token mint: https://celoscan.io/address/0x4f60444be7c10946b1b8d20032a7076357d6c5aa#nfttransfers Pot wallet: https://celoscan.io/address/0x5b7ba6471681c61b4994dc5072b0d0c0ffad4a2b

g1nt0ki commented 1 month ago

sorry, unsure how this slipped through, for similar (rwa) lending protocols, we treat only on chain collateral as tvl, sorry, we cant make an exception here.

Can you update code to, count only tokens not yet lent out as tvl?

untangled-finance commented 1 month ago

Hi @g1nt0ki our protocol is very comparable to Centrifuge - You can see from CFG page here https://defillama.com/protocol/centrifuge their TVL" The pool value is made up of the NAV (the value of the assets in the pool) and the Pool Reserve (undeployed capital in the pool). "

In our case, as in the case of CFG, on chain collaterals consist of NFTs which are the financings in the pool

g1nt0ki commented 1 month ago

yes, in centrifuge, we are counting only the tokens not yet lent out as tvl. The difference here, you are asking use NFT value as tvl, we can not do that as there is no independent way for us/the market to verify the NFT valuation. We said the same thing to Joltify recently: https://defillama.com/protocol/joltify-rwa#information

untangled-finance commented 1 month ago

Actually in centrifuge you counted both

In the case of Untangled the TVL only counts reserve.

We should have the same way of reporting as in CFG for consistency and accuracy

I have recorded a video for ease of reference @g1nt0ki @tanpx12 https://jam.dev/c/b40121da-9f9c-448b-a420-3d008d7d7c7f

untangled-finance commented 1 month ago

In fact in your example https://defillama.com/protocol/joltify-rwa#information - TVL is treated the same way as centrifuge - so only Untangled is currently incorrect 'borrowed' TVL

g1nt0ki commented 1 month ago

In fact in your example https://defillama.com/protocol/joltify-rwa#information - TVL is treated the same way as centrifuge - so only Untangled is currently incorrect 'borrowed' TVL

what are you talking about, in your PR you are counting the same thing in both tvl and borrowed. We are perfectly fine showing the borrowed value

untangled-finance commented 1 month ago

Thanks. @tanpx12 please update the PR for the borrowed so we are consistent with both cases above

llamatester commented 1 month ago

The adapter at projects/untangled exports TVL:

celo-borrowed             255.87 k
borrowed                  255.87 k
celo                      31

total                    30.99809611206 
tanpx12 commented 1 month ago

I've just updated the TVL back to the old one. Pls check.

g1nt0ki commented 1 month ago

@tanpx12 thanks, this is mostly good, but I still dont understand where the 30$ comes from, this is supposed to be the reserves left in the pot/pools? but also, how to get a pot linked to a pool, and the pot is a safe wallet? (Sorry for all the questions)

tanpx12 commented 1 month ago

This 30$ is from some of our pilot pools. So before launching an actual pool, we create some pilot pools to test on mainnet and these pools are still recorded in the list of the pool that we have launched. The pot wallet is a multisig wallet that hold the reserve of the pool.