Skip to content

Commit

Permalink
Import ADDRESSES from coreAssets.json in multiple files
Browse files Browse the repository at this point in the history
  • Loading branch information
g1nt0ki committed Feb 10, 2024
1 parent 517e318 commit af9e464
Show file tree
Hide file tree
Showing 64 changed files with 215 additions and 151 deletions.
3 changes: 2 additions & 1 deletion aggregators/arcane-dex/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ADDRESSES from '../../helpers/coreAssets.json'

import request from "graphql-request"
import { FetchResultVolume, SimpleAdapter } from "../../adapters/types"
Expand Down Expand Up @@ -38,7 +39,7 @@ const fetchVolume = async (timestamp: number): Promise<FetchResultVolume> => {
}
`
const result: IResponse = await request("https://api.thegraph.com/subgraphs/name/0xandee/arcanedex", query)
const ethAddress = "ethereum:0x0000000000000000000000000000000000000000";
const ethAddress = "ethereum:" + ADDRESSES.null;

const dailyVolumeInEth = Number(result.today.totalVolumeInEth) - Number(result.yesterday.totalVolumeInEth)
const totalVolumeInEth = Number(result.today.totalVolumeInEth)
Expand Down
3 changes: 2 additions & 1 deletion dexs/kyberswap/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ADDRESSES from '../../helpers/coreAssets.json'
import request from "graphql-request";
import { BaseAdapter, BreakdownAdapter, FetchResultVolume } from "../../adapters/types";
import { CHAIN } from "../../helpers/chains";
Expand Down Expand Up @@ -97,7 +98,7 @@ const optimismElastic = async (timestamp: number) => {
const url = "https://api.thegraph.com/subgraphs/name/kybernetwork/kyberswap-elastic-optimism";
const blacklisted = [
'0xa00e3a3511aac35ca78530c85007afcd31753819',
'0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9',
ADDRESSES.optimism.sUSD,
'0xb448ec505c924944ca8b2c55ef05c299ee0781df'
]
const poolBlacklist = [
Expand Down
5 changes: 3 additions & 2 deletions dexs/pingu/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ADDRESSES from '../../helpers/coreAssets.json'
import { FetchResult, SimpleAdapter } from "../../adapters/types";
import { CHAIN } from "../../helpers/chains";
import { gql, request } from "graphql-request";
Expand All @@ -24,8 +25,8 @@ const fetch = async (timestamp: number): Promise<FetchResult> => {
}`;
const response: IGraph = (await request(URL, query)).dayData;
const element = response;
balances._add('0xaf88d065e77c8cc2239327c5edb3a432268e5831', element.volumeUsdc);
balances._add('0x82af49447d8a07e3bd95bd0d56f35241523fbab1', element.volumeEth);
balances._add(ADDRESSES.arbitrum.USDC_CIRCLE, element.volumeUsdc);
balances._add(ADDRESSES.arbitrum.WETH, element.volumeEth);

return {
dailyVolume: await balances.getUSDString(),
Expand Down
5 changes: 3 additions & 2 deletions dexs/saber/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import ADDRESSES from '../../helpers/coreAssets.json'
import { httpPost } from "../../utils/fetchURL";
import { getPrices } from "../../utils/prices";

async function last24h(timestamp: number) {
const data = await httpPost('https://saberqltest.aleph.cloud/', { "query": "{\n pools {\n ammId\n name\n coin {\n chainId\n address\n name\n decimals\n symbol\n logoURI\n }\n pc {\n chainId\n address\n name\n decimals\n symbol\n logoURI\n }\n lp {\n chainId\n address\n name\n decimals\n symbol\n logoURI\n }\n stats {\n tvl_pc\n tvl_coin\n price\n vol24h\n }\n }\n}\n" })
const coinId = "solana:So11111111111111111111111111111111111111112";
const coinId = "solana:" + ADDRESSES.solana.SOL;
const prices = await getPrices([coinId], timestamp)
const vol = data.data.pools.reduce(
(a: number, b: any) =>
a + b.stats.vol24h *
(b.pc.address === "So11111111111111111111111111111111111111112" ? prices[coinId].price : 1)
(b.pc.address === ADDRESSES.solana.SOL ? prices[coinId].price : 1)
, 0)
return {
dailyVolume: vol,
Expand Down
9 changes: 5 additions & 4 deletions dexs/shell-protocol/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import ADDRESSES from '../../helpers/coreAssets.json'
import { SimpleAdapter } from "../../adapters/types";
import { CHAIN } from "../../helpers/chains";
import * as sdk from "@defillama/sdk";
import { getBlock } from "../../helpers/getBlock";
import BigNumber from "bignumber.js";
import { getPrices } from "../../utils/prices";

const DAI_CONTRACT = '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1';
const USDC_CONTRACT = '0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8';
const USDT_CONTRACT = '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9';
const WBTC_CONTRACT = '0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f';
const DAI_CONTRACT = ADDRESSES.optimism.DAI;
const USDC_CONTRACT = ADDRESSES.arbitrum.USDC;
const USDT_CONTRACT = ADDRESSES.arbitrum.USDT;
const WBTC_CONTRACT = ADDRESSES.arbitrum.WBTC;

const topic = 'Transfer (index_topic_1 address from, index_topic_2 address to, uint256 value)';
const topic0 = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef';
Expand Down
33 changes: 17 additions & 16 deletions dexs/synfutures-v2/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ADDRESSES from '../../helpers/coreAssets.json'
import { Chain } from "@defillama/sdk/build/general";
import { getUniqStartOfTodayTimestamp } from "../../helpers/getUniSubgraphVolume";
import { getBlock } from "../../helpers/getBlock";
Expand All @@ -12,20 +13,20 @@ type TContracts = {
};
const contracts: TContracts = {
[CHAIN.POLYGON]: [
['0x89cf9a71d45c58673a7f8b4c829df466da7a473a','0x7ceb23fd6bc0add59e62ac25578270cff1b9f619'],
['0xa40986ccd9dc00c533ba71c9362529c9694f9f7b','0x2791bca1f2de4661ed88a30c99a7a9449aa84174'],
['0xf479405a2518b02a79c060f3d91fe0c98cfe6e25','0x2791bca1f2de4661ed88a30c99a7a9449aa84174'],
['0x64b8b618cddc31c61305338c6ab7a2d85a7ab5ca','0x2791bca1f2de4661ed88a30c99a7a9449aa84174'],
['0x19759660e5ee693df6105fc3629d5d91cb0a9447','0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270'],
['0xbda26f37656218b2b3983800bc5734998445cc92','0x2791bca1f2de4661ed88a30c99a7a9449aa84174'],
['0x4b6e851015581e88824f1efd71cb65dd9826189b','0x2791bca1f2de4661ed88a30c99a7a9449aa84174'],
['0x4baa9f1af8653a875d51324ca563d12d7925adf5','0x2791bca1f2de4661ed88a30c99a7a9449aa84174'],
['0x8c7822f283137e1e73ea0bdc537ccfb2fa1fb030','0x2791bca1f2de4661ed88a30c99a7a9449aa84174'],
['0x13f7f23db676431a2371d0f1884ae1526a0fe5c2','0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270'],
['0xb09d2ec9afff13589ddfab190e2d1aba7e02095b','0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270'],
['0x6909bfbe79f9c33589c637eed166a32afea76ef6','0x2791bca1f2de4661ed88a30c99a7a9449aa84174'],
['0xf51dcd52bd075c91632aac42c3926b2a523b3da5','0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270'],
['0x9ceeb2a6f17d3c7bd086471095fcf80cfe780149','0x7ceb23fd6bc0add59e62ac25578270cff1b9f619'],
['0x89cf9a71d45c58673a7f8b4c829df466da7a473a',ADDRESSES.polygon.WETH_1],
['0xa40986ccd9dc00c533ba71c9362529c9694f9f7b',ADDRESSES.polygon.USDC],
['0xf479405a2518b02a79c060f3d91fe0c98cfe6e25',ADDRESSES.polygon.USDC],
['0x64b8b618cddc31c61305338c6ab7a2d85a7ab5ca',ADDRESSES.polygon.USDC],
['0x19759660e5ee693df6105fc3629d5d91cb0a9447',ADDRESSES.polygon.WMATIC_2],
['0xbda26f37656218b2b3983800bc5734998445cc92',ADDRESSES.polygon.USDC],
['0x4b6e851015581e88824f1efd71cb65dd9826189b',ADDRESSES.polygon.USDC],
['0x4baa9f1af8653a875d51324ca563d12d7925adf5',ADDRESSES.polygon.USDC],
['0x8c7822f283137e1e73ea0bdc537ccfb2fa1fb030',ADDRESSES.polygon.USDC],
['0x13f7f23db676431a2371d0f1884ae1526a0fe5c2',ADDRESSES.polygon.WMATIC_2],
['0xb09d2ec9afff13589ddfab190e2d1aba7e02095b',ADDRESSES.polygon.WMATIC_2],
['0x6909bfbe79f9c33589c637eed166a32afea76ef6',ADDRESSES.polygon.USDC],
['0xf51dcd52bd075c91632aac42c3926b2a523b3da5',ADDRESSES.polygon.WMATIC_2],
['0x9ceeb2a6f17d3c7bd086471095fcf80cfe780149',ADDRESSES.polygon.WETH_1],
]
}

Expand Down Expand Up @@ -106,8 +107,8 @@ const fetchVolume = (chain: Chain) => {

// getPrices API currently has a bug that it doesn't return price for polygon:0x2791bca1f2de4661ed88a30c99a7a9449aa84174 (USDC) for some reason
// so we set it as 1 manually to temporarily fix this issue
if (!prices['polygon:0x2791bca1f2de4661ed88a30c99a7a9449aa84174']) {
prices['polygon:0x2791bca1f2de4661ed88a30c99a7a9449aa84174'] = {
if (!prices['polygon:' + ADDRESSES.polygon.USDC]) {
prices['polygon:' + ADDRESSES.polygon.USDC] = {
symbol: 'USDC',
timestamp: now,
price: 1,
Expand Down
3 changes: 2 additions & 1 deletion dexs/tokenlon/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ADDRESSES from '../../helpers/coreAssets.json'
import { FetchResultVolume, SimpleAdapter } from "../../adapters/types";
import { CHAIN } from "../../helpers/chains";
import { gql, request } from "graphql-request";
Expand Down Expand Up @@ -44,7 +45,7 @@ const fetchVolume = (chain: Chain) => {
const coins = [...new Set(historicalData.map((e: IGraph) => `${chain}:${e.makerAssetAddr}`))]
const prices = await getPrices(coins, toTimestamp);
if (!prices[`ethereum:0x3212b29e33587a00fb1c83346f5dbfa69a458923`]) {
prices[`ethereum:0x3212b29e33587a00fb1c83346f5dbfa69a458923`] = prices[`ethereum:0x2260fac5e5542a773aa44fbcfedf7c193bc2c599`] // imBTC
prices[`ethereum:0x3212b29e33587a00fb1c83346f5dbfa69a458923`] = prices[`ethereum:` + ADDRESSES.ethereum.WBTC] // imBTC
}
const dailyVolume = historicalData.map((e: IGraph) => {
const price = prices[`${chain}:${e.makerAssetAddr}`]?.price || 0;
Expand Down
3 changes: 2 additions & 1 deletion dexs/xfai/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import ADDRESSES from '../../helpers/coreAssets.json'
import { CHAIN } from "../../helpers/chains";
import { ChainApi } from "@defillama/sdk";
import { FetchResult, SimpleAdapter } from "../../adapters/types";
import { getBlock } from "../../helpers/getBlock";

const FACTORY_ADDRESS = "0xa5136eAd459F0E61C99Cec70fe8F5C24cF3ecA26";
const INFT_ADDRESS = "0xa155f12D3Be29BF20b615e1e7F066aE9E3C5239a";
const LINEA_WETH_ADDRESS = "0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f";
const LINEA_WETH_ADDRESS = ADDRESSES.linea.WETH;
const ONE_DAY_IN_SECONDS = 60 * 60 * 24;
const FEE_VOLUME_MULTIPLIER = 1000 / 2;

Expand Down
3 changes: 2 additions & 1 deletion dexs/y2k/y2k-finance.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import ADDRESSES from '../../helpers/coreAssets.json'
import { FetchOptions, FetchResultVolume } from "../../adapters/types";

const vault_factory = "0x984e0eb8fb687afa53fc8b33e12e04967560e092";
const WETH = "0x82af49447d8a07e3bd95bd0d56f35241523fbab1";
const WETH = ADDRESSES.arbitrum.WETH;
const event_deposit = "event Deposit (address indexed user, address indexed receiver, uint256 id, uint256 assets)";

const abis: any = {
Expand Down
3 changes: 2 additions & 1 deletion fees/Scale.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ADDRESSES from '../helpers/coreAssets.json'
import { FetchResultFees, SimpleAdapter } from "../adapters/types";
import { CHAIN } from "../helpers/chains";
import * as sdk from "@defillama/sdk";
Expand Down Expand Up @@ -93,7 +94,7 @@ const fetch = async (timestamp: number): Promise<FetchResultFees> => {
});

const voterGauges = poolsGauges.filter((_vg: string) =>
_vg !== '0x0000000000000000000000000000000000000000'
_vg !== ADDRESSES.null
);


Expand Down
5 changes: 3 additions & 2 deletions fees/aerodrome/bribes.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ADDRESSES from '../../helpers/coreAssets.json'
import * as sdk from "@defillama/sdk";
import { getPrices } from "../../utils/prices";
import { ethers } from "ethers";
Expand Down Expand Up @@ -37,10 +38,10 @@ const abis: any = {
}

export const fees_bribes = async (fromBlock: number, toBlock: number, timestamp: number): Promise<number> => {
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
const ZERO_ADDRESS = ADDRESSES.null;
const bribeVotingReward: string[] = (await sdk.api2.abi.call({
target: gurar,
params: [1000, 0, '0x0000000000000000000000000000000000000000'],
params: [1000, 0, ADDRESSES.null],
abi: abis.all,
chain: CHAIN.BASE,
})).map((e: any) => {
Expand Down
7 changes: 4 additions & 3 deletions fees/amphor/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ADDRESSES from '../../helpers/coreAssets.json'
import * as sdk from "@defillama/sdk";
import { ethers, EventFilter } from 'ethers';

Expand Down Expand Up @@ -156,9 +157,9 @@ const data = async (timestamp: number): Promise<FetchResultFees> => {
});

const TOKENS = {
USDC: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
WSTETH: "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0",
WBTC: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
USDC: ADDRESSES.ethereum.USDC,
WSTETH: ADDRESSES.ethereum.WSTETH,
WBTC: ADDRESSES.ethereum.WBTC,
}
const totalFees = new sdk.Balances({ chain: CHAIN.ETHEREUM, timestamp: toTimestamp });
const totalRevenue = new sdk.Balances({ chain: CHAIN.ETHEREUM, timestamp: toTimestamp });
Expand Down
3 changes: 2 additions & 1 deletion fees/basepaint.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import ADDRESSES from '../helpers/coreAssets.json'
import { FetchOptions, FetchResultFees, SimpleAdapter } from "../adapters/types"
import { CHAIN } from "../helpers/chains"

const contract = '0xBa5e05cb26b78eDa3A2f8e3b3814726305dcAc83'
const eventAbi = 'event ArtistsEarned(uint256 indexed day,uint256 amount)';
const protocol_fees = 10; // 10% fees

const ethAddress = "0x0000000000000000000000000000000000000000";
const ethAddress = ADDRESSES.null;

const fetch: any = async (timestamp: number, _: any, { getLogs, createBalances, }: FetchOptions): Promise<FetchResultFees> => {
const logs = await getLogs({ target: contract, eventAbi })
Expand Down
3 changes: 2 additions & 1 deletion fees/blazebot.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ADDRESSES from '../helpers/coreAssets.json'
import {Adapter, FetchResultFees} from "../adapters/types";
import {CHAIN} from "../helpers/chains";
import {Chain} from "@defillama/sdk/build/general";
Expand Down Expand Up @@ -34,7 +35,7 @@ const graphs = (chain: Chain) => {
`
const graphRes: ISwap[] = (await request(endpoints[chain], query)).fees;

const ethAddress = "ethereum:0x0000000000000000000000000000000000000000";
const ethAddress = "ethereum:" + ADDRESSES.null;
const ethPrice = (await getPrices([ethAddress], timestamp))[ethAddress].price;
const dailyFees = graphRes.map((e: ISwap) => {
const decimals = 18;
Expand Down
3 changes: 2 additions & 1 deletion fees/bsc.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ADDRESSES from '../helpers/coreAssets.json'
import { Adapter, ProtocolType } from "../adapters/types";
import { BSC } from "../helpers/chains";
import { request, gql } from "graphql-request";
Expand Down Expand Up @@ -38,7 +39,7 @@ const graphs = (graphUrls: ChainEndpoints) => {

const dailyFee = new BigNumber(graphRes["today"]["totalFees"]).minus(new BigNumber(graphRes["yesterday"]["totalFees"]))

const bnbAddress = "bsc:0x0000000000000000000000000000000000000000";
const bnbAddress = "bsc:" + ADDRESSES.null;
const pricesObj: any = await getPrices([bnbAddress], todaysTimestamp);
const latestPrice = new BigNumber(pricesObj[bnbAddress]["price"])

Expand Down
3 changes: 2 additions & 1 deletion fees/caviar-tangible.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ADDRESSES from '../helpers/coreAssets.json'
import { FetchResultFees, SimpleAdapter } from "../adapters/types"
import { CHAIN } from "../helpers/chains"
import { getBlock } from "../helpers/getBlock";
Expand All @@ -6,7 +7,7 @@ import * as sdk from "@defillama/sdk";
const topic0_evt_transfer = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef';
const topic1_evt_transfer = '0x000000000000000000000000bbc843dcb1009bc7dc988bceb5bb1b50299d9a6d';
const topic2_evt_transfer = '0x0000000000000000000000006ced48efbb581a141667d7487222e42a3fa17cf7';
const usdc = '0x2791bca1f2de4661ed88a30c99a7a9449aa84174';
const usdc = ADDRESSES.polygon.USDC;

interface ILog {
data: string;
Expand Down
3 changes: 2 additions & 1 deletion fees/chainlink-ccip.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ADDRESSES from '../helpers/coreAssets.json'
import { Chain } from "@defillama/sdk/build/general";
import { FetchResultFees, SimpleAdapter } from "../adapters/types";
import { CHAIN } from "../helpers/chains";
Expand Down Expand Up @@ -105,7 +106,7 @@ const fetchFees = (chain: Chain) => {
address: addressString,
}
});
const linkETH = `${CHAIN.ETHEREUM}:0x514910771af9ca656af840dff83e8264ecf986ca`
const linkETH = `${CHAIN.ETHEREUM}:${ADDRESSES.ethereum.LINK}`;
const coins = [...new Set(rawData.map((e: any) => `${chain}:${e.address}`)), linkETH];
const prices = await getPrices(coins, timestamp);
const dailyFees = rawData.reduce((acc: number, { amount, address }: any) => {
Expand Down
1 change: 1 addition & 0 deletions fees/chainlink-keepers.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ADDRESSES from '../helpers/coreAssets.json'
import { SimpleAdapter, ChainBlocks, FetchResultFees, IJSON } from "../adapters/types";
import { CHAIN } from "../helpers/chains";
import { getPrices } from "../utils/prices";
Expand Down
3 changes: 2 additions & 1 deletion fees/cow-protocol.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ADDRESSES from '../helpers/coreAssets.json'
import { Adapter, FetchOptions, FetchResultFees } from "../adapters/types";
import { CHAIN } from "../helpers/chains";
import { Chain, } from "@defillama/sdk/build/general";
Expand Down Expand Up @@ -37,7 +38,7 @@ const fetch = (chain: Chain) => {
AND ethereum.event_logs.block_time BETWEEN llama_replace_date_range
GROUP by sum`, options);

gasUsed.map((e: any) => dailyRevenue.add('0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', e.sum * -1 / e._count))
gasUsed.map((e: any) => dailyRevenue.add(ADDRESSES.ethereum.WETH, e.sum * -1 / e._count))
}

return { dailyUserFees: dailyFees, dailyFees, dailyRevenue, timestamp }
Expand Down
1 change: 1 addition & 0 deletions fees/crv-usd.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ADDRESSES from '../helpers/coreAssets.json'
import { Chain } from "@defillama/sdk/build/general";
import { FetchResultFees, SimpleAdapter } from "../adapters/types";
import { CHAIN } from "../helpers/chains";
Expand Down
3 changes: 2 additions & 1 deletion fees/equalizer-exchange.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ADDRESSES from '../helpers/coreAssets.json'
import { FetchResultFees, SimpleAdapter } from "../adapters/types";
import { CHAIN } from "../helpers/chains";
import * as sdk from "@defillama/sdk";
Expand Down Expand Up @@ -98,7 +99,7 @@ const fetch = async (timestamp: number): Promise<FetchResultFees> => {
});

const voterGauges = poolsGauges.filter((_vg: string) =>
_vg !== '0x0000000000000000000000000000000000000000'
_vg !== ADDRESSES.null
);


Expand Down
3 changes: 2 additions & 1 deletion fees/ethereum/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ADDRESSES from '../../helpers/coreAssets.json'
import { Adapter, ProtocolType } from "../../adapters/types";
import { ETHEREUM } from "../../helpers/chains";
import { getTimestampAtStartOfPreviousDayUTC, getTimestampAtStartOfDayUTC } from "../../utils/date";
Expand Down Expand Up @@ -28,7 +29,7 @@ const graphs = () => {
.filter(item => item.Timestamp === yesterdaysTimestamp)
.find(item => item)?.Result || 0

const ethAddress = "ethereum:0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2";
const ethAddress = "ethereum:" + ADDRESSES.ethereum.WETH;
const pricesObj: any = await getPrices([ethAddress], todaysTimestamp);
const latestPrice = new BigNumber(pricesObj[ethAddress]["price"])

Expand Down
3 changes: 2 additions & 1 deletion fees/foundation.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ADDRESSES from '../helpers/coreAssets.json'
import { Adapter, FetchResultFees } from "../adapters/types";
import { CHAIN } from "../helpers/chains";
import * as sdk from "@defillama/sdk";
Expand Down Expand Up @@ -113,7 +114,7 @@ const fetch = async (timestamp: number): Promise<FetchResultFees> => {
...logs_mint_from_fixed_price_drop,
...logs_withdraw_creator_revenue_from_dutch_auction,
]
const ethAddress = "ethereum:0x0000000000000000000000000000000000000000";
const ethAddress = "ethereum:" + ADDRESSES.null;
const ethPrice = (await getPrices([ethAddress], timestamp))[ethAddress].price;
const totalFees = total_logs.reduce((a: number, b: IFee) => a + b.totalFees, 0)
const dailyFees = totalFees * ethPrice
Expand Down
3 changes: 2 additions & 1 deletion fees/friend-room.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ADDRESSES from '../helpers/coreAssets.json'
import { Adapter, FetchResultFees, SimpleAdapter } from "../adapters/types";
import { CHAIN } from "../helpers/chains";
import * as sdk from "@defillama/sdk";
Expand Down Expand Up @@ -49,7 +50,7 @@ const fetch = async (timestamp: number): Promise<FetchResultFees> => {
})
const dailyFees = fees_details.reduce((a: number, b: IFee) => a + b.fees, 0)
const dailyRev = fees_details.reduce((a: number, b: IFee) => a + b.rev, 0)
const ethAddress = "ethereum:0x0000000000000000000000000000000000000000";
const ethAddress = "ethereum:" + ADDRESSES.null;
const ethPrice = (await getPrices([ethAddress], timestamp))[ethAddress].price;
const dailyFeesUSD = (dailyFees) * ethPrice;
const dailyRevUSD = (dailyRev) * ethPrice;
Expand Down
Loading

0 comments on commit af9e464

Please sign in to comment.