Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions projects/dipcoin-perp/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const ADDRESSES = require('../helper/coreAssets.json')
const BigNumber = require("bignumber.js")
const { getConfig } = require('../helper/cache');

async function suiTvl(api) {
const symbols = (await getConfig('dipcoin-perp/symbols', 'https://gray-api.dipcoin.io/api/perp-market-api/list'))?.data?.map(i => i.symbol)
if (!Array.isArray(symbols) || symbols.length === 0) return;
const volumes = await Promise.all(symbols.map(async (symbol) => {
const ticker = await getConfig(`dipcoin-perp/symbol-volume-${symbol}`, `https://gray-api.dipcoin.io/api/perp-market-api/ticker?symbol=${symbol}`);
const volumeValue = ticker?.data?.volume24h || 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesnt sound like TVL

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we will cancel this pull request and update a fixed version later.


return BigNumber(volumeValue);
}));
const sum = volumes.reduce((acc, volume) => acc.plus(volume), BigNumber(0)).div(1e12).toFixed(0);

api.add(ADDRESSES.sui.USDC, sum);
}

module.exports = {
sui: {
tvl: suiTvl
},
hallmarks: [
['2025-10-15', "Launched the Perpetual Mainnet (v1.0)."],
['2025-10-16', "Listed perpetual contracts for BTC, ETH, and SUI."],
['2025-10-29', "Upgraded to Mainnet v1.1, introducing Take Profit/Stop Loss and margin management features."],
['2025-10-31', "Listed perpetual contracts for SOL, BNB, and XRP."],
],
}
2 changes: 1 addition & 1 deletion projects/dipcoin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async function suiTvl(api) {

module.exports = {
hallmarks: [
[1747699200, "Spot Launch"],
['2025-05-20', "Spot Launch"],
],
sui: {
tvl: suiTvl
Expand Down
Loading