Skip to content

Commit

Permalink
add arbitrum-nova;
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed Oct 9, 2024
1 parent 984e68e commit d8e31a7
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions fees/arbitrum-nova.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

import { ChainBlocks, FetchOptions, FetchResultFees, SimpleAdapter } from '../adapters/types';
import { CHAIN } from '../helpers/chains';
import ADDRESSES from '../helpers/coreAssets.json'

async function getFees(options: FetchOptions) {

const feeWallet = '0xc9722CfDDFbC6aF4E77023E8B5Bd87489EFEbf5F';
const l1FeeVault = '0x3B68a689c929327224dBfCe31C1bf72Ffd2559Ce';
const baseFeeVault = '0x9fCB6F75D99029f28F6F4a1d277bae49c5CAC79f';
const feeVaults = [l1FeeVault, baseFeeVault, feeWallet];

const { api, fromApi, createBalances } = options;
const balances = createBalances();
await api.sumTokens({ owners: feeVaults, tokens: [ADDRESSES.null] })
await fromApi.sumTokens({ owners: feeVaults, tokens: [ADDRESSES.null] })
balances.addBalances(api.getBalancesV2())
balances.subtract(fromApi.getBalancesV2())
return balances
}


const fetch = async (timestamp: number, _chainBlocks: ChainBlocks, options: FetchOptions): Promise<FetchResultFees> => {
const dailyFees = await getFees(options)

return { timestamp, dailyFees }
}

const adapter: SimpleAdapter = {
adapter: {
[CHAIN.ARBITRUM_NOVA]: {
fetch: fetch,
start: 1691971200,
}
}
}

export default adapter;

0 comments on commit d8e31a7

Please sign in to comment.