Skip to content

Commit dbc2b3e

Browse files
committed
feat(pond0x): adding Solana to Pond0x adapter
1 parent 6716a33 commit dbc2b3e

File tree

1 file changed

+41
-8
lines changed

1 file changed

+41
-8
lines changed

projects/pond0x/index.js

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,41 @@
1-
const {staking} = require("../helper/staking")
2-
3-
module.exports={
4-
ethereum:{
5-
tvl:()=>({}),
6-
staking: staking("0xed96E69d54609D9f2cFf8AaCD66CCF83c8A1B470", "0x423f4e6138e475d85cf7ea071ac92097ed631eea")
7-
}
8-
}
1+
const { staking } = require("../helper/staking");
2+
const { getTokenSupplies } = require('../helper/solana');
3+
4+
// --- Ethereum Configuration ---
5+
const ETH_STAKING_CONTRACT = "0xed96E69d54609D9f2cFf8AaCD66CCF83c8A1B470";
6+
const PONDOX_ETH = "0x423f4e6138e475d85cf7ea071ac92097ed631eea";
7+
8+
const WPOND_SOLANA_MINT = "3JgFwoYV74f6LwWjQWnr3YDPFnmBdwQfNyubv99jqUoq";
9+
10+
const COINGECKO_ID = "pond-coin";
11+
12+
async function solanaTVL(api) {
13+
await getTokenSupplies([WPOND_SOLANA_MINT], api);
14+
15+
const solanaKey = `solana:${WPOND_SOLANA_MINT}`;
16+
const rawBalance = api.getBalances()[solanaKey];
17+
18+
if (rawBalance) {
19+
const tokenAmount = Number(rawBalance) / 1e3;
20+
21+
api.addCGToken(COINGECKO_ID, tokenAmount);
22+
23+
delete api.getBalances()[solanaKey];
24+
}
25+
}
26+
27+
28+
module.exports = {
29+
ethereum: {
30+
tvl: () => ({}),
31+
staking: staking(ETH_STAKING_CONTRACT, PONDOX_ETH)
32+
},
33+
solana: {
34+
tvl: solanaTVL
35+
}
36+
};
37+
38+
39+
40+
41+

0 commit comments

Comments
 (0)