Skip to content

Commit 6334999

Browse files
committed
track yieswap fees & volume
1 parent 978f6aa commit 6334999

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

dexs/yei-swap.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { CHAIN } from "../helpers/chains"
2+
import { httpGet } from "../utils/fetchURL"
3+
4+
async function fetch() {
5+
let dailyVolume = 0
6+
let dailyFees = 0
7+
8+
const { pools, } = await httpGet(`https://swap-api.yei.finance/pools`)
9+
pools.forEach((pool: any) => {
10+
dailyVolume += pool.volume_24h
11+
dailyFees += pool.fee_24h
12+
})
13+
14+
return { dailyFees, dailyVolume }
15+
}
16+
17+
export default {
18+
adapter: {
19+
[CHAIN.SEI]: {
20+
fetch,
21+
runAtCurrTime: true,
22+
},
23+
},
24+
}

0 commit comments

Comments
 (0)