File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ const utils = require ( '../utils' ) ;
2+
3+ const API_URL : string = 'https://armorfi.info/api/apy' ;
4+
5+ const ARMOR_TOKEN = '0x1337def16f9b486faed0293eb623dc8395dfe46a' ;
6+
7+ interface Pool {
8+ contract_address : string ;
9+ asset_symbol : string ;
10+ quote_symbol : string ;
11+ liquidity_usd : string ;
12+ apy : { yearly : string } ;
13+ }
14+
15+ interface Response {
16+ dailyapys : Array < Pool > ;
17+ }
18+
19+ const getApy = async ( ) => {
20+ const { dailyapys : poolsRes } : Response = await utils . getData ( API_URL ) ;
21+
22+ const pools = poolsRes . map ( ( pool ) => {
23+ return {
24+ pool : pool . contract_address ,
25+ chain : utils . formatChain ( 'ethereum' ) ,
26+ project : 'armor' ,
27+ symbol : `${ pool . asset_symbol } -${ pool . quote_symbol } ` ,
28+ tvlUsd : Number ( pool . liquidity_usd ) ,
29+ apyReward : Number ( pool . apy . yearly ) ,
30+ rewardTokens : [ ARMOR_TOKEN ] ,
31+ } ;
32+ } ) ;
33+
34+ return pools ;
35+ } ;
36+
37+ module . exports = {
38+ timetravel : false ,
39+ apy : getApy ,
40+ } ;
File renamed without changes.
You can’t perform that action at this time.
0 commit comments