File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
src/adaptors/drift-staked-sol Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 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' } ;
You can’t perform that action at this time.
0 commit comments