-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add goplus locker fee * fix INDEXA_DB not set error on gravity chain * fix INDEXA_DB not set error on morph chain * minor fix --------- Co-authored-by: Mr-Lucky <[email protected]> Co-authored-by: g1nt0ki <[email protected]>
- Loading branch information
1 parent
1b5bfae
commit a146a64
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { Adapter, FetchOptions, } from "../adapters/types"; | ||
import { CHAIN } from "../helpers/chains"; | ||
import { addTokensReceived } from "../helpers/token"; | ||
import ADDRESSES from '../helpers/coreAssets.json'; | ||
|
||
const CHAIN_CONFIG = { | ||
[CHAIN.ETHEREUM]: { start: 20790869 }, | ||
[CHAIN.BSC]: { start: 42387186 }, | ||
[CHAIN.BASE]: { start: 20014325 }, | ||
[CHAIN.ARBITRUM]: { start: 279127453 }, | ||
// [CHAIN.GRAVITY]: { start: 23719062 }, | ||
// [CHAIN.MORPH]: { start: 1125634 } | ||
} | ||
|
||
const fetch: any = async (options: FetchOptions) => { | ||
const dailyFees = options.createBalances(); | ||
|
||
// add native fee | ||
let feeTo = "0x521faAcDFA097ad35a32387727e468F7fD032fD6"; | ||
|
||
await options.api.sumTokens({ owner: feeTo, token: ADDRESSES.null }); | ||
await options.fromApi.sumTokens({ owner: feeTo, token: ADDRESSES.null }); | ||
dailyFees.addBalances(options.api.getBalancesV2()); | ||
dailyFees.subtract(options.fromApi.getBalancesV2()); | ||
|
||
await addTokensReceived({ balances: dailyFees, target: feeTo, options, }) | ||
|
||
|
||
return { dailyFees, dailyRevenue: dailyFees, dailyProtocolRevenue: dailyFees, } | ||
} | ||
|
||
const adapter: Adapter = { | ||
version: 2, | ||
adapter: { | ||
[CHAIN.ETHEREUM]: { fetch, start: '2024-09-20', }, | ||
[CHAIN.BSC]: { fetch, start: '2024-09-19', }, | ||
[CHAIN.BASE]: { fetch, start: '2024-09-20', }, | ||
[CHAIN.ARBITRUM]: { fetch, start: '2024-11-28', }, | ||
[CHAIN.GRAVITY]: { fetch, start: '2024-12-11', }, | ||
[CHAIN.MORPH]: { fetch, start: '2024-12-11', }, | ||
}, | ||
|
||
} | ||
|
||
export default adapter; |