-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
base: main
Are you sure you want to change the base?
Update giveth adapter.js #13631
Conversation
- 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.
The adapter at projects/giveth exports TVL:
|
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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:
- Mainnet 0x900db999074d9277c5da2a43f252d74366230da0,
- Optimism: 0x528cdc92eab044e1e39fe43b9514bfdab4412b98
- Gnosis: 0x4f4f9b8d5b4d0dc10506e5551b0513b61fd59e75,
- Polygon ZKEVM: 0xddafb91475bbf6210a151fa911ac8fda7de46ec2.
- Solana: 3Xi3EhKjnKAk2KTChzybUSWcLW6eAgTHyotHH1U6sJE1
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:
- Optimism: 0x301c739cf6bfb6b47a74878bdeb13f92f13ae5e7
- Gnosis: 0xd93d3bdba18ebcb3317a57119ea44ed2cf41c2f2
- Polygon ZKEVM: 0xc790f82bf6f8709aa4a56dc11afad7af7c2a9867
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
- Solana E7yVYRW2HZVXcreRE2asLs4HmtyviGbnnTXTarj7uDjc SOL
- Polygon ZKEVM 0x50f99d234872d99e4324bd287c50da3317cb3473 POL
- Optimism 0x165E6DAD9772C8CB44015eDD5bd8b012A84bd276 USDGLO
- Optimism 0x969e1D236289742C9D36eA1c7124cdDb84397772 DAI
- Optimism 0xaac7d612c1f23a45967f772ea587963952cc0b80 TEC
- Optimism 0xc2ab457e31c224da284df7afda70c39523df4972 OP
- Mainnet 0x6873789a71b18efa98a8e8758a5ea456d70c178f FOX
- Mainnet 0xc763b6b3d0f75167db95daa6a0a0d75dd467c4e1 WETH
- Gnosis 0xbf945292dc5cbbc8b742083f87d502699cb27414 GNO
- Gnosis 0x85dc9beb2571298c9197ec16fafa556a85e41eae BRIGHT
- Gnosis 0x08ea9f608656a4a775ef73f5b187a2f1ae2ae10e HNY
Liquidity Pools not owned by Giveth
- Polygon ZKEVM 0x30c99b07271d9a7143c324f04c77642262380c88 WETH
- Mainnet 0x7819f1532c49388106f7762328c51eE70EdD134c WETH
- Gnosis 0xdccAa73705dC7457bcfb3dAFEe529B30920e3008 GNO
- Gnosis 0xb7189a7ea38fa31210a79fe282aec5736ad5fa57 xDAI
- Gnosis 0x75594f01da2e4231e16e67f841c307c4df2313d1 FOX
- Gnosis 0x55ff0cef43f0df88226e9d87d09fa036017f5586 WETH
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, @g1nt0ki,
- Having in mind your feedback and the context i gave you of GIV token
- seeing the PR 3839
- And based on the code of our last index.js
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 |
There was a problem hiding this comment.
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
The adapter at projects/giveth exports TVL:
|
NOTE
Please enable "Allow edits by maintainers" while putting up the PR.
package-lock.json
file as part of your changes, we use lockfileVersion 2, and most use v1 and using that messes up our CIName (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):