Skip to content

Commit

Permalink
add mira-ly
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed Oct 18, 2024
1 parent 28f51c2 commit 2d9a36b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions dexs/mira-ly/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { SimpleAdapter } from "../../adapters/types"
import { CHAIN } from "../../helpers/chains"
import { httpPost } from "../../utils/fetchURL";

const fetchVolume = async (timestamp: number) => {
const url = 'https://prod.api.mira.ly/pools';
const body = { "volume_hours": 24, "apr_days": 1 }
const response = (await httpPost(url, body)).pools
.map((e => e.details))
const dailyVolume = response.reduce((acc: any, item: any) => {
return acc + Number(item.volume)
}, 0)
return {
dailyVolume: dailyVolume,
timestamp: timestamp,
}
}

const adapters: SimpleAdapter = {
version: 1,
adapter: {
[CHAIN.FUEL]: {
fetch: fetchVolume,
start: 1601424000,
}
}
}

export default adapters
1 change: 1 addition & 0 deletions helpers/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ export enum CHAIN {
LISK = "lisk",
MINT = "mint",
HELA = "hela",
FUEL = "fuel",
}

// Don´t use
Expand Down

0 comments on commit 2d9a36b

Please sign in to comment.