Skip to content

Commit

Permalink
Merge pull request DefiLlama#1349 from Javsphere/master
Browse files Browse the repository at this point in the history
add javsphere volume and fees
  • Loading branch information
dtmkeng authored Mar 26, 2024
2 parents 6de5d47 + 5d3a985 commit f51025c
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions dexs/javsphere/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@

import fetchURL from "../../utils/fetchURL";
import type { SimpleAdapter } from "../../adapters/types";
import { CHAIN } from "../../helpers/chains";

type DexData = {
countTotal: number,
volumeTotal: number,
feeTotal: number,
tradesBuy: number,
volumeBuy: number,
volumeBuyFees: number,
countSell: number,
volumeSell: number,
volumeSellFees: number,
volume24: number,
fee24: number

};

const methodology = {
Fees: "User pays 0.1% fees on each trade.",
Volume: "User buys and sell RWA tokens.",
}

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

const adapter: SimpleAdapter = {
adapter: {
[CHAIN.DEFICHAIN]: {
fetch,
start: 0,
runAtCurrTime: true,
meta: {
methodology
},
},
},
};

export default adapter;

0 comments on commit f51025c

Please sign in to comment.