From d1ea511cbcd5c8fec6df4af366eaccb43913f5b0 Mon Sep 17 00:00:00 2001 From: KPHEMRAJ <65623621+KPHEMRAJ@users.noreply.github.com> Date: Sun, 14 Sep 2025 23:16:57 +0530 Subject: [PATCH 1/4] track treehouse fee + fix typo --- fees/gauntlet.ts | 10 ++-- fees/openeden-usdo.ts | 14 ++--- fees/treehouse-protocol/index.ts | 95 ++++++++++++++++++++++++++++++++ fees/yearn-finance.ts | 6 +- helpers/metrics.ts | 3 +- 5 files changed, 112 insertions(+), 16 deletions(-) create mode 100644 fees/treehouse-protocol/index.ts diff --git a/fees/gauntlet.ts b/fees/gauntlet.ts index 0d00c610f8..c7db838463 100644 --- a/fees/gauntlet.ts +++ b/fees/gauntlet.ts @@ -147,13 +147,13 @@ const fetchSolana = async (_t: any, _a: any, options: FetchOptions) => { if (managerFeesData && managerFeesData.length > 0) { managerFeesData.forEach((fee: any) => { if (fee.total_amount && fee.token_mint_address) { - dailyRevenue.add(fee.token_mint_address, fee.total_amount, METRIC.MANAGERMENT_FEES); + dailyRevenue.add(fee.token_mint_address, fee.total_amount, METRIC.MANAGEMENT_FEES); } }); } // add revenue to fees - const dailyFees = dailyRevenue.clone(1, METRIC.MANAGERMENT_FEES); + const dailyFees = dailyRevenue.clone(1, METRIC.MANAGEMENT_FEES); const dailySupplySideRevenue = options.createBalances(); const grossReturns = await calculateGrossReturns(options); @@ -185,15 +185,15 @@ const methodology = { const breakdownMethodology = { Fees: { [METRIC.ASSETS_YIELDS]: "Daily value generated for depositors from vault operations during the specified time period (includes both gains and losses)", - [METRIC.MANAGERMENT_FEES]: "Management fees chagred by Gauntlet", + [METRIC.MANAGEMENT_FEES]: "Management fees chagred by Gauntlet", }, Revenue: { [METRIC.ASSETS_YIELDS]: "Daily performance fees claimed by the Gauntlet manager during the specified time period", - [METRIC.MANAGERMENT_FEES]: "Management fees chagred by Gauntlet", + [METRIC.MANAGEMENT_FEES]: "Management fees chagred by Gauntlet", }, ProtocolRevenue: { [METRIC.ASSETS_YIELDS]: "Daily performance fees claimed by the Gauntlet manager during the specified time period", - [METRIC.MANAGERMENT_FEES]: "Management fees chagred by Gauntlet", + [METRIC.MANAGEMENT_FEES]: "Management fees chagred by Gauntlet", }, SupplySideRevenue: { [METRIC.ASSETS_YIELDS]: "Amount of yields distributed to supply-side depositors.", diff --git a/fees/openeden-usdo.ts b/fees/openeden-usdo.ts index 27cf9401cd..088d64a710 100644 --- a/fees/openeden-usdo.ts +++ b/fees/openeden-usdo.ts @@ -20,7 +20,7 @@ const configs: Record = { } // https://docs.openeden.com/tbill/fees#total-expense-ratio -const MANAGERMENT_FEES_RATE = 0.003; // 0.3% per year +const MANAGEMENT_FEES_RATE = 0.003; // 0.3% per year const fetch = async (options: FetchOptions) => { const dailyMintRedeemFees = options.createBalances(); @@ -43,10 +43,10 @@ const fetch = async (options: FetchOptions) => { }) const currentPeriod = options.toTimestamp - options.fromTimestamp - const managementFees = Number(totalSupply) * MANAGERMENT_FEES_RATE * currentPeriod / (365 * 24 * 3600) + const managementFees = Number(totalSupply) * MANAGEMENT_FEES_RATE * currentPeriod / (365 * 24 * 3600) - dailyFees.add(configs[options.chain].USDO, managementFees, METRIC.MANAGERMENT_FEES) - dailyRevenue.add(configs[options.chain].USDO, managementFees, METRIC.MANAGERMENT_FEES) + dailyFees.add(configs[options.chain].USDO, managementFees, METRIC.MANAGEMENT_FEES) + dailyRevenue.add(configs[options.chain].USDO, managementFees, METRIC.MANAGEMENT_FEES) // -- yields distributed to USDO holders via rebasing const rateBefore = await options.fromApi.call({ @@ -86,18 +86,18 @@ const breakdownMethodology = { Fees: { [METRIC.ASSETS_YIELDS]: 'USDO backing assets yields from all investments.', [METRIC.MINT_REDEEM_FEES]: 'Fees from mint/redeem USDO.', - [METRIC.MANAGERMENT_FEES]: '0.3% annual management fees.', + [METRIC.MANAGEMENT_FEES]: '0.3% annual management fees.', }, UserFees: { [METRIC.MINT_REDEEM_FEES]: 'Users pay fees when mint/redeem USDO.', }, Revenue: { [METRIC.MINT_REDEEM_FEES]: 'Fees from mint/redeem USDO.', - [METRIC.MANAGERMENT_FEES]: '0.3% annual management fees.', + [METRIC.MANAGEMENT_FEES]: '0.3% annual management fees.', }, ProtocolRevenue: { [METRIC.MINT_REDEEM_FEES]: 'Fees from mint/redeem USDO.', - [METRIC.MANAGERMENT_FEES]: '0.3% annual management fees.', + [METRIC.MANAGEMENT_FEES]: '0.3% annual management fees.', }, SupplySideRevenue: { [METRIC.ASSETS_YIELDS]: 'USDO backing assets yields from all investments.', diff --git a/fees/treehouse-protocol/index.ts b/fees/treehouse-protocol/index.ts new file mode 100644 index 0000000000..f9685908c0 --- /dev/null +++ b/fees/treehouse-protocol/index.ts @@ -0,0 +1,95 @@ +import { FetchOptions, SimpleAdapter } from "../../adapters/types"; +import { CHAIN } from "../../helpers/chains"; +import { METRIC } from "../../helpers/metrics"; + +const EVENT_ABI = { + MARKED: "event Marked (uint8 type, uint256 amount, uint256 fees)", + STANDARD_REDEMPTION: "event RedeemFinalized (address indexed user, uint256 assets, uint256 fee)", + FASTLANE_REDEMPTION: "event Redeemed (address indexed user, uint256 shares, uint256 assets, uint256 fee)" +}; + +const ADDRESSES = { + TREEHOUSE_ACCOUNTING: "0xb7Ce3cb5Bc5c00cd2f9B39d9b0580f5355535709", + TREEHOUSE_ETHEREUM: "0xD11c452fc99cF405034ee446803b6F6c1F6d5ED8", + TREEHOUSE_REDEMPTION: "0xcd63a29FAfF07130d3Af89bB4f40778938AaBB85", + TREEHOUSE_FASTLANE_REDEMPTION: "0x829525417Cd78CBa0f99A8736426fC299506C0d6", + LIDO_WST_ETHEREUM: "0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0" +}; + +async function fetch(_a: any, _b: any, options: FetchOptions) { + let dailyFees = options.createBalances(); + const dailySupplySideRevenue = options.createBalances(); + const dailyProtocolRevenue = options.createBalances(); + + const markedLogs = await options.getLogs({ + target: ADDRESSES.TREEHOUSE_ACCOUNTING, + eventAbi: EVENT_ABI.MARKED, + }); + + markedLogs.forEach(log => { + dailySupplySideRevenue.add(ADDRESSES.TREEHOUSE_ETHEREUM, log.amount); + dailyProtocolRevenue.add(ADDRESSES.TREEHOUSE_ETHEREUM, log.fees); + }); + + const standardRedemptionLogs = await options.getLogs({ + target: ADDRESSES.TREEHOUSE_REDEMPTION, + eventAbi: EVENT_ABI.STANDARD_REDEMPTION + }); + + standardRedemptionLogs.forEach(log => { + dailyProtocolRevenue.add(ADDRESSES.TREEHOUSE_ETHEREUM, log.fee) + }); + + const fastlaneRedemptionLogs = await options.getLogs({ + target: ADDRESSES.TREEHOUSE_FASTLANE_REDEMPTION, + eventAbi: EVENT_ABI.FASTLANE_REDEMPTION + }); + + fastlaneRedemptionLogs.forEach(log => { + dailyProtocolRevenue.add(ADDRESSES.LIDO_WST_ETHEREUM, log.fee) + }); + + dailyFees = dailySupplySideRevenue.clone(); + dailyFees.add(dailyProtocolRevenue); + + return { + dailyFees, + dailyRevenue: dailyProtocolRevenue, + dailyHoldersRevenue: 0, + dailyProtocolRevenue, + dailySupplySideRevenue + }; +} + +const methodology = { + Fees: "Includes Market Effective Yield(MEY) earned by treehouse assets and redemption fee", + Revenue: "Standard Redemption(7 days waiting) fee of 0.05%,Fastlane redemption fee of 2% and 20% performance fee on MEY", + ProtocolRevenue: "All the revenue goes to protocol treasury", + HoldersRevenue: "No fee sharing to holders yet", + SupplySideRevenue: "MEY earned by treehouse asset holders post performance fee", +}; + +const breakdownMethodology = { + Fees: { + [METRIC.ASSETS_YIELDS]: 'Total market effective yields earned by treehouse strategies', + [METRIC.MINT_REDEEM_FEES]: 'Standard and fastlane redemption fees', + [METRIC.PERFORMANCE_FEES]: '20% perfomance fees on MEY only when MEY is positive' + }, + Revenue: { + [METRIC.MINT_REDEEM_FEES]: 'Standard and fastlane redemption fees', + [METRIC.PERFORMANCE_FEES]: '20% perfomance fees on MEY only when MEY is positive' + }, + SupplySideRevenue: { + [METRIC.ASSETS_YIELDS]: 'Market effective yields post performance fees', + }, +}; + +const adapter: SimpleAdapter = { + fetch, + chains: [CHAIN.ETHEREUM], + methodology, + breakdownMethodology, + start: '2024-09-10' +}; + +export default adapter; \ No newline at end of file diff --git a/fees/yearn-finance.ts b/fees/yearn-finance.ts index ece5828e1d..a3d5af3202 100644 --- a/fees/yearn-finance.ts +++ b/fees/yearn-finance.ts @@ -19,11 +19,11 @@ const breakdownMethodology = { }, Revenue: { [METRIC.ASSETS_YIELDS]: 'Performance fees to Yearn treasury', - [METRIC.MANAGERMENT_FEES]: 'Management fees to Yearn treasury', + [METRIC.MANAGEMENT_FEES]: 'Management fees to Yearn treasury', }, ProtocolRevenue: { [METRIC.ASSETS_YIELDS]: 'Performance fees to Yearn treasury', - [METRIC.MANAGERMENT_FEES]: 'Management fees to Yearn treasury', + [METRIC.MANAGEMENT_FEES]: 'Management fees to Yearn treasury', }, } @@ -209,7 +209,7 @@ async function fetch(options: FetchOptions): Promise { dailyFees.add(vault.token, tf, METRIC.ASSETS_YIELDS) dailySupplySideRevenue.add(vault.token, tf - protocolFees, METRIC.ASSETS_YIELDS) dailyProtocolRevenue.add(vault.token, performanceFees, METRIC.ASSETS_YIELDS) - dailyProtocolRevenue.add(vault.token, managementFees, METRIC.MANAGERMENT_FEES) + dailyProtocolRevenue.add(vault.token, managementFees, METRIC.MANAGEMENT_FEES) } return { diff --git a/helpers/metrics.ts b/helpers/metrics.ts index b57acbcd95..715be1c059 100644 --- a/helpers/metrics.ts +++ b/helpers/metrics.ts @@ -10,11 +10,12 @@ export enum METRIC { ASSETS_YIELDS = 'Assets Yields', // protocols take users deposited assets and invest to other (on-chain or off-chain) platforms to generate yields MINT_REDEEM_FEES = 'Mint/Redeem Fees', // protocols take fees by mint/redeem tokens DEPOSIT_WITHDRAW_FEES = 'Deposit/Withdraw Fees', // protocols take fees by deposit or withdraw tokens - MANAGERMENT_FEES = 'Management Fees', // protocols take fees manage assets for users + MANAGEMENT_FEES = 'Management Fees', // protocols take fees manage assets for users TRANSACTION_GAS_FEES = 'Transaction Gas Fees', // Blockchain transactions gas fees paid by users TRANSACTION_BASE_FEES = 'Transaction Base Fees', // Blockchain transactions base fees paid by users TRANSACTION_PRIORITY_FEES = 'Transaction Priority Fees', // Blockchain transactions priority fees paid by users TRADING_FEES = 'Trading Fees', // apps, bots, frontend, wallets charge users fees by using trading MARGIN_FEES = 'Margin Fees', // perpetual, derivatives margin fees OPEN_CLOSE_FEES = 'Open/Close Fees', // trading open/close fees + PERFORMANCE_FEES = 'Performance Fees' } From 9bdc2283bc88049ebebbcabb76268545dcafe0f7 Mon Sep 17 00:00:00 2001 From: KPHEMRAJ <65623621+KPHEMRAJ@users.noreply.github.com> Date: Sun, 14 Sep 2025 23:20:19 +0530 Subject: [PATCH 2/4] performance fee description --- helpers/metrics.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/metrics.ts b/helpers/metrics.ts index 715be1c059..c14cd48fb3 100644 --- a/helpers/metrics.ts +++ b/helpers/metrics.ts @@ -17,5 +17,5 @@ export enum METRIC { TRADING_FEES = 'Trading Fees', // apps, bots, frontend, wallets charge users fees by using trading MARGIN_FEES = 'Margin Fees', // perpetual, derivatives margin fees OPEN_CLOSE_FEES = 'Open/Close Fees', // trading open/close fees - PERFORMANCE_FEES = 'Performance Fees' + PERFORMANCE_FEES = 'Performance Fees' // protocols take fee based on how the assets under their management are performing } From f2591fddd4139ab5105ed1c3f6a76fba6f78b0f7 Mon Sep 17 00:00:00 2001 From: KPHEMRAJ <65623621+KPHEMRAJ@users.noreply.github.com> Date: Mon, 15 Sep 2025 12:03:05 +0530 Subject: [PATCH 3/4] add tAvax --- fees/treehouse-protocol/index.ts | 42 ++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/fees/treehouse-protocol/index.ts b/fees/treehouse-protocol/index.ts index f9685908c0..ee3782b518 100644 --- a/fees/treehouse-protocol/index.ts +++ b/fees/treehouse-protocol/index.ts @@ -9,44 +9,52 @@ const EVENT_ABI = { }; const ADDRESSES = { - TREEHOUSE_ACCOUNTING: "0xb7Ce3cb5Bc5c00cd2f9B39d9b0580f5355535709", - TREEHOUSE_ETHEREUM: "0xD11c452fc99cF405034ee446803b6F6c1F6d5ED8", - TREEHOUSE_REDEMPTION: "0xcd63a29FAfF07130d3Af89bB4f40778938AaBB85", - TREEHOUSE_FASTLANE_REDEMPTION: "0x829525417Cd78CBa0f99A8736426fC299506C0d6", - LIDO_WST_ETHEREUM: "0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0" + [CHAIN.ETHEREUM]: { + TREEHOUSE_ACCOUNTING: "0xb7Ce3cb5Bc5c00cd2f9B39d9b0580f5355535709", + TREEHOUSE_TOKEN: "0xD11c452fc99cF405034ee446803b6F6c1F6d5ED8", //tEth + TREEHOUSE_REDEMPTION: "0xcd63a29FAfF07130d3Af89bB4f40778938AaBB85", + TREEHOUSE_FASTLANE_REDEMPTION: "0x829525417Cd78CBa0f99A8736426fC299506C0d6", + STAKED_TOKEN: "0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0" // Lido wstEth + }, + [CHAIN.AVAX]: { + TREEHOUSE_ACCOUNTING: "0x6f5D00a263dE6d40B4b2342996D2682E34f8A454", + TREEHOUSE_TOKEN: "0x14a84f1a61ccd7d1be596a6cc11fe33a36bc1646", //tAvax + TREEHOUSE_REDEMPTION: "0x765f6dc8496ca7EF1e4a391bE10185229AACf04b", + TREEHOUSE_FASTLANE_REDEMPTION: "0x3D00a639183B07e35EFEF044eE6cC14e8598A01c", + STAKED_TOKEN: "0x2b2c81e08f1af8835a78bb2a90ae924ace0ea4be" //benqi sAvax + } }; async function fetch(_a: any, _b: any, options: FetchOptions) { let dailyFees = options.createBalances(); const dailySupplySideRevenue = options.createBalances(); const dailyProtocolRevenue = options.createBalances(); - const markedLogs = await options.getLogs({ - target: ADDRESSES.TREEHOUSE_ACCOUNTING, + target: ADDRESSES[options.chain as keyof typeof ADDRESSES].TREEHOUSE_ACCOUNTING, eventAbi: EVENT_ABI.MARKED, }); markedLogs.forEach(log => { - dailySupplySideRevenue.add(ADDRESSES.TREEHOUSE_ETHEREUM, log.amount); - dailyProtocolRevenue.add(ADDRESSES.TREEHOUSE_ETHEREUM, log.fees); + dailySupplySideRevenue.add(ADDRESSES[options.chain as keyof typeof ADDRESSES].TREEHOUSE_TOKEN, log.amount); + dailyProtocolRevenue.add(ADDRESSES[options.chain as keyof typeof ADDRESSES].TREEHOUSE_TOKEN, log.fees); }); const standardRedemptionLogs = await options.getLogs({ - target: ADDRESSES.TREEHOUSE_REDEMPTION, + target: ADDRESSES[options.chain as keyof typeof ADDRESSES].TREEHOUSE_REDEMPTION, eventAbi: EVENT_ABI.STANDARD_REDEMPTION }); standardRedemptionLogs.forEach(log => { - dailyProtocolRevenue.add(ADDRESSES.TREEHOUSE_ETHEREUM, log.fee) + dailyProtocolRevenue.add(ADDRESSES[options.chain as keyof typeof ADDRESSES].TREEHOUSE_TOKEN, log.fee) }); const fastlaneRedemptionLogs = await options.getLogs({ - target: ADDRESSES.TREEHOUSE_FASTLANE_REDEMPTION, + target: ADDRESSES[options.chain as keyof typeof ADDRESSES].TREEHOUSE_FASTLANE_REDEMPTION, eventAbi: EVENT_ABI.FASTLANE_REDEMPTION }); fastlaneRedemptionLogs.forEach(log => { - dailyProtocolRevenue.add(ADDRESSES.LIDO_WST_ETHEREUM, log.fee) + dailyProtocolRevenue.add(ADDRESSES[options.chain as keyof typeof ADDRESSES].STAKED_TOKEN, log.fee) }); dailyFees = dailySupplySideRevenue.clone(); @@ -63,7 +71,7 @@ async function fetch(_a: any, _b: any, options: FetchOptions) { const methodology = { Fees: "Includes Market Effective Yield(MEY) earned by treehouse assets and redemption fee", - Revenue: "Standard Redemption(7 days waiting) fee of 0.05%,Fastlane redemption fee of 2% and 20% performance fee on MEY", + Revenue: "Standard Redemption(7 days waiting(tEth), 17 days waiting(tAvax)) fee of 0.05%,Fastlane redemption fee of 2%(tEth), 4%(tAvax) and 20% performance fee on MEY", ProtocolRevenue: "All the revenue goes to protocol treasury", HoldersRevenue: "No fee sharing to holders yet", SupplySideRevenue: "MEY earned by treehouse asset holders post performance fee", @@ -86,10 +94,12 @@ const breakdownMethodology = { const adapter: SimpleAdapter = { fetch, - chains: [CHAIN.ETHEREUM], methodology, breakdownMethodology, - start: '2024-09-10' + adapter: { + [CHAIN.ETHEREUM]: { start: '2024-09-10' }, + [CHAIN.AVAX]: { start: '2025-08-28' } + } }; export default adapter; \ No newline at end of file From 45d468aaf5b12b48b72bd7131e0df439554333b7 Mon Sep 17 00:00:00 2001 From: g1nt0ki <99907941+g1nt0ki@users.noreply.github.com> Date: Wed, 17 Sep 2025 10:11:02 +0200 Subject: [PATCH 4/4] minor fix --- fees/treehouse-protocol/index.ts | 70 ++++++++++++-------------------- 1 file changed, 25 insertions(+), 45 deletions(-) diff --git a/fees/treehouse-protocol/index.ts b/fees/treehouse-protocol/index.ts index ee3782b518..3e91ab330a 100644 --- a/fees/treehouse-protocol/index.ts +++ b/fees/treehouse-protocol/index.ts @@ -8,56 +8,41 @@ const EVENT_ABI = { FASTLANE_REDEMPTION: "event Redeemed (address indexed user, uint256 shares, uint256 assets, uint256 fee)" }; -const ADDRESSES = { +const ADDRESSES: any = { [CHAIN.ETHEREUM]: { - TREEHOUSE_ACCOUNTING: "0xb7Ce3cb5Bc5c00cd2f9B39d9b0580f5355535709", - TREEHOUSE_TOKEN: "0xD11c452fc99cF405034ee446803b6F6c1F6d5ED8", //tEth - TREEHOUSE_REDEMPTION: "0xcd63a29FAfF07130d3Af89bB4f40778938AaBB85", - TREEHOUSE_FASTLANE_REDEMPTION: "0x829525417Cd78CBa0f99A8736426fC299506C0d6", - STAKED_TOKEN: "0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0" // Lido wstEth + accounting: "0xb7Ce3cb5Bc5c00cd2f9B39d9b0580f5355535709", + token: "0xD11c452fc99cF405034ee446803b6F6c1F6d5ED8", //tEth + redemption: "0xcd63a29FAfF07130d3Af89bB4f40778938AaBB85", + fastlaneRedemption: "0x829525417Cd78CBa0f99A8736426fC299506C0d6", + stakedToken: "0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0" // Lido wstEth }, [CHAIN.AVAX]: { - TREEHOUSE_ACCOUNTING: "0x6f5D00a263dE6d40B4b2342996D2682E34f8A454", - TREEHOUSE_TOKEN: "0x14a84f1a61ccd7d1be596a6cc11fe33a36bc1646", //tAvax - TREEHOUSE_REDEMPTION: "0x765f6dc8496ca7EF1e4a391bE10185229AACf04b", - TREEHOUSE_FASTLANE_REDEMPTION: "0x3D00a639183B07e35EFEF044eE6cC14e8598A01c", - STAKED_TOKEN: "0x2b2c81e08f1af8835a78bb2a90ae924ace0ea4be" //benqi sAvax + accounting: "0x6f5D00a263dE6d40B4b2342996D2682E34f8A454", + token: "0x14a84f1a61ccd7d1be596a6cc11fe33a36bc1646", //tAvax + redemption: "0x765f6dc8496ca7EF1e4a391bE10185229AACf04b", + fastlaneRedemption: "0x3D00a639183B07e35EFEF044eE6cC14e8598A01c", + stakedToken: "0x2b2c81e08f1af8835a78bb2a90ae924ace0ea4be" //benqi sAvax } }; -async function fetch(_a: any, _b: any, options: FetchOptions) { - let dailyFees = options.createBalances(); - const dailySupplySideRevenue = options.createBalances(); - const dailyProtocolRevenue = options.createBalances(); - const markedLogs = await options.getLogs({ - target: ADDRESSES[options.chain as keyof typeof ADDRESSES].TREEHOUSE_ACCOUNTING, - eventAbi: EVENT_ABI.MARKED, - }); - - markedLogs.forEach(log => { - dailySupplySideRevenue.add(ADDRESSES[options.chain as keyof typeof ADDRESSES].TREEHOUSE_TOKEN, log.amount); - dailyProtocolRevenue.add(ADDRESSES[options.chain as keyof typeof ADDRESSES].TREEHOUSE_TOKEN, log.fees); - }); +async function fetch(_a: any, _b: any, { chain, createBalances, getLogs, }: FetchOptions) { + const { accounting, token, redemption, fastlaneRedemption, stakedToken } = ADDRESSES[chain] + const dailySupplySideRevenue = createBalances(); + const dailyProtocolRevenue = createBalances(); - const standardRedemptionLogs = await options.getLogs({ - target: ADDRESSES[options.chain as keyof typeof ADDRESSES].TREEHOUSE_REDEMPTION, - eventAbi: EVENT_ABI.STANDARD_REDEMPTION - }); - - standardRedemptionLogs.forEach(log => { - dailyProtocolRevenue.add(ADDRESSES[options.chain as keyof typeof ADDRESSES].TREEHOUSE_TOKEN, log.fee) - }); + const markedLogs = await getLogs({ target: accounting, eventAbi: EVENT_ABI.MARKED, }); + const standardRedemptionLogs = await getLogs({ target: redemption, eventAbi: EVENT_ABI.STANDARD_REDEMPTION }); + const fastlaneRedemptionLogs = await getLogs({ target: fastlaneRedemption, eventAbi: EVENT_ABI.FASTLANE_REDEMPTION }); + - const fastlaneRedemptionLogs = await options.getLogs({ - target: ADDRESSES[options.chain as keyof typeof ADDRESSES].TREEHOUSE_FASTLANE_REDEMPTION, - eventAbi: EVENT_ABI.FASTLANE_REDEMPTION - }); - - fastlaneRedemptionLogs.forEach(log => { - dailyProtocolRevenue.add(ADDRESSES[options.chain as keyof typeof ADDRESSES].STAKED_TOKEN, log.fee) + markedLogs.forEach(log => { + dailySupplySideRevenue.add(token, log.amount, METRIC.ASSETS_YIELDS); + dailyProtocolRevenue.add(token, log.fees, METRIC.PERFORMANCE_FEES); }); + standardRedemptionLogs.forEach(log => dailyProtocolRevenue.add(token, log.fee, METRIC.MINT_REDEEM_FEES)); + fastlaneRedemptionLogs.forEach(log => dailyProtocolRevenue.add(stakedToken, log.fee, METRIC.MINT_REDEEM_FEES)); - dailyFees = dailySupplySideRevenue.clone(); + const dailyFees = dailySupplySideRevenue.clone(); dailyFees.add(dailyProtocolRevenue); return { @@ -78,11 +63,6 @@ const methodology = { }; const breakdownMethodology = { - Fees: { - [METRIC.ASSETS_YIELDS]: 'Total market effective yields earned by treehouse strategies', - [METRIC.MINT_REDEEM_FEES]: 'Standard and fastlane redemption fees', - [METRIC.PERFORMANCE_FEES]: '20% perfomance fees on MEY only when MEY is positive' - }, Revenue: { [METRIC.MINT_REDEEM_FEES]: 'Standard and fastlane redemption fees', [METRIC.PERFORMANCE_FEES]: '20% perfomance fees on MEY only when MEY is positive'