Skip to content
Open
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
51 changes: 51 additions & 0 deletions projects/hypesino/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
const { sumTokens } = require('../helper/unwrapLPs');

const CONTRACTS = {
v1: '0xdD9776C41DDb6B1e968045733460F7868150dE49',
v2: '0xfA07008373014D035E49064A5373EFb053228C87',
};

const abi = {
accumulatedFees: "uint256:accumulatedFees",
pendingExposure: "uint256:pendingExposure",
};

async function tvl(api) {
const balances = await api.multiCall({
calls: Object.values(CONTRACTS),
abi: 'erc20:balanceOf',
params: [api.address],
permitFailure: true,
});

const fees = await api.multiCall({
calls: Object.values(CONTRACTS),
abi: abi.accumulatedFees,
permitFailure: true,
});

let totalTvl = 0n;
for (let i = 0; i < balances.length; i++) {
const balance = BigInt(balances[i] || 0);
const fee = BigInt(fees[i] || 0);
const bankroll = balance - fee;
if (bankroll > 0n) {
totalTvl += bankroll;
}
}

api.addGasToken(totalTvl.toString());
return api.getBalances();
}

module.exports = {
methodology: 'Hypesino casino on HyperEVM. TVL = bankroll.',
hyperliquid: {
tvl,
},
start: 1704067200,
hallmarks: [
[1704067200, "Hypesino V1 Launch"],
[1730419200, "V2 Tiered Betting"],
],
};
Loading