Skip to content
Draft
Changes from 5 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
34 changes: 34 additions & 0 deletions fees/WarpFinance/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { FetchOptions, SimpleAdapter } from "../../adapters/types";
import { CHAIN } from "../../helpers/chains";

const FeeCollectedEvent = "event FeesCollected(address indexed _token, address indexed _integrator, uint256 _integratorFee, uint256 _lifiFee)"

const WARPFeeCollector = '0x312a6be6bD9850D6a2F793b8425c39eFC01C3585';

const fetch = async (options: FetchOptions) => {
const dailyFees = options.createBalances();
const data: any[] = await options.getLogs({
target: WARPFeeCollector,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's Incorrect way to track the fees for Li.Fi wrappers. _integratorFee is the Fee for Li.FI so please fix that, or does Li.Fi charge same fee as integrator?

eventAbi: FeeCollectedEvent,
});
data.forEach((log: any) => {
dailyFees.add(log._token, log._integratorFee);
});
return { dailyFees, dailyRevenue: dailyFees, dailyProtocolRevenue: dailyFees };
};

const methodology = {
Fees: 'All fees paid by users for swap and bridge tokens via LI.FI.',
Revenue: 'Fees are distributed to Warp Finance and creators',
ProtocolRevenue: 'Fees are distributed to Warp Finance.',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as per the one of your tweet, it says 50% revenue will go to token creator and 50% to protocol, is that correct?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason my VScode didnt save the changes. I have updated the repo with

import { FetchOptions, SimpleAdapter } from "../../adapters/types";
import { CHAIN } from "../../helpers/chains";

const FeeCollectedEvent = "event FeesCollected(address indexed _token, address indexed _integrator, uint256 _integratorFee, uint256 _lifiFee)"

const WARPFeeCollector = '0x312a6be6bD9850D6a2F793b8425c39eFC01C3585';

const fetch = async (options: FetchOptions) => {
const dailyFees = options.createBalances();
const data: any[] = await options.getLogs({
target: WARPFeeCollector,
eventAbi: FeeCollectedEvent,
});
data.forEach((log: any) => {
dailyFees.add(log._token, log._integratorFee);
});
return { dailyFees, dailyRevenue: dailyFees, dailyProtocolRevenue: dailyFees };
};

const methodology = {
Fees: 'There is no fees in creating tokens. Creators pay Network fees only.',
Revenue: 'Revenue is generated via V3 Uniswap buy/sell 50% creators & 50% to Warp Finance.',
ProtocolRevenue: 'V3 Trading Fees are distributed to Warp Finance.',
}

const adapter: SimpleAdapter = {
version: 2,
fetch,
chains: [CHAIN.ETHEREUM],
start: '2023-07-27',
methodology
}

export default adapter;

}

const adapter: SimpleAdapter = {
version: 2,
fetch,
chains: [CHAIN.ETHEREUM],
start: '2023-07-27',
methodology
}

export default adapter;
Loading