feat: create DefiLlama adapter to measure TVL #190
Labels
documentation
Improvements or additions to documentation
enhancement
New feature or request
Hot Task
Doubled points in the reward table
Feature Request
Describe the Feature Request
We want to have our project listed on DefiLlama. They provide an extensive tutorial on how to create adapters for such features on this link.
1- Fork the Adapters repo (button towards the top right of the repo page).
2- Add a new folder with the same name as the project to projects/.
3- Write an SDK adapter in the new folder.
4- Make a Pull Request with the changes on your fork, to the main DefiLlama Adapters repo, with a brief explanation of what you changed.
5- Wait for someone to either comment on or merge your Pull Request. There is no need to ask for someone to check your PR as there a monitored regularly.
6- Once your PR has been merged, please give 24 hours for the front-end team to load your listing onto the UI.
7- If protocol is already listed and you want to add a new product/version, just make a new adapter and submit a PR. DefiLlama team will make the necessary changes afterwards (adding all protocols under a parent listing).
Describe Preferred Solution
Following the above tutorial will fulfill this task.
The differential that we are looking for in Swaplace is not TVL, but rather:
Offers - funds that are approved for spending on a non-custodial platform, but not deposited into the platform contracts
Since Swaplace operates on approvals, we can only measure the total value of tokens that the contract has in approvals. So let's say Jhon approved $1000 to Swaplace contract. We must build our adapter to measure such approved funds and sum them as a total approved value to become the TVL of Swaplace.
Additional Context
The question I raise is: Most people will approve type(uint256).max, and this will be considered an infinite money glitch. So my question is... Can we detect approvals to the contract, then call
balanceOf
on that user to see how much he really does have that is negotiable? Can we push the adapters of DefiLlama to such feat?Another question I'm raising is about the NFTs floor prices, can we measure them? Using approvals just like mentioned above?
The text was updated successfully, but these errors were encountered: