track ave ai fees/revenue#6331
Conversation
Summary by CodeRabbit
WalkthroughA new adapter module for the Aveai protocol has been added at Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested labels
🚥 Pre-merge checks | ✅ 2 | ❌ 4❌ Failed checks (2 warnings, 2 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches✨ Simplify code
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 aveai adapter exports: |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@fees/aveai/index.ts`:
- Around line 15-16: The code uses contracts[options.chain] to set contract then
calls getLogs({ target: contract, ... }) without validating contract; add a
guard to detect when contract is undefined (e.g., when options.chain is not
present in the contracts map) and handle it by returning/throwing or logging an
explicit error before calling getLogs. Specifically update the block that reads
const contract = contracts[options.chain] to validate contract and emit a clear
error message or early return (mentioning options.chain and feeTopic) so getLogs
is never called with an undefined target.
- Line 22: The return currently sets dailyRevenue equal to dailyFees; change
this to track referrer rebates separately by adding a dailySupplySideRevenue
value (the referrer rebate amount) and set dailyRevenue = dailyFees -
dailySupplySideRevenue. Locate the place returning the object (the return {
dailyFees, dailyRevenue: dailyFees } in fees/aveai/index.ts) and replace it with
a return that includes dailySupplySideRevenue (computed from the applicable
rebate rate or input/constant you use for referrer share) and dailyRevenue
computed as dailyFees minus dailySupplySideRevenue, keeping the dailyFees output
unchanged.
- Around line 5-10: The contract addresses in the contracts map and the feeTopic
constant (symbols: contracts, CHAIN.BASE, CHAIN.BSC, CHAIN.ETHEREUM, feeTopic)
appear unverified or unrelated to Ave.ai; confirm whether these are genuine
Ave.ai fee-collection contracts by (1) verifying each address on the appropriate
block explorer (BaseScan, Etherscan, BscScan) and matching contract source/ABI
and owner/deployer to Ave.ai, (2) if they are not verified or not owned by
Ave.ai, remove or replace those chain entries in the contracts map with the
correct verified addresses or mark the chain as unsupported, and (3) if Ave.ai
fees are off-chain, convert this adapter to a no-op or document that on-chain
fee collection is unsupported and remove the feeTopic usage; update code
comments and add links to the explorer verification or official Ave.ai
documentation as proof.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: e46124dd-74e3-4701-8c8e-d30343675c71
📒 Files selected for processing (1)
fees/aveai/index.ts
| const contracts: Record<string, string> = { | ||
| [CHAIN.BASE]: "0x282970F452371454332Ca522cE59F318a2C81484", | ||
| [CHAIN.BSC]: "0xd270845b7EBb0B013DfCCD9cA782a57Bfb7A359A", | ||
| [CHAIN.ETHEREUM]: "0x60943cb06b76A24431659165c81a03c16F1C325C", | ||
| } | ||
| const feeTopic = "0xc08acb1892d97145a15c4cc6206956e56a7482a9af175f548b7b40eb336790dd"; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify the event signature matches the topic
# Common fee event patterns that could produce this topic
echo "Checking if contracts are verified on block explorers..."
echo ""
echo "Base contract: 0x282970F452371454332Ca522cE59F318a2C81484"
echo "BSC contract: 0xd270845b7EBb0B013DfCCD9cA782a57Bfb7A359A"
echo "Ethereum contract: 0x60943cb06b76A24431659165c81a03c16F1C325C"
echo ""
echo "Fee topic: 0xc08acb1892d97145a15c4cc6206956e56a7482a9af175f548b7b40eb336790dd"
echo ""
echo "To verify: check the contract ABI on respective block explorers to confirm the event signature"Repository: DefiLlama/dimension-adapters
Length of output: 481
🏁 Script executed:
cat -n fees/aveai/index.tsRepository: DefiLlama/dimension-adapters
Length of output: 1907
🌐 Web query:
Ave.ai protocol smart contracts fees collection
💡 Result:
Ave.ai is a multi-chain DEX aggregator and Web3 trading platform (www.ave.ai), not a traditional DeFi protocol with its own liquidity pools or lending markets. No public smart contract addresses for Ave.ai's core router or fee collection mechanisms were found in official docs, GitHub, or explorers. It integrates with 130+ chains and 300+ DEXs for one-click trading. Ave.ai charges platform service fees on transactions routed through its aggregator: - Bot Wallet: 0.8% of trade amount - Chain Wallet: 0.5% of trade amount These fees are collected per transaction alongside standard on-chain gas fees paid to networks (e.g., SOL on Solana, Gwei on ETH). Additional user-set parameters include slippage tolerance, priority fees, and anti-MEV protection, but these are not Ave.ai fees. No evidence of on-chain fee collection via Ave.ai-specific smart contracts; fees appear handled off-chain or via wallet integrations (e.g., Ave Sniper Bot confirms 0.8% trading fee). Older user agreement (2024) stated no fees, but updated docs (2025) confirm the above rates. Referral rebates up to 60% of fees for VIPs. Secondary sources confirm Ave.ai does not charge traditional maker/taker fees like CEXs but incurs aggregator routing costs and gas.
Citations:
- 1: https://doc.ave.ai/tutorial/pc-web-tutorial/ave.ai-fees-and-settings
- 2: https://magicsquare.io/blog/ave-ai-fees-explained
- 3: https://doc.ave.ai/tutorial/pc-web-turorial/ave.ai-fees-and-settings
- 4: https://avebotdoc.ave.ai/en/faq/trading-fee-and-referral-rewards
- 5: https://avedex.gitbook.io/ave/ave.ai-jiao-cheng/pc-duan-shi-yong-jiao-cheng/ave.ai-shou-xu-fei-he-chang-jian-fei-yong-she-zhi
- 6: https://doc.ave.ai/
- 7: https://www.aveai.ai/
- 8: https://www.ave-dex.app/
- 9: https://doc.ave.ai/ave.ai-user-agreement
🌐 Web query:
contract address 0x282970F452371454332Ca522cE59F318a2C81484 BASE chain
💡 Result:
The contract address 0x282970F452371454332Ca522cE59F318a2C81484 on the Base chain does not appear in top search results from BaseScan, explorer.base.org, DexScreener, or official Base documentation. No name, token details, transactions, or other identifying information was found in authoritative sources. It may be a non-existent, unindexed, private, or very low-activity contract. Check directly on https://basescan.org/address/0x282970F452371454332Ca522cE59F318a2C81484 for real-time data.
Citations:
- 1: https://docs.base.org/base-chain/network-information/base-contracts
- 2: https://basescan.org/address/0x2f662405107f149ef3da72fb606b081c8892ac9f
- 3: https://basescan.org/tokens
- 4: https://explorer.base.org/
- 5: https://basescan.org/
- 6: https://basescan.org/address/0xA2ef7f5D84c25894fFEAc6e54a6249412A29eFf2
- 7: https://basescan.org/opcode-tool
- 8: https://basescan.org/address/0x2829710cE5E7490ceF38Ed2B10A57129fC4a6DB7
- 9: https://basescan.org/address/0x6dC6c896a4C60ff53241430102a32e215c4D0360
- 10: https://dexscreener.com/base/0xdf59434e450b422ad763b0b97a110b4c8cdae49a
- 11: https://dexscreener.com/base/
- 12: https://dexscreener.com/base/0x594Ed7517a0aB25be4E87D0eaDd1a3A65cD981D0
- 13: https://dexscreener.com/base/0x13335f9f3586045f6b2d90d75634e8414e354108
🌐 Web query:
contract address 0x60943cb06b76A24431659165c81a03c16F1C325C Ethereum
💡 Result:
The Ethereum address 0x60943cb06b76A24431659165c81a03c16F1C325C is a smart contract on the Ethereum mainnet. It has 0 ETH balance, holds small amounts of tokens like USDT (0.004479) and USDC (0.00852), and has been involved in 79,062 to 85,648 transactions. The contract was created approximately 195 days ago (around October 2025) by the address 0x31781b4E...bf6270FC4. There is a UML diagram available for its Solidity code structure. No verified source code, contract name, or token symbol/name is explicitly stated in the sources. It appears to be an ERC-20 token contract based on massive transfer volumes observed in transactions (e.g., billions of token units transferred), but no official token details or project information were found. No listings on DEX trackers like DexScreener or DexTools for this address as a token.
Citations:
- 1: https://etherscan.io/address/0x60943cb06b76a24431659165c81a03c16f1c325c
- 2: https://etherscan.io/viewsvg?a=0x60943cb06b76a24431659165c81a03c16f1c325c&t=1
- 3: https://ethplorer.io/tx/0x2905832ed4e7a55884060aca9bd3878997bde32d9faa510df9497c9d5eaa6462
- 4: https://etherscan.io/txs?a=0x60943cb06b76a24431659165c81a03c16f1c325c
- 5: https://etherscan.io/address/0x60943cb06b76A24431659165c81a03c16F1C325C
- 6: https://ethplorer.io/tx/0xcf9454d7f80233691a27106a70757699552dcbf0a848cb8b95c43428628072a5
- 7: https://dexscreener.com/bsc/0xb06bf8f32915bf7336c904cd08ed0057f838b2c5
- 8: https://dexscreener.com/ethereum/0xa29fe6ef9592b5d408cca961d0fb9b1faf497d6d
- 9: https://dexscreener.com/bsc/0x4b729d5d871057f3a9c424792729217cde72410d
- 10: https://dexscreener.com/ethereum/0xF1e3791dbbbFDAE15815073dd2853A8b577841b4
🌐 Web query:
0x60943cb06b76A24431659165c81a03c16F1C325C contract name type
💡 Result:
The Ethereum smart contract at address 0x60943cb06b76A24431659165c81a03c16F1C325C is a TransparentUpgradeableProxy. This is an upgradeable proxy contract from OpenZeppelin that delegates calls to an implementation contract, allowing upgrades without changing the proxy address. It is verified on Etherscan as a contract with high transaction volume (over 79,000 txs), created about 195 days ago (around late 2025). SmartMuv Explorer explicitly identifies it as "TransparentUpgradeableProxy".
Citations:
- 1: https://etherscan.io/address/0x60943cb06b76a24431659165c81a03c16f1c325c
- 2: https://explorer.smartmuv.app/result/0x60943cb06b76A24431659165c81a03c16F1C325C
- 3: https://etherscan.io/viewsvg?a=0x60943cb06b76a24431659165c81a03c16f1c325c&t=1
- 4: https://etherscan.io/address/0x60943cb06b76A24431659165c81a03c16F1C325C
- 5: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/proxy/transparent/TransparentUpgradeableProxy.sol
🌐 Web query:
Ave.ai smart contract deployment BASE BSC Ethereum
💡 Result:
Ave.ai is a decentralized on-chain data and trading platform that aggregates data from over 130 blockchains, including BASE, BSC, and Ethereum. It supports on-chain analytics, DEX trading, smart money tracking, and bot functions across these chains. However, no official smart contract addresses or deployment details for Ave.ai's own core contracts (e.g., core protocol, dApp backend contracts) on BASE, BSC, or Ethereum were found in official documentation, websites (ave.ai, doc.ave.ai), GitHub repositories, or blockchain explorers. Ave.ai appears to be primarily a frontend/client application (web, mobile apps for iOS/Android, desktop) that interacts with existing DEXs, wallets (e.g., Ave Wallet based on Trust Wallet), and on-chain data via APIs and RPCs. It facilitates user interactions with third-party smart contracts (e.g., DEX routers, tokens) but does not deploy its own central smart contracts. Official docs emphasize data aggregation, trading interfaces, and risk screening without listing proprietary contract addresses. Listed on DappBay as a DeFi tool on BNB Smart Chain (BSC), but no specific contract address provided. Various unrelated or fan-named tokens like "[Ave.ai] Ave.ai Token" (ETH: 0xF972b520F21e58287b843d03A0851d6939c3f347) exist, but these are not verified as official. Confidence: Ave.ai likely has no publicly deployed core smart contracts on these chains; it operates as a non-custodial dApp frontend.
Citations:
- 1: https://doc.ave.ai/tutorial/quick-guide-for-beginners
- 2: https://www.weex.com/news/detail/aveai-integrates-with-edgex-officially-launches-on-chain-perpetual-contract-feature-452336
- 3: https://dappbay.bnbchain.org/detail/aveai
- 4: https://www.aveai.ai/
- 5: https://doc.ave.ai/
- 6: https://ave.ai/
- 7: https://ave.ad/
- 8: https://ave.ai/terms-of-service.html
- 9: https://docs.ave.ai/reference/api-reference/v2
- 10: https://doc.ave.ai/tutorial/smart-money-strategies
- 11: https://ethplorer.io/address/0xf972b520f21e58287b843d03a0851d6939c3f347
- 12: https://binplorer.com/address/0x57c3e12773900d069b783952b74f46b2ad344444
- 13: https://bscscan.com/token/0x198e490e221eeaf68c74d4505feab73b29ef2c97
The contract addresses appear to be invalid or unverified Ave.ai contracts and need immediate review.
Web verification shows:
- BASE contract (0x282970F452371454332Ca522cE59F318a2C81484): Not found on BaseScan or any public explorer; appears non-existent or unindexed.
- Ethereum contract (0x60943cb06b76A24431659165c81a03c16F1C325C): Verified as an OpenZeppelin TransparentUpgradeableProxy with high transaction volume, but no evidence it is an Ave.ai contract and purpose is unknown.
- Ave.ai itself: Does not appear to have publicly deployed core smart contracts on these chains. It operates as a DEX aggregator/frontend dApp. Ave.ai fees (0.8% Bot Wallet, 0.5% Chain Wallet) are handled off-chain or via wallet integrations, not through on-chain fee collection contracts.
This adapter may be fundamentally incorrect if targeting a protocol that does not have on-chain fee collection mechanisms. Confirm these contracts are legitimate Ave.ai fee collection contracts and clarify the protocol's actual fee structure before proceeding.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@fees/aveai/index.ts` around lines 5 - 10, The contract addresses in the
contracts map and the feeTopic constant (symbols: contracts, CHAIN.BASE,
CHAIN.BSC, CHAIN.ETHEREUM, feeTopic) appear unverified or unrelated to Ave.ai;
confirm whether these are genuine Ave.ai fee-collection contracts by (1)
verifying each address on the appropriate block explorer (BaseScan, Etherscan,
BscScan) and matching contract source/ABI and owner/deployer to Ave.ai, (2) if
they are not verified or not owned by Ave.ai, remove or replace those chain
entries in the contracts map with the correct verified addresses or mark the
chain as unsupported, and (3) if Ave.ai fees are off-chain, convert this adapter
to a no-op or document that on-chain fee collection is unsupported and remove
the feeTopic usage; update code comments and add links to the explorer
verification or official Ave.ai documentation as proof.
| const contract = contracts[options.chain] | ||
| const logs = await getLogs({ target: contract, topics: [feeTopic], entireLog: true }); |
There was a problem hiding this comment.
Add validation for missing contract address.
If a chain is added to the adapter configuration but not to the contracts map, contract will be undefined, potentially causing silent failures or unexpected behavior in getLogs.
🛡️ Proposed fix to add validation
const contract = contracts[options.chain]
+ if (!contract) throw new Error(`No contract configured for chain: ${options.chain}`)
const logs = await getLogs({ target: contract, topics: [feeTopic], entireLog: true });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@fees/aveai/index.ts` around lines 15 - 16, The code uses
contracts[options.chain] to set contract then calls getLogs({ target: contract,
... }) without validating contract; add a guard to detect when contract is
undefined (e.g., when options.chain is not present in the contracts map) and
handle it by returning/throwing or logging an explicit error before calling
getLogs. Specifically update the block that reads const contract =
contracts[options.chain] to validate contract and emit a clear error message or
early return (mentioning options.chain and feeTopic) so getLogs is never called
with an undefined target.
| const amount = BigInt(log.data); | ||
| dailyFees.add(token, amount, METRIC.TRADING_FEES); | ||
| }); | ||
| return { dailyFees, dailyRevenue: dailyFees }; |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Ave.ai referral program fee structure and revenue sharing model
💡 Result:
Ave.ai's referral program offers rebates from trading fees generated by referred users. The platform charges a 0.8% transaction fee on trades (for bot wallets). Referrers earn up to 25% of this fee as a basic rebate, applicable on chains like Solana, ETH, BSC, Base, Core, Tron, and Ton. The Ave Rebate Promotion Program provides tiered VIP upgrades based on invited users (within 90 days) and their trading volume (within 30 days): - VIP1: 30% total rebate - VIP2: 40% total rebate - VIP3: 60% total rebate - SVIP: 60% total rebate (for influencers) Users get unique referral links/codes via the Ave.ai website (https://ave.ai/?ref={code}), app, or Telegram bot (https://t.me/AveSniperBot?start=ref_{code}). Referred friends' trades automatically generate commissions for the referrer. Past promotions included download rewards (e.g., up to $1.50 per referral in 2024), but current structure focuses on ongoing trading rebates.
Citations:
- 1: https://avebotdoc.ave.ai/en/faq/trading-fee-and-referral-rewards
- 2: https://doc.ave.ai/ave.ai-referral-program
- 3: https://doc.ave.ai/ave.ai-referral-program/refer-friends-to-earn-rebate
- 4: https://doc.ave.ai/tutorial/pc-web-turorial/ave.ai-fees-and-settings
- 5: https://doc.ave.ai/tutorial/pc-web-tutorial/ave.ai-fees-and-settings
- 6: https://doc.ave.ai/events/refer-and-earn-up-to-usd6000
🏁 Script executed:
cat -n fees/aveai/index.tsRepository: DefiLlama/dimension-adapters
Length of output: 1907
Track referrer rebates as dailySupplySideRevenue.
Ave.ai's referral program pays referrers 25–60% of the 0.8% transaction fee, depending on VIP tier. These referrer payouts must be tracked separately:
dailyFees= all transaction fees collected (Gross Protocol Revenue)dailySupplySideRevenue= referrer rebate payouts (Cost of Funds)dailyRevenue=dailyFees - dailySupplySideRevenue(what the protocol retains)
Currently, the code treats dailyRevenue = dailyFees, which incorrectly assumes the protocol keeps 100% of fees. Adjust the calculation to reflect the actual fee distribution to referrers.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@fees/aveai/index.ts` at line 22, The return currently sets dailyRevenue equal
to dailyFees; change this to track referrer rebates separately by adding a
dailySupplySideRevenue value (the referrer rebate amount) and set dailyRevenue =
dailyFees - dailySupplySideRevenue. Locate the place returning the object (the
return { dailyFees, dailyRevenue: dailyFees } in fees/aveai/index.ts) and
replace it with a return that includes dailySupplySideRevenue (computed from the
applicable rebate rate or input/constant you use for referrer share) and
dailyRevenue computed as dailyFees minus dailySupplySideRevenue, keeping the
dailyFees output unchanged.
https://github.com/DefiLlama/internal-docs/issues/39
NOTE
Please enable "Allow edits by maintainers" while putting up the PR.
package.json/package-lock.jsonfile as part of your changesName (to be shown on DefiLlama): Ave.ai
Twitter Link: https://x.com/AveaiGlobal
List of audit links if any:
Website Link: https://ave.ai/
Logo (High resolution, will be shown with rounded borders): https://doc.ave.ai/~gitbook/image?url=https%3A%2F%2F282307349-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVhfw2n4uNr4o5eCyFsyK%252Fuploads%252Fj65CotCNeLbV9GYzOaNK%252Fimage.png%3Falt%3Dmedia%26token%3De8382e69-1fca-49da-bba0-78e0cb40e247&width=768&dpr=1&quality=100&sign=d31e1da8&sv=2
Current TVL:
Treasury Addresses (if the protocol has treasury)
Chain: BSC, Base, 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): Ave.ai is a world-leading on-chain trading platform. It offers lightning-fast, one-click trading with a focus on security, professional, fast, and comprehensive coverage.
Token address and ticker if any:
Category (full list at https://defillama.com/categories) *Please choose only one: Trading App
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):
Does this project have a referral program? Yes, https://ave.ai/referral