Skip to content

orbiter finnce #2704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions fees/orbiter-finance.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { FetchOptions, SimpleAdapter } from "../adapters/types";
import { CHAIN } from "../helpers/chains";

const opoolContract = '0x68b5a1c02dea0958388eee5361f021018bd8dbe7'
const event_indexbox = 'event Inbox(address indexed bridgeReceiver,address indexed bridgeToken,address indexed feeReceiver,address feeToken,uint256 feeAmount,uint256 bridgeAmount,bytes data)'
const fetch = async (options: FetchOptions) => {
const dailyFees = options.createBalances()
const logs = await options.getLogs({
eventAbi: event_indexbox,
target: opoolContract,
})
logs.forEach((log: any) => dailyFees.add(log.feeToken, log.feeAmount))
return { dailyFees }
}

const adapter: SimpleAdapter = {
version: 2,
adapter: {
[CHAIN.ETHEREUM]: {
fetch,
start: '2024-12-06',
},
[CHAIN.OPTIMISM]: {
fetch,
start: '2024-12-06',
},
[CHAIN.BASE]: {
fetch,
start: '2024-12-06',
},
[CHAIN.ARBITRUM]: {
fetch,
start: '2024-12-06',
},
[CHAIN.POLYGON]: {
fetch,
start: '2024-12-06',
},
[CHAIN.BSC]: {
fetch,
start: '2024-12-06',
},
[CHAIN.BLAST]: {
fetch,
start: '2024-12-06',
},
},
}
export default adapter
Loading