Skip to content

Commit ea67b51

Browse files
authored
Merge pull request #2179 from abdullahabro/master
Add Bluefin CLMM Pools APY tracking
2 parents d84ae5a + 079013d commit ea67b51

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

src/adaptors/bluefin-spot/index.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
const axios = require('axios');
2+
3+
const apyDataUrl = 'https://swap.api.sui-prod.bluefin.io/api/v1/pools/apy/stats';
4+
5+
const apy = async () => {
6+
const response = await axios.get(apyDataUrl);
7+
const pools = response.data.data;
8+
9+
return pools
10+
.map((p) => {
11+
const stats = p.apyStats[0];
12+
const apyBase = Number(stats.aprFee);
13+
const apyReward = Number(stats.aprRewards);
14+
// Extract reward token addresses from rewards array
15+
const rewardTokens = p.rewards?.map((reward) => reward.symbol) || [];
16+
return {
17+
pool: p.pool,
18+
chain: 'Sui',
19+
project: 'bluefin-spot',
20+
symbol: `${p.coinA.symbol}-${p.coinB.symbol}`,
21+
underlyingTokens: [p.coinA.coinType, p.coinB.coinType],
22+
rewardTokens,
23+
tvlUsd: Number(stats.tvlUsd),
24+
apyBase,
25+
apyReward: apyReward > 0 ? apyReward : 0,
26+
poolMeta: `(${Number(p.feeRate)}%)`,
27+
url: `https://trade.bluefin.io/deposit/${p.pool}`,
28+
};
29+
})
30+
.filter((i) => i.tvlUsd >= 1e4) // show pools with at least $10,000 TVL
31+
.sort((a, b) => b.tvlUsd - a.tvlUsd);
32+
};
33+
34+
module.exports = {
35+
apy,
36+
};

0 commit comments

Comments
 (0)