Cronos Gangsters - Leverage Trading DEX on Cronos#18711
Cronos Gangsters - Leverage Trading DEX on Cronos#18711kingautomotive189a-spec wants to merge 1 commit intoDefiLlama:mainfrom
Conversation
📝 WalkthroughWalkthroughA new TVL calculator module for Cronos Gangsters has been added, which tracks GANG tokens locked in the project's staking and competition contracts by summing token balances across two specified contract addresses. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 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)
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/cronos-gangsters/index.js (1)
9-10: Add comments to document contract purposes.Consider adding inline comments to document what each owner address represents for maintainability:
📝 Suggested documentation improvement
owners: [ - '0x2099ad49329909FDb620714D01F5A74D57CDeE0C', - '0xe546C82f0CedE3341dC402626923A6D4b95234Ee', + '0x2099ad49329909FDb620714D01F5A74D57CDeE0C', // Staking contract + '0xe546C82f0CedE3341dC402626923A6D4b95234Ee', // Competition contract ],🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@projects/cronos-gangsters/index.js` around lines 9 - 10, The owner addresses in the array (e.g., '0x2099ad49329909FDb620714D01F5A74D57CDeE0C', '0xe546C82f0CedE3341dC402626923A6D4b95234Ee') lack inline documentation; update the array in projects/cronos-gangsters/index.js by adding concise comments next to each address explaining the role/purpose (e.g., deployer, multisig, treasury, verifier) and, if applicable, reference the contract or team name that owns it so future maintainers can quickly understand why each address is present.
🤖 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/cronos-gangsters/index.js`:
- Around line 5-14: The export currently assigns the two owner addresses and
GANG_TOKEN to the cronos.tvl export; change this to a cronos.staking export by
replacing the tvl key with staking and keeping the sumTokensExport({...}) call
(referencing module.exports, cronos, tvl -> staking, sumTokensExport, GANG_TOKEN
and the two owner addresses '0x2099...DeE0C' and '0xe546C8...234Ee'); also add a
methodology string clarifying that staking counts GANG tokens locked in Cronos
Gangsters staking and competition contracts.
---
Nitpick comments:
In `@projects/cronos-gangsters/index.js`:
- Around line 9-10: The owner addresses in the array (e.g.,
'0x2099ad49329909FDb620714D01F5A74D57CDeE0C',
'0xe546C82f0CedE3341dC402626923A6D4b95234Ee') lack inline documentation; update
the array in projects/cronos-gangsters/index.js by adding concise comments next
to each address explaining the role/purpose (e.g., deployer, multisig, treasury,
verifier) and, if applicable, reference the contract or team name that owns it
so future maintainers can quickly understand why each address is present.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2d45db2a-c1a7-4822-8418-1197f076a8bc
📒 Files selected for processing (1)
projects/cronos-gangsters/index.js
| module.exports = { | ||
| cronos: { | ||
| tvl: sumTokensExport({ | ||
| owners: [ | ||
| '0x2099ad49329909FDb620714D01F5A74D57CDeE0C', | ||
| '0xe546C82f0CedE3341dC402626923A6D4b95234Ee', | ||
| ], | ||
| tokens: [GANG_TOKEN], | ||
| }), | ||
| }, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify the nature of the owner contracts and check for DEX-related contracts
echo "=== Checking owner contract addresses on Cronos blockchain ==="
echo "Owner 1: 0x2099ad49329909FDb620714D01F5A74D57CDeE0C"
echo "Owner 2: 0xe546C82f0CedE3341dC402626923A6D4b95234Ee"
echo ""
echo "Please verify via Cronos explorer (cronoscan.com):"
echo "1. Are these contracts staking/rewards contracts?"
echo "2. Do they hold GANG tokens for staking/farming purposes?"
echo "3. Are there additional contracts for DEX liquidity (trading pools, collateral vaults)?"
echo ""
echo "=== Searching codebase for similar leverage trading DEX patterns ==="
rg -l "leverage|perpetual|futures" --type=js -g 'projects/**/index.js' | head -20Repository: DefiLlama/DefiLlama-Adapters
Length of output: 1102
🌐 Web query:
What is the difference between TVL and staking in DeFi protocols, and how should leverage trading DEX protocols categorize locked collateral versus staked governance tokens?
💡 Result:
TVL vs. staking (in DeFi)
- TVL (Total Value Locked): the USD value of assets locked in a protocol’s smart contracts that power the protocol’s core function (e.g., liquidity in AMMs, collateral in lending, margin/collateral vaults in trading protocols). (docs.llama.fi)
- Staking (common usage in DeFi analytics): typically the value of governance/protocol tokens staked in the protocol’s staking system (often for rewards, fee share, vote power, or an insurance/backstop role). Many analytics sites track this separately because it can inflate “traction” without reflecting real usage of the core product. (defillama.com)
How leverage-trading DEXs (perps/margin DEXs) should categorize assets
A practical, analytics-friendly split is:
-
Core TVL (Locked collateral / margin TVL)
Include user-posted trading collateral that is locked in protocol-controlled contracts to open/maintain leveraged positions (e.g., USDC/ETH margin in a vault). This collateral is integral to the protocol’s trading function, so it belongs in TVL. (docs.llama.fi) -
Staked (Governance token staking) — separate from core TVL
Put staked governance tokens (e.g., protocol token staking for rewards/voting/fee share) in a separate “Staked” metric rather than core TVL, since it’s often independent of actual trading usage and can distort comparisons. (defillama.com) -
Edge case (if governance tokens are required for trading risk/collateral)
If the governance token is actually used as margin/collateral for leveraged positions (or is otherwise required and locked to enable trading in a way that affects liquidation/risk), then it’s reasonable to count that portion under core TVL, but it should be broken out explicitly (e.g., “Margin TVL: stablecoins” vs “Margin TVL: governance-token collateral”) to avoid misleading aggregation.
In short: locked trading collateral → TVL; staked governance tokens → “Staked” (not core TVL), unless they are genuinely trading collateral—then include, but disclose as a separate component.
Citations:
- 1: https://docs.llama.fi/list-your-project/readme?utm_source=openai
- 2: https://defillama.com/data-definitions?utm_source=openai
- 3: https://docs.llama.fi/list-your-project/readme?utm_source=openai
- 4: https://defillama.com/data-definitions?utm_source=openai
🏁 Script executed:
# Read the complete file to see all exports and methodology
cat projects/cronos-gangsters/index.jsRepository: DefiLlama/DefiLlama-Adapters
Length of output: 536
🏁 Script executed:
# Check if there are related files or documentation
fd -i cronos-gangstersRepository: DefiLlama/DefiLlama-Adapters
Length of output: 98
🏁 Script executed:
# Look at a similar leverage trading DEX adapter for comparison
cat projects/deri/index.jsRepository: DefiLlama/DefiLlama-Adapters
Length of output: 2727
Move staking/competition contract tracking to staking export.
The methodology explicitly states this counts "GANG tokens locked in Cronos Gangsters staking and competition contracts," but the export uses the tvl key. In DefiLlama conventions, TVL tracks assets locked in the protocol's core functionality (e.g., collateral in trading positions or liquidity in perpetual pools), while staking tracks governance tokens locked for rewards or voting.
Since the two owner addresses hold GANG tokens in staking and competition contracts, restructure as:
Suggested fix
module.exports = {
cronos: {
staking: sumTokensExport({
owners: [
'0x2099ad49329909FDb620714D01F5A74D57CDeE0C',
'0xe546C82f0CedE3341dC402626923A6D4b95234Ee',
],
tokens: [GANG_TOKEN],
}),
},
methodology: 'Staking counts GANG tokens locked in Cronos Gangsters staking and competition contracts.',
};If this is a leverage trading DEX, also verify whether there is actual trading collateral (margin vaults, perpetual pools, etc.) that should be tracked separately under tvl.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@projects/cronos-gangsters/index.js` around lines 5 - 14, The export currently
assigns the two owner addresses and GANG_TOKEN to the cronos.tvl export; change
this to a cronos.staking export by replacing the tvl key with staking and
keeping the sumTokensExport({...}) call (referencing module.exports, cronos, tvl
-> staking, sumTokensExport, GANG_TOKEN and the two owner addresses
'0x2099...DeE0C' and '0xe546C8...234Ee'); also add a methodology string
clarifying that staking counts GANG tokens locked in Cronos Gangsters staking
and competition contracts.
NOTE
Please enable "Allow edits by maintainers" while putting up the PR.
If you would like to add a
volume/fees/revenueadapter please submit the PR here.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.
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.
For updating listing info It is a different repo, you can find your listing in this file, you can edit it there and put up a PR
Please do not add new npm dependencies, do not edit/push
pnpm-lock.yamlfile as part of your changes(Needs to be filled only for new listings)
Name (to be shown on DefiLlama):
Twitter Link:https://x.com/CronosGangsters
List of audit links if any:
Website Link:https://cronosgangsters.com/
Logo (High resolution, will be shown with rounded borders):https://cronosgangsters.com/gang-logo.png
Current TVL:
Treasury Addresses (if the protocol has treasury)0xaA3C5749628610fF410EF9133a4ac4f58e9A52eA
Chain:Cronos
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):Leverage Trading DEX on Cronos with up to 100x leverage, staking, farming and NFTs
Token address and ticker if any:0x4cE15b52a34dE6F62448fDBAdDF1dB4811DDC3EF
Category (full list at https://defillama.com/categories) *Please choose only one:Dexes
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):TVL is calculated by counting GANG tokens held in staking and competition smart contracts on Cronos chain
Github org/user (Optional, if your code is open source, we can track activity):
Does this project have a referral program?
Summary by CodeRabbit