Skip to content

Commit

Permalink
add xlayer
Browse files Browse the repository at this point in the history
  • Loading branch information
miler012 committed Aug 12, 2024
1 parent 70b8c1a commit c6eb1ba
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions dexs/satori/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const SCROLL_URL = 'https://scroll.satori.finance/api/data-center/pub/overview/i
const LINEA_URL = 'https://linea.satori.finance/api/data-center/pub/overview/integration'
const BASE_URL = 'https://base.satori.finance/api/data-center/pub/overview/integration'
const ARBITRUM_URL = 'https://arbitrum.satori.finance/api/data-center/pub/overview/integration'
const XLARY_URL = 'https://xlayer.satori.finance/api/data-center/pub/overview/integration'
interface VolumeInfo {
fee24h: string;
tradVol24h: string;
Expand All @@ -35,6 +36,9 @@ const base = {
const arbitrum = {
"exchange":"arbitrum-one"
}
const xlayer = {
"exchange":"xlayer"
}
const evm_fetch = async (_timestamp: number) => {
const volumeData: VolumeInfo = (await postURL(ZKEVM_URL,zk_evm)).data;

Expand Down Expand Up @@ -106,6 +110,18 @@ const arbitrum_fetch = async (_timestamp: number) => {
timestamp: parseInt(volumeData.time),
};
};

const xlayer_fetch = async (_timestamp: number) => {
const volumeData: VolumeInfo = (await postURL(XLARY_URL,xlayer)).data;

return {
totalVolume: volumeData.totalTradVol,
dailyVolume: volumeData.tradVol24h,
dailyFees: volumeData.fee24h,
dailyRevenue : volumeData.fee24h,
timestamp: parseInt(volumeData.time),
};
};
const adapter: SimpleAdapter = {
adapter: {
[CHAIN.POLYGON_ZKEVM]: {
Expand Down Expand Up @@ -137,6 +153,11 @@ const adapter: SimpleAdapter = {
fetch:arbitrum_fetch,
runAtCurrTime: true,
start: 1684003134,
},
[CHAIN.XLAYER]: {
fetch:xlayer_fetch,
runAtCurrTime: true,
start: 1684003134,
}
},
};
Expand Down

0 comments on commit c6eb1ba

Please sign in to comment.