Skip to content

Commit

Permalink
add daily volume and fees of dusdstaking
Browse files Browse the repository at this point in the history
  • Loading branch information
igorshelkovenkov committed Apr 3, 2024
1 parent 5d3a985 commit f47338e
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions dexs/javsphere/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,26 @@ type DexData = {

};

type StakingData = {
totalFees: number,
dailyFees: number,
totalVolume: number,
dailyVolume: number,
};

const methodology = {
Fees: "User pays 0.1% fees on each trade.",
Volume: "User buys and sell RWA tokens.",
Fees: "User pays 0.1% fees on each trade. User pays 10% fee of rewards in dusdstaking.",
Volume: "User buys and sell RWA tokens. User get in and out of dusdstaking.",
}

const fetch = async (timestamp: number) => {
const stats: DexData = (await fetchURL(`https://aws-api.javlis.com/api/dtoken/stats`)).data;
const statsStaking: StakingData = (await fetchURL(`https://aws-api.javlis.com/api/dusdStaking/stats`)).data;
return {
totalVolume: `${stats.volumeTotal}`,
totalFees: `${stats.feeTotal}`,
dailyFees: `${stats.fee24}`,
dailyVolume: `${stats.volume24}`,
totalVolume: `${stats.volumeTotal + statsStaking.totalVolume}`,
totalFees: `${stats.feeTotal + statsStaking.totalFees}`,
dailyFees: `${stats.fee24 + statsStaking.dailyFees}`,
dailyVolume: `${stats.volume24 + statsStaking.dailyVolume}`,
timestamp,
};
};
Expand Down

0 comments on commit f47338e

Please sign in to comment.