forked from DefiLlama/dimension-adapters
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request DefiLlama#1349 from Javsphere/master
add javsphere volume and fees
- Loading branch information
Showing
1 changed file
with
50 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,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; |