Conversation
|
The adapter at projects/ggbr exports TVL: |
📝 WalkthroughWalkthroughA new TVL adapter is added for the GGBR token (gold-backed RWA stablecoin at 0x7e2ac793f3E692f388e66c7DC28F739d13B0B71A). The adapter exports a methodology description and an Ethereum TVL function that queries the token's total supply and records the result via the API. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
projects/ggbr/index.js (1)
3-6: Consider addingmisrepresentedTokens: truefor supply-based token TVL.This adapter reports issued token supply rather than on-chain collateral balances, so tagging it as misrepresented improves dashboard interpretation consistency.
Suggested change
module.exports = { + misrepresentedTokens: true, methodology:Based on learnings: adapters that add raw
totalSupplyfor directly priced vault/synthetic-like tokens usemisrepresentedTokens: true.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@projects/ggbr/index.js` around lines 3 - 6, Add the misrepresentedTokens flag to the exported adapter object to mark this TVL as supply-based (not on-chain collateral); update the top-level module.exports (the object that currently contains methodology and ethereum) to include misrepresentedTokens: true so dashboards treat the reported totalSupply-based TVL appropriately.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@projects/ggbr/index.js`:
- Around line 4-5: The methodology text currently says "in circulation" but the
implementation uses the ERC-20 totalSupply; either (A) update the methodology
string (the methodology key in projects/ggbr/index.js) to state that TVL is
based on the token's totalSupply (raw ERC-20 totalSupply) or (B) change the
implementation to compute circulating supply by subtracting known protocol-owned
addresses (treasury/locked/vesting) from the ERC-20 totalSupply (adjust the code
that calls totalSupply and add balanceOf calls for those protocol addresses),
and ensure you mirror this change in all related occurrences (lines around the
methodology and entries referenced 8-12).
---
Nitpick comments:
In `@projects/ggbr/index.js`:
- Around line 3-6: Add the misrepresentedTokens flag to the exported adapter
object to mark this TVL as supply-based (not on-chain collateral); update the
top-level module.exports (the object that currently contains methodology and
ethereum) to include misrepresentedTokens: true so dashboards treat the reported
totalSupply-based TVL appropriately.
| methodology: | ||
| "TVL represents the total supply of GGBR tokens in circulation, a gold-backed RWA stablecoin pegged at 1/1000th the value of gold.", |
There was a problem hiding this comment.
Methodology and implementation are currently measuring different things.
The text says “in circulation,” but the code uses raw ERC-20 totalSupply. If non-circulating balances exist (treasury/locked/vesting), TVL will be overstated vs your stated methodology.
Suggested minimal fix (wording aligned to code)
methodology:
- "TVL represents the total supply of GGBR tokens in circulation, a gold-backed RWA stablecoin pegged at 1/1000th the value of gold.",
+ "TVL represents the ERC-20 totalSupply of GGBR tokens, a gold-backed RWA token pegged at 1/1000th the value of gold.",Based on learnings: Protocol-owned liquidity should be excluded from TVL calculations and explained in the methodology field.
Also applies to: 8-12
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@projects/ggbr/index.js` around lines 4 - 5, The methodology text currently
says "in circulation" but the implementation uses the ERC-20 totalSupply; either
(A) update the methodology string (the methodology key in
projects/ggbr/index.js) to state that TVL is based on the token's totalSupply
(raw ERC-20 totalSupply) or (B) change the implementation to compute circulating
supply by subtracting known protocol-owned addresses (treasury/locked/vesting)
from the ERC-20 totalSupply (adjust the code that calls totalSupply and add
balanceOf calls for those protocol addresses), and ensure you mirror this change
in all related occurrences (lines around the methodology and entries referenced
8-12).
NOTE
Please enable "Allow edits by maintainers" while putting up the PR.
package-lock.jsonfile 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): GGBR
Twitter Link: https://x.com/goldfishggbr
List of audit links if any:
Website Link: https://t.co/eVPZ8PoS0W
Logo (High resolution, will be shown with rounded borders):
Current TVL:
Treasury Addresses (if the protocol has treasury)
Chain: Ethereum
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): This is a Gold-Backed Digital Asset (tokenized gold) where each token's value is precisely pegged to one one-thousandth ($1/1,000) of the current market price of one ounce of physical gold.
Token address and ticker if any: 0x7e2ac793f3E692f388e66c7DC28F739d13B0B71A (GGBR/USDT)
Category (full list at https://defillama.com/categories) *Please choose only one: RWA (commodities)
Oracle Provider(s): Specify the oracle(s) used (e.g., Chainlink, Band, API3, TWAP, etc.): TWAP
Implementation Details: Briefly describe how the oracle is integrated into your project: GGBR uses an off-chain gold price feed sourced from a metals pricing API.
The gold spot price is used to peg GGBR markets at 1/1000th the value of
one ounce of gold. The price is applied to market pairs (e.g., GGBR/USDT)
to maintain the peg. Token supply is not adjusted — the peg is maintained
through market pricing rather than a rebase mechanism.
Documentation/Proof: Provide links to documentation or any other resources that verify the oracle's usage: https://goldfishgold.com/whitepaper
forkedFrom (Does your project originate from another project): No
methodology (what is being counted as tvl, how is tvl being calculated): TVL is calculated as the total circulating supply of GGBR tokens. Each GGBR token is backed 1:1 by 1/1000th oz of physical gold. TVL represents the total value of gold-backed tokens issued on-chain.
Github org/user (Optional, if your code is open source, we can track activity):
Does this project have a referral program? No
Summary by CodeRabbit