Skip to content
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

feat: create DefiLlama adapter to measure TVL #190

Open
0xneves opened this issue Feb 2, 2024 · 3 comments
Open

feat: create DefiLlama adapter to measure TVL #190

0xneves opened this issue Feb 2, 2024 · 3 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request Hot Task Doubled points in the reward table

Comments

@0xneves
Copy link
Contributor

0xneves commented Feb 2, 2024

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?

@0xneves 0xneves added enhancement New feature or request Hot Task Doubled points in the reward table labels Feb 2, 2024
@0xneves 0xneves added this to Swaplace Feb 2, 2024
@0xneves 0xneves changed the title feat: feat: create DefiLlama adapter to measure TVL Feb 2, 2024
@0xneves 0xneves moved this to 🔖 TODO in Swaplace Feb 2, 2024
@0xjoaovpsantos
Copy link
Contributor

Working on it @0xneves :)

@0xneves
Copy link
Contributor Author

0xneves commented Feb 2, 2024

Working on it @0xneves :)

Wow, descending from the heavens

@0xneves 0xneves added the documentation Improvements or additions to documentation label Feb 28, 2024
@0xneves 0xneves moved this from 🔖 TODO to 🛠️ In Progress in Swaplace Mar 13, 2024
@RafaDSan
Copy link
Contributor

Hello, @0xjoaovpsantos ! How is this task going?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request Hot Task Doubled points in the reward table
Projects
Status: 🛠️ In Progress
Development

No branches or pull requests

3 participants