Skip to content

Commit

Permalink
add ethena extra fees
Browse files Browse the repository at this point in the history
  • Loading branch information
0xngmi committed Nov 7, 2024
1 parent c08f8b2 commit 7c07804
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions fees/ethena.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ const fetch = async (_t:number, _c:any, options: FetchOptions) => {
]] as any,
}))[0]

const extra_fees_to_distribute = (await options.getLogs({
targets: [usdt],
flatten: false,
eventAbi: 'event Transfer (address indexed from, address indexed to, uint256 value)',
topics: ['0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef', null, [
ethers.zeroPadValue("0xd0ec8cc7414f27ce85f8dece6b4a58225f273311", 32),
]] as any,
}))[0]

const dailyFeesInflow = options.createBalances();
const supplyRewards = options.createBalances();

Expand All @@ -42,6 +51,11 @@ const fetch = async (_t:number, _c:any, options: FetchOptions) => {
const amount = Number(log.value);
supplyRewards.add(usdt, amount);
});
extra_fees_to_distribute.map((log: any) => {
const amount = Number(log.value);
dailyFeesInflow.add(usdt, amount);
supplyRewards.add(usdt, amount);
});
const dailyFeesMint = options.createBalances();
logs.map((log) => {
dailyFeesMint.add(log.collateral_asset, log.collateral_amount);
Expand Down

0 comments on commit 7c07804

Please sign in to comment.