Skip to content

Commit f2d7196

Browse files
authored
Merge pull request DefiLlama#143 from DefiLlama/armor
Add Armor
2 parents bac9251 + f7484b1 commit f2d7196

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

src/adaptors/armor/index.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
};

0 commit comments

Comments
 (0)