Add DexFi adapter and remove legacy Dexfinance adapters#18625
Add DexFi adapter and remove legacy Dexfinance adapters#18625badgerdf wants to merge 4 commits intoDefiLlama:mainfrom
Conversation
📝 WalkthroughWalkthroughThis pull request consolidates DexFinance protocol integrations by introducing a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
|
The adapter at projects/dexfi exports TVL: |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
projects/dexfi/index.js (1)
111-127: Mark this adapter asmisrepresentedTokens.
tvlis adding quoted wrapped-native equivalents, not the actual vault assets. SettingmisrepresentedTokens: truewill keep the token breakdown honest without changing the USD totals.Based on learnings: In the AFI Protocol adapter, the TVL adapter correctly uses `misrepresentedTokens: true` and adds raw `totalSupply` values rather than converting to underlying assets, since the pricing layer already handles the vault token prices.🏷️ Suggested export tweak
module.exports = { + misrepresentedTokens: true, methodology: "TVL is calculated by converting locked staking token liquidity to native token equivalent via on-chain swap estimation across all vaults",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@projects/dexfi/index.js` around lines 111 - 127, Add a top-level misrepresentedTokens: true property to the exported adapter object (the object assigned to module.exports) so the adapter is marked as using wrapped/quoted native equivalents; update the export that currently lists methodology, hallmarks, sonic/avax/bsc/ethereum/base/arbitrum and functions like tvl, staking(STAKING_CONTRACT, GDEX_TOKEN), and pool2 to include misrepresentedTokens: true alongside them, leaving existing tvl and staking logic unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@projects/dexfi/index.js`:
- Around line 111-127: Add a top-level misrepresentedTokens: true property to
the exported adapter object (the object assigned to module.exports) so the
adapter is marked as using wrapped/quoted native equivalents; update the export
that currently lists methodology, hallmarks,
sonic/avax/bsc/ethereum/base/arbitrum and functions like tvl,
staking(STAKING_CONTRACT, GDEX_TOKEN), and pool2 to include
misrepresentedTokens: true alongside them, leaving existing tvl and staking
logic unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b9e3cd3d-dd36-4423-b6f2-a30ca997cdb5
📒 Files selected for processing (7)
projects/dexfi/abi.jsprojects/dexfi/index.jsprojects/dexfinance-etf/index.jsprojects/dexfinance-vault/index.jsprojects/dexfinance/abi.jsprojects/dexfinance/index.jsprojects/treasury/dexfinance.js
💤 Files with no reviewable changes (5)
- projects/dexfinance/abi.js
- projects/dexfinance-etf/index.js
- projects/treasury/dexfinance.js
- projects/dexfinance/index.js
- projects/dexfinance-vault/index.js
|
Hello, thank you for the PR, I refactored it in #18705. We don't remove existing adapters from the repo even when contracts are deprecated for reasons described here: #13020 My refactor keeps the existing dexfinance adapters and adds a new dexfinance-vault-v2 adapter for the new contracts. Does this work for you? |
|
Hi, thanks for the review.
btw https://github.com/DefiLlama/dimension-adapters/pulls fees pr is also ready to review |
|
@badgerdf Hello, to address each point:
For example, if you replace line 79 with this: More gDEX vault examples: 276 ($98k gDEX -> WETH), 1623 ($86k gDEX -> WETH), 275 (~$73k gDEX -> WETH) Additionally, the total value being reported by our adapters is roughly the same, I just classify gdex under staking instead of substituting it for WETH. For example, on base only:
On all chains:
Furthermore, you can see a token breakdown in my test output instead of only wrapped native tokens:
|
|
@RohanNero Couple of questions
|
|
@badgerdf No problem!
|
|
@RohanNero Also how you guys could start indexing all tvl/fees to show values from the |


PR note for reviewer: I've deleted dexfinance adapters, because all of them was written by me and it's no longer relevant. All associated with them smart contracts were being migrated into DexFi ecosystem. I'll going to push treasury and fee calculating later as soon as we'll define what we need to show into this sections
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): DexFi
Twitter Link: https://x.com/DexFinance
List of audit links if any:
Website Link: https://dexfi.com/
Logo (High resolution, will be shown with rounded borders): https://drive.google.com/file/d/1skNsGqyKuQ0Efeir6iDyMeBpgA7EAdQD/view
Current TVL: $2.9m
Treasury Addresses (if the protocol has treasury):
later
Chain: BASE, ETH, BNB, ARB, AVAX, SONIC
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): DexFi offers an ecosystem of financial products designed to empower users and simplify the DeFi experience. DexFi’s AiLM (Automated Intelligent Liquidity Manager), powers DeFi’s most sophisticated yield aggregator to actively manage v3/v4 liquidity positions.
Token address and ticker if any: gDEX
0x53Cb59D32a8d08fC6D3f81454f150946A028A44d
Category (full list at https://defillama.com/categories) *Please choose only one: Yield Aggregator (https://defillama.com/protocols/yield-aggregator)
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): No
methodology (what is being counted as tvl, how is tvl being calculated): Each vault handles deposited liquidity over specific farm/pool/gauge implementation, so most of operations goes via Native token on each chain. To estimation of TVL we use estimation of withdraw a piece of deposit amount and extrapolated this value on entire size, ofc it also calculates via Native token(details inside of adapter)
Github org/user (Optional, if your code is open source, we can track activity): https://github.com/dexfi-com
Does this project have a referral program?: No
Summary by CodeRabbit
Release Notes
New Features
Refactor