-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Update Teller Adapter to include Lender Principal Supplied to Pools #16613
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
Update Teller Adapter to include Lender Principal Supplied to Pools #16613
Conversation
Where can users deposit to the Teller pools? On the UI at https://app.teller.org/ethereum/earn I can see around 6M$ TVL on ethereum, where the adapter returns more like 15M$ - do you know where this discrepancy comes from? |
Yes so there are two layers to Teller Protocol : the base OTC layer and the Pools layer . Th e discrepancy is due to the base OTC layer. As you can see, this adapter works the same as the one that is published to DefiLlama now, except instead of using eventlogs it uses subgraph that is scraping those same eventlogs and now it is also including lender-supplied-principal in pools . The previous iteration of the adapter didnt include that because pools didnt exist. It only tracked the OTC activity . |
Where can I find more information about the lender-supplied-principal? How are OTC layer deposits made if they arent shown on the UI? |
Hello, you can pull the full list of transactions on Etherscan, read our open source subgraph code that is powering this Adapter, or you can look on teller.org. On Teller.org, the OTC loans are a recently deprecated feature on the frontend and the majority of the OTC loans use the MASA token. We are switching all of our activity over to pools now as it is a significantly better UX for lenders. So the way this TVL is collected is using loan collaterals.
You can read the source code of our subgraph here and it has remained unchanged for a very long time, it is unchanged compared to how it functioned with our currently published DefiLlama adapter. Furthermore, the way that the subgraph collects this data is the same as the way the currently published DefiLlama collected it using EventLogs. The only significant change that this new adapter makes, mathematically, is now it includes principal supplied by lenders in pools as TVL. It includes total collateral deposited by borrowers the same as it did before and by running a test on the previous adapter and this new adapter I proved that this is true; the number is the same. |
This PR updates the Teller Protocol adapter to use Subgraphs for scraping data instead of using getLogs. It computes TVL and Borrowed in the same way, except for the TVL computation, it now also includes principal that lenders have supplied in to the new Teller Pools. When this Adapter was originally created, Teller Pools did not exist; Teller only allowed users to create 1:1 OTC loans with one another. Since Teller Pools now make up a majority of activity on the protocol, it makes sense to track and include lender supplied principal for these pools on DefiLlama now.