File tree 1 file changed +31
-0
lines changed
src/adaptors/fuel-staking
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ const axios = require ( 'axios' ) ;
2
+
3
+ const apy = async ( ) => {
4
+ const [ apyData , supplyData ] = await Promise . all (
5
+ [
6
+ 'https://mainnet-explorer.fuel.network/staking/apy' ,
7
+ 'https://rest-fuel-seq.simplystaking.xyz/cosmos/staking/v1beta1/pool' ,
8
+ ] . map ( ( i ) => axios . get ( i ) )
9
+ ) ;
10
+
11
+ const id = 'fuel-network' ;
12
+ const price = (
13
+ await axios . get ( `https://coins.llama.fi/prices/current/coingecko:${ id } ` )
14
+ ) . data . coins [ `coingecko:${ id } ` ] . price ;
15
+
16
+ return [
17
+ {
18
+ pool : '0x675b68aa4d9c2d3bb3f0397048e62e6b7192079c' ,
19
+ project : 'fuel-staking' ,
20
+ chain : 'fuel-ignition' ,
21
+ symbol : 'FUEL' ,
22
+ apyBase : Number ( apyData . data . amount ) ,
23
+ tvlUsd : ( supplyData . data . pool . bonded_tokens / 1e9 ) * price ,
24
+ url : 'https://app.fuel.network/staking/on-fuel' ,
25
+ } ,
26
+ ] ;
27
+ } ;
28
+
29
+ module . exports = {
30
+ apy,
31
+ } ;
You can’t perform that action at this time.
0 commit comments