Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions fees/aveai/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { SimpleAdapter, FetchOptions } from "../../adapters/types";
import { CHAIN } from "../../helpers/chains";
import { METRIC } from "../../helpers/metrics"

const contracts: Record<string, string> = {
[CHAIN.BASE]: "0x282970F452371454332Ca522cE59F318a2C81484",
[CHAIN.BSC]: "0xd270845b7EBb0B013DfCCD9cA782a57Bfb7A359A",
[CHAIN.ETHEREUM]: "0x60943cb06b76A24431659165c81a03c16F1C325C",
}
const feeTopic = "0xc08acb1892d97145a15c4cc6206956e56a7482a9af175f548b7b40eb336790dd";
Comment on lines +5 to +10
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 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.ts

Repository: 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:


🌐 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:


🌐 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:


🌐 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:


🌐 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:


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.


async function fetch(options: FetchOptions) {
const { getLogs, createBalances } = options;
const dailyFees = createBalances();
const contract = contracts[options.chain]
const logs = await getLogs({ target: contract, topics: [feeTopic], entireLog: true });
Comment on lines +15 to +16
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

logs.forEach((log: any) => {
const token = "0x" + log.topics[1].slice(26);
const amount = BigInt(log.data);
dailyFees.add(token, amount, METRIC.TRADING_FEES);
});
return { dailyFees, dailyRevenue: dailyFees };
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 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:


🏁 Script executed:

cat -n fees/aveai/index.ts

Repository: 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.

}

const adapter: SimpleAdapter = {
version: 2,
pullHourly: true,
adapter: {
[CHAIN.BASE]: {
fetch,
start: "2025-07-03",
},
[CHAIN.BSC]: {
fetch,
start: "2025-07-03",
},
[CHAIN.ETHEREUM]: {
fetch,
start: "2025-07-16"
}
},
methodology: {
Fees: "Fees collected on each swap (0.5% for chain wallets, 0.8% for bot wallets).",
Revenue: "All fees are collected by the protocol.",
},
breakdownMethodology: {
Fees: {
[METRIC.TRADING_FEES]: "Fees collected on each swap (0.5% for chain wallets, 0.8% for bot wallets)."
},
Revenue: {
[METRIC.TRADING_FEES]: "All fees are collected by the protocol"
}
}
};

export default adapter;
Loading