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

Update giveth adapter.js #13631

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Update giveth adapter.js #13631

wants to merge 2 commits into from

Conversation

wmb81321
Copy link

  • Adding token addreses for Optimis, Polygon ZKEVM, and Solana.
  • Adding module.exports for optimism, Polygon ZKEVM, SOlana.
  • Adding Contract Addreses for staking and pool asyncfunctions for Gnosis, Optimism, Polygon ZKEVM and Solana.

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):

- Adding token addreses for Optimis, Polygon ZKEVM, and Solana.
- Adding module.exports for optimism, Polygon ZKEVM, SOlana.
- Adding Contract Addreses for staking and pool asyncfunctions for Gnosis, Optimism, Polygon ZKEVM and Solana.
@llamabutler
Copy link

The adapter at projects/giveth exports TVL:

solana                    367.33 M
staking                   856.75 k
optimism-staking          449.88 k
xdai-staking              335.77 k
pool2                     114.94 k
polygon_zkevm-staking     69.72 k
optimism                  54.50 k
optimism-pool2            54.50 k
xdai-pool2                24.47 k
xdai                      24.47 k
ethereum-pool2            19.02 k
ethereum                  19.02 k
polygon_zkevm             16.95 k
polygon_zkevm-pool2       16.95 k
ethereum-staking          1.38 k

total                    367.45 M 

Copy link
Member

@g1nt0ki g1nt0ki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[GIV, "0xc3151A58d519B94E915f66B044De3E55F77c2dd9"], // Angel Vault
[GIV, "0x7819f1532c49388106f7762328c51ee70edd134c"], // GIV / ETH Balancer
[GIV, "0x6873789a71b18efa98a8e8758a5ea456d70c178f"], // FOX/GIV - Balancer - Owned by Giveth DAO
[GIV, "0xc763b6b3d0f75167db95daa6a0a0d75dd467c4e1"], // GIV / WETH - Uniswap V3 - Owned by Giveth DAO
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, this is wrong, should have been caught in the previous PR, only staked LP token is counted as pool2, your token locked in dex belongs to dex tvl not yours

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@g1nt0ki could you clarify me which CAs we have to write down on each function please?

async functions on Adapter

  • staking[chain] - we are leaving the contracts where community do Liquidity mining in our GIVfarms on Gnosis, Optimism and Polygon ZKEVm.
async function stakingOptimism() {
  const balance = await sumUnknownTokens({
    owners: {
  • pool[chain] - we are using all the liquidity pools, owned and not owned.
async function poolOptimism() {
  const balance = await sumUnknownTokens({
    owners: [

Treasury

When you mentioned that owned liqudiity must be treasury , where we have to send a PR to add these LPs?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can update the adapter to something like this: https://github.com/DefiLlama/DefiLlama-Adapters/blob/main/projects/mobox.js

staking - for gov token staking
pool2 - for lps staked in your farm

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@g1nt0ki i left me give a littile context about how GIV token works in our farms and maybe clarify better the update of this adapter:

GIV TOKEN

Users can get GIV token on across OP, Polzkevm, Gnosis, Mainnet, solana. These are the CAs of our token across those chains:

GIV token is not a Governance token itself but it could become a governance token once users STAKE the GIV token in our GIVfarm. Currenlty, the stake is allowed on Gnosis, Optimism and Polygon ZKEVM.

GIVPOWER

When users STAKE the GIV token they get Rewards on GIV token and Voting power represented by GIVpower, the governance token. There are a relation 1:1 between GIVpower and GIVtoken. Following are the CAs of GIVpower in each chain:

Nevertherles, users can INCREASE their rewards and their Governance token when they LOCK. More time locked, more "multiplier" for their rewards and voting power (GIVpower). Users can do this in the GIVfarm and It's allowed only when they have GIV staked.

This GIVpower have 3 Main utilities:

  • GIVpower holders can use their GIVpower to "improve" the listing of the projects our donation platform: https://giveth.io/es/projects/all
  • These GIVpower "back-up" increase the oods of the donors of the project to win the raffle of our GIVbacks Program. These raflle plays each 15 days until Dec 2026.
  • Voting Power in our snapshot: https://snapshot.box/#/s:giv.eth

Liquidity Pools

Giveth have built Liquidity pools across these chains to allow the price discovery. Some of these liquidity are owned by the DAO and some are owned by the partner or community.

Liquidity Pools owned by Giveth: / i will update this in the treasury

Liquidity Pools not owned by Giveth

Copy link
Author

@wmb81321 wmb81321 Mar 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, @g1nt0ki,

For Staking Function, in the PR we have the Addreses for our Gov staking contracs, which are the following by each chain:

  • Mainnet: 0x4B9EfAE862a1755F7CEcb021856D467E86976755
  • Gnosis: 0x24F2d06446AF8D6E89fEbC205e7936a602a87b60
  • Optimis: 0x301C739CF6bfb6B47A74878BdEB13f92F13Ae5E7 / added on this PR
  • Polygon ZKEVM: 0xc790f82bf6f8709aa4a56dc11afad7af7c2a9867 / Added on this PR
  • solana: We dont have any contract for gov staking on Solana.

For Pool Function, i have to change the LPs owned by giveth fpr the LPs not owned by Giveth? I know that i have to add the owned LPs here: Adapter of treasury for Giveth.

Have in mind that all our LPs are open to participate by anyone. We have some of those liquidity pools in our last PR and i'm just adding new LPs that were not in the last PR.

async function poolOptimism() {
const balance = await sumUnknownTokens({
owners: [
"0xc2ab457e31c224da284df7afda70c39523df4972", // OP - Velodrome - Owned By Giveth DAO
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LPs owned by the dao counts as treasury not tvl

@g1nt0ki g1nt0ki self-assigned this Feb 22, 2025
@llamabutler
Copy link

The adapter at projects/giveth exports TVL:

solana                    324.28 M
staking                   704.18 k
optimism-staking          369.89 k
xdai-staking              273.80 k
pool2                     93.25 k
polygon_zkevm-staking     59.37 k
optimism                  46.03 k
optimism-pool2            46.03 k
xdai-pool2                20.21 k
xdai                      20.21 k
ethereum                  15.38 k
ethereum-pool2            15.38 k
polygon_zkevm-pool2       11.62 k
polygon_zkevm             11.62 k
ethereum-staking          1.12 k

total                    324.37 M 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants