From f92b3b8277b45c4e029d3370f05a59c6297b4cbb Mon Sep 17 00:00:00 2001 From: jacksmithinsulander <666.jack.smith@protonmail.com> Date: Tue, 31 Dec 2024 12:48:26 +0100 Subject: [PATCH] added sonic, virtuals and solana --- fees/blazingbot.ts | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/fees/blazingbot.ts b/fees/blazingbot.ts index 40058c8ffb..53b5883ee7 100644 --- a/fees/blazingbot.ts +++ b/fees/blazingbot.ts @@ -1,16 +1,28 @@ import { FetchOptions, SimpleAdapter } from "../adapters/types"; import { CHAIN } from "../helpers/chains"; +import { getSolanaReceived } from "../helpers/token"; + +const fethcFeesSolana = async (options: FetchOptions) => { + const dailyFees = await getSolanaReceived({ options, target: '47hEzz83VFR23rLTEeVm9A7eFzjJwjvdupPPmX3cePqF' }) + return { dailyFees, dailyRevenue: dailyFees, } +} const v2_contract_address: any = { [CHAIN.BSC]: '0xfdb7eF80BD6aB675CD52811BfB9329FbD9B92aBA', [CHAIN.BASE]: '0x6882912e2580471E5ac7a928a4f52F0bD2701810', [CHAIN.ETHEREUM]: '0xfdb7ef80bd6ab675cd52811bfb9329fbd9b92aba', + [CHAIN.SONIC]: '0xE47809790a0cE703c2AC81598c90d5cC1569675d', } const v3_contract_address: any = { [CHAIN.BSC]: '0xB23495f9a4807cD7672f382B9b0c2a3A0ec78649', [CHAIN.BASE]: '0xE47809790a0cE703c2AC81598c90d5cC1569675d', [CHAIN.ETHEREUM]: '0x196f75367A9286E039C6CFEBa5B8686ed84cBa68', + [CHAIN.SONIC]: '0xB23495f9a4807cD7672f382B9b0c2a3A0ec78649', +} + +const virtual_contract_address: any = { + [CHAIN.BASE]: '0x803A70b24062e429Ce48801a0fAb6B13a994A454', } const fetchFees = async (options: FetchOptions) => { @@ -36,6 +48,21 @@ const fetchFees = async (options: FetchOptions) => { dailyRevenue.addGasToken(Number(log.data)); }); + if (options.chain === CHAIN.BASE) { + const logsVirtual = await options.getLogs({ + topic: '0xac73d170101ac263d42f3626a4a5142cdae6d109e48d6310c276b1fd1f5f3854', + target: virtual_contract_address[options.chain], + }); + + logsVirtual.map((log: any) => { + dailyFees.addGasToken(Number(log.data)); + dailyRevenue.addGasToken(Number(log.data)); + }); + } + + console.log("Daily fees: ", dailyFees); + console.log("Daily revenue: ", dailyRevenue); + return { dailyFees: dailyFees, dailyRevenue: dailyRevenue, @@ -57,7 +84,17 @@ const adapter: SimpleAdapter = { fetch: fetchFees, start: '2024-03-01', }, + [CHAIN.SONIC]: { + fetch: fetchFees, + start: '2024-12-15', + }, + [CHAIN.SOLANA]: { + fetch: fethcFeesSolana, + runAtCurrTime: true, + start: '2024-11-23', + }, }, + isExpensiveAdapter: true, }; export default adapter; \ No newline at end of file