Skip to content
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
94a262d
init Klaytn Bluewhale
bluewhale-saito Feb 5, 2024
9985e74
Refactor Bluewhale contract and update token addresses
g1nt0ki Feb 6, 2024
c712bb7
Merge branch 'DefiLlama:main' into main
bluewhale-saito Feb 7, 2024
bb8370c
Add bluewhale v3 tvl
bluewhale-saito May 10, 2024
bdfd36d
Merge branch 'DefiLlama:main' into main
bluewhale-saito Oct 22, 2025
0a77c11
add PumpSpace.
bluewhale-saito Oct 23, 2025
0f6144d
add PumpSpace Token WAVAX
bluewhale-saito Oct 23, 2025
49a49bb
feat(pumpspace): token mappings for bUSDT & WAVAX
bluewhale-saito Oct 23, 2025
4f6353b
Merge branch 'DefiLlama:main' into main
bluewhale-saito Oct 23, 2025
f8ad4d7
Merge branch 'DefiLlama:main' into main
bluewhale-saito Oct 24, 2025
c9bed2d
Add AquaBank TVL and Staking adapter (Avalanche)
bluewhale-saito Oct 24, 2025
7e6ce16
Merge branch 'DefiLlama:main' into main
bluewhale-saito Oct 27, 2025
261fcd3
I’ve removed staking and kept only tvl
bluewhale-saito Oct 27, 2025
9ec2c94
Merge commit '7e6ce160982b0b274ba89e7aee4b8e76f8c63828'
bluewhale-saito Oct 27, 2025
f7cb315
WAVAX mapping can be safely removed
bluewhale-saito Oct 27, 2025
2e9629b
Merge branch 'DefiLlama:main' into main
bluewhale-saito Oct 28, 2025
cbc3dac
removed staking, transformAddress mappings
bluewhale-saito Oct 28, 2025
cbabb11
use DefiLlama helpers
bluewhale-saito Oct 29, 2025
7854cdc
TVL adapter using bUSDT supply backed
bluewhale-saito Nov 5, 2025
8e1e265
Merge branch 'DefiLlama:main' into main
bluewhale-saito Nov 5, 2025
4486442
adapter will sum `balanceOf`for each receipt token
bluewhale-saito Nov 6, 2025
6e55f10
Merge branch 'DefiLlama:main' into main
bluewhale-saito Nov 6, 2025
5d2e175
Merge commit '6e55f107f6df43e838960552b4a67811635a67ae'
bluewhale-saito Nov 6, 2025
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
76 changes: 76 additions & 0 deletions projects/aquabank/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// projects/aquabank/index.js
const ADDRESSES = require('../helper/coreAssets.json')

const USDt = ADDRESSES.avax.USDt // 0x9702230A8Ea53601f5Cd2dc00fDBc13d4dF4A8c7

// Vaults that hold receipt tokens (not the underlying)
const BENQI_VAULT = '0x7D336B49879a173626E51BFF780686D88b8081ec'
const EULER_VAULT = '0x61E8f77eD693d3edeCBCc2dd9c55c1d987c47775'

// Protocol receipt tokens (convertible to USDt underlying)
const BENQI_RECEIPT = '0xd8fcDa6ec4Bdc547C0827B8804e89aCd817d56EF'
const EULER_RECEIPT = '0xa446938b0204Aa4055cdFEd68Ddf0E0d1BAB3E9E'
Copy link
Collaborator

Choose a reason for hiding this comment

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

we price both of these too, you can just export a balance of the receipt tokens, no need for conversion



// ABIs
const erc20Bal = 'function balanceOf(address) view returns (uint256)'

const benqiAbi = {
// Compound-style exchange rate (scaled by 1e18)
exchangeRateStored: 'function exchangeRateStored() view returns (uint256)',
underlying: 'function underlying() view returns (address)',
}

const eulerAbi = {
// ERC4626-style conversion from shares to assets
convertToAssets: 'function convertToAssets(uint256 shares) view returns (uint256)',
asset: 'function asset() view returns (address)',
}

const toStr = (x) => (x?.toString?.() ?? String(x))
const toBN = (x) => BigInt(toStr(x))

// TVL: sum USDt underlying represented by Benqi/Euler receipt tokens held in the vaults
async function tvl(api) {

// 1) Read receipt balances held by the two vaults
const [benqiShares, eulerShares] = await Promise.all([
api.call({ target: BENQI_RECEIPT, abi: erc20Bal, params: BENQI_VAULT, permitFailure: true }),
api.call({ target: EULER_RECEIPT, abi: erc20Bal, params: EULER_VAULT, permitFailure: true }),
])

// 2) Convert Benqi shares -> USDt underlying using Compound-style exchange rate
let benqiUnderlying = 0n
if (benqiShares) {
const rate = await api.call({ target: BENQI_RECEIPT, abi: benqiAbi.exchangeRateStored, permitFailure: true })
if (rate) {
// underlying = shares * rate / 1e18
benqiUnderlying = (toBN(benqiShares) * toBN(rate)) / 10n**18n
}
}

// 3) Convert Euler shares -> USDt underlying using ERC4626 conversion
let eulerUnderlying = 0n
if (eulerShares) {
const out = await api.call({
target: EULER_RECEIPT, abi: eulerAbi.convertToAssets, params: eulerShares, permitFailure: true
})
if (out) eulerUnderlying = toBN(out)
}

// 4) Add both underlyings as USDt
if (benqiUnderlying > 0n) api.add(USDt, benqiUnderlying)
Copy link
Collaborator

Choose a reason for hiding this comment

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

we price these vault receipt tokens, you can just export a balance of the receipt tokens, no need for conversion

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it, thanks! 👍
I’ve updated the adapter to export the raw balances of the Benqi and Euler receipt tokens directly,
removing the manual USDt conversion since they’re already priced server-side.

if (eulerUnderlying > 0n) api.add(USDt, eulerUnderlying)

return api.getBalances()
}

module.exports = {
methodology:
'TVL = USDt underlying represented by Benqi/Euler receipt tokens held in vaults (Benqi: shares*exchangeRate/1e18, Euler: convertToAssets).',
avax: {
tvl,
},
}


45 changes: 45 additions & 0 deletions projects/pumpspace/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// projects/pumpspace/index.js
const ADDRESSES = require('../helper/coreAssets.json')
const { staking } = require('../helper/staking')
const { getUniTVL } = require('../helper/unknownTokens');
const { getTridentTVL } = require('../helper/sushi-trident')
const sdk = require('@defillama/sdk')

const CHAIN = 'avax'

// --- FACTORIES / CONTRACTS ---
const PUMP_FACTORY = '0x26B42c208D8a9d8737A2E5c9C57F4481484d4616' // V2
const PUMP_V3 = '0xE749c1cA2EA4f930d1283ad780AdE28625037CeD' // V3/Trident

// If you later expose staking for other MasterChefs, add here
const MASTERCHEFS = [
'0x40a58fc672F7878F068bD8ED234a47458Ec33879', // SHELL
'0x56b54a1384d35C63cD95b39eDe9339fEf7df3E42', // KRILL
'0x06C551B19239fE6a425b3c45Eb8b49d28e8283C6', // PEARL
]

// --- TOKENS (project/local wrappers + protocol tokens) ---
const TOKENS = {
SHELL: '0xaD4CB79293322c07973ee83Aed5DF66A53214dc6',
}


module.exports = {
misrepresentedTokens: true,
methodology: `
TVL is computed by summing reserves across PumpSpace V2 and V3 (Trident) factories on Avalanche.
Single-asset staking (if enabled) reflects tokens deposited in the respective MasterChef contracts.
`,
avax: {
tvl: sdk.util.sumChainTvls([
// v2FactoryTVL,
// v3FactoryTVL,
getUniTVL({ factory: PUMP_FACTORY, useDefaultCoreAssets: true }),
getTridentTVL({ chain: CHAIN, factory:PUMP_V3 }),
]),
staking: sdk.util.sumChainTvls([
// If you later add KRILL/PEARL single-asset staking, append similar lines here.
staking([MASTERCHEFS[0]], [TOKENS.SHELL]),
])
},
}
Loading