Skip to content

Commit 7b68e42

Browse files
authored
virtual protocol revenue updates (DefiLlama#3864)
1 parent c9a8120 commit 7b68e42

File tree

2 files changed

+221
-230
lines changed

2 files changed

+221
-230
lines changed

fees/virtual-protocol.ts

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ const prefetch = async (options: FetchOptions) => {
88
return await queryDuneSql(options, sql_query);
99
}
1010

11-
const fetchFees = async (_a: any, _b: any, options: FetchOptions) => {
11+
const fetch = async (_a: any, _b: any, options: FetchOptions) => {
1212
const dailyFees = options.createBalances();
1313

1414
const results = options.preFetchedResults || [];
1515
const chainData = results.find((item: any) => item.chain === options.chain);
16-
dailyFees.addUSDValue(chainData.fees_usd);
16+
if (chainData) {
17+
dailyFees.addUSDValue(chainData.fees_usd);
18+
}
1719

1820
return {
1921
timestamp: options.startOfDay,
@@ -25,23 +27,28 @@ const fetchFees = async (_a: any, _b: any, options: FetchOptions) => {
2527

2628
const meta = {
2729
methodology: {
28-
Fees: 'All fees paid by users from launching adn trading tokens.',
29-
Revenue: 'Fees are collected by Virtual Protocol.',
30-
ProtocolRevenue: 'Fees are collected by Virtual Protocol.',
30+
Fees: 'Revenue from Virtual Protocol across 4 main streams: 1) Base Virtual-fun (legacy buy/sell transactions), 2) Base Virtual-app (legacy non-trading), 3) Base CBBTC-prototype (direct transfers to prototype wallet), 4) Base CBBTC-sentient (outflows from tax manager representing agent treasury distributions). Also includes Ethereum Virtual transfers and Solana prototype fees + 1% of agent trading volume. Individual ecosystem and treasury transfers are replaced by the tax manager outflow method to avoid double counting.',
31+
Revenue: 'Fees collected by the Protocol.',
32+
ProtocolRevenue: 'Revenue from all sources to the Protocol.',
3133
}
3234
}
3335

3436
const adapter: SimpleAdapter = {
3537
version: 1,
3638
adapter: {
3739
[CHAIN.BASE]: {
38-
fetch: fetchFees,
39-
start: "2024-10-16",
40+
fetch,
41+
start: "2024-10-15",
42+
meta,
43+
},
44+
[CHAIN.ETHEREUM]: {
45+
fetch,
46+
start: "2025-06-11",
4047
meta,
4148
},
4249
[CHAIN.SOLANA]: {
43-
fetch: fetchFees,
44-
start: "2024-10-16",
50+
fetch,
51+
start: "2025-02-11",
4552
meta,
4653
},
4754
},

0 commit comments

Comments
 (0)