Skip to content

Commit

Permalink
Merge pull request DefiLlama#1266 from DefiLlama/blats-fees
Browse files Browse the repository at this point in the history
add blast
  • Loading branch information
dtmkeng authored Mar 5, 2024
2 parents 0fc7448 + a791bea commit 88cea39
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion fees/banana-gun-trading.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const fetch: any = async (timestamp: number, _: any, options: FetchOptions): Pro
FROM
ethereum.event_logs
WHERE
block_number > 17345415
block_number > 19170281
AND contract_address IN (
SELECT DISTINCT address
FROM ethereum.traces
Expand Down Expand Up @@ -64,6 +64,25 @@ const fethcFeesSolana = async (timestamp: number, _: ChainBlocks, options: Fetch
}
}

const fetchBlats = async (timestamp: number, _: ChainBlocks, options: FetchOptions): Promise<FetchResultFees> => {
const dailyFees = options.createBalances();
const dailyRevenue = options.createBalances();
const logs = await options.getLogs({
topic: '0x72015ace03712f361249380657b3d40777dd8f8a686664cab48afd9dbbe4499f',
target: '0x461efe0100be0682545972ebfc8b4a13253bd602',
});
logs.map((log: any) => {
const data = log.data.replace('0x', '');
const gasToken = data.slice(0, 64);
dailyFees.addGasToken(Number('0x' + gasToken));
});
return {
dailyFees: dailyFees,
dailyRevenue: dailyRevenue,
timestamp
}
}

const adapter: SimpleAdapter = {
adapter: {
[CHAIN.ETHEREUM]: {
Expand All @@ -75,6 +94,10 @@ const adapter: SimpleAdapter = {
runAtCurrTime: true,
start: 1685577600,
},
[CHAIN.BLAST]: {
fetch: fetchBlats,
start: 1685577600,
}
},
isExpensiveAdapter: true,
};
Expand Down

0 comments on commit 88cea39

Please sign in to comment.