Skip to content

Commit dbf6b26

Browse files
authored
Merge pull request #1771 from redyinfinex/drift
add dSOL
2 parents fea14be + eacf717 commit dbf6b26

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
const axios = require('axios');
2+
const { getTotalSupply } = require('../utils');
3+
const utils = require('../utils');
4+
5+
const DSOL_ADDRESS = 'Dso1bDeDjCQxTrWHqUUi63oBvV7Mdm6WaobLbQ7gnPQ'
6+
const priceKey = `solana:${DSOL_ADDRESS}`;
7+
8+
const apy = async () => {
9+
const totalSupply = await getTotalSupply(DSOL_ADDRESS);
10+
11+
const priceResponse = await axios.get(
12+
`https://coins.llama.fi/prices/current/${priceKey}`
13+
);
14+
const currentPrice = priceResponse.data.coins[priceKey].price;
15+
16+
const driftResponse = await axios.get(
17+
'https://extra-api.sanctum.so/v1/apy/latest?lst=dSOL'
18+
);
19+
const apy = driftResponse.data.apys.dSOL;
20+
21+
return [
22+
{
23+
pool: DSOL_ADDRESS,
24+
chain: utils.formatChain('solana'),
25+
project: 'drift-staked-sol',
26+
symbol: 'dSOL',
27+
tvlUsd: totalSupply * currentPrice,
28+
apyBase: apy * 100,
29+
underlyingTokens: [DSOL_ADDRESS],
30+
},
31+
];
32+
};
33+
34+
module.exports = { apy, url: 'https://app.drift.trade/earn/dsol-liquid-staking' };

0 commit comments

Comments
 (0)