Add Eden chain and bot.fun adapter#19981
Conversation
Registers Eden (chain 714, Celestia's EVM chain, chainlist shortName "eden") and adds a TVL adapter for bot.fun, the launchpad on Eden whose bonding curve reserves are held in native TIA by the factory contract. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughRegisters Eden and WTIA metadata, then adds a bot.fun adapter that calculates factory-held native TIA TVL after subtracting accrued unclaimed rewards. ChangesEden TVL integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant TVLAdapter
participant sumTokensExport
participant BotFunFactory
TVLAdapter->>sumTokensExport: Aggregate native token balance
TVLAdapter->>BotFunFactory: Query totalAccruedUnclaimed
BotFunFactory-->>TVLAdapter: Return accrued amount
TVLAdapter->>sumTokensExport: Subtract accrued amount from TVL
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The adapter at projects/bot-fun exports TVL: |
|
The adapter at projects/bot-fun exports TVL: |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
projects/bot-fun/index.js (1)
10-16: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winSimplify decimal handling by subtracting in atomic units via
ADDRESSES.null.Since
sumTokensExportalready adds the native balance underADDRESSES.null(in wei), subtracting the accrued rewards through the same token identifier lets the SDK handle the 18-decimal conversion and the eden→celestiaCoinGecko mapping automatically. This removes the manual/ 1e18division, theNumber()BigInt→float conversion (which can lose precision for large wei values), and the need forskipChain: true.♻️ Proposed refactor
async function tvl(api) { await sumTokensExport({ owner: FACTORY, tokens: [ADDRESSES.null] })(api) const accruedRewards = await api.call({ target: FACTORY, abi: 'uint256:totalAccruedUnclaimed', permitFailure: true, }) - api.add('celestia', -Number(accruedRewards ?? 0) / 1e18, { skipChain: true }) + api.add(ADDRESSES.null, -(accruedRewards ?? 0n)) }This relies on the eden chain's native token being mapped to the
celestiaCoinGecko asset in the token mapping configuration from the chain registration cohort.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@projects/bot-fun/index.js` around lines 10 - 16, Update the accrued rewards subtraction in the token aggregation flow to use ADDRESSES.null directly: pass the atomic-unit reward amount from totalAccruedUnclaimed to api.add with ADDRESSES.null, removing Number(), manual 1e18 conversion, and skipChain. Preserve the existing sumTokensExport behavior so SDK decimal conversion and the eden-to-celestia mapping are applied automatically.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@projects/bot-fun/index.js`:
- Around line 10-16: Update the accrued rewards subtraction in the token
aggregation flow to use ADDRESSES.null directly: pass the atomic-unit reward
amount from totalAccruedUnclaimed to api.add with ADDRESSES.null, removing
Number(), manual 1e18 conversion, and skipChain. Preserve the existing
sumTokensExport behavior so SDK decimal conversion and the eden-to-celestia
mapping are applied automatically.
| eden: { | ||
| [nullAddress]: { coingeckoId: 'celestia', decimals: 18 }, // native TIA | ||
| '0x00000000000000000000000000000000ce1e571a': { coingeckoId: 'celestia', decimals: 18 }, // WTIA | ||
| }, |
There was a problem hiding this comment.
Hello, thank you for the PR. Could you please remove this token mapping, and share the celestia addresses that hold tokens bridged to eden if possible? Once we verify the collateral backing them, we can add prices for eden tokens on the server
There was a problem hiding this comment.
Thanks for the review! Removed the mapping in b3d2276 (also updated the bot.fun adapter so the rewards subtraction uses the raw native-token key instead of the coingecko id).
Here are the collateral details for TIA on Eden:
Native TIA on Eden is minted by the canonical Hyperlane warp route from Celestia (bridge: https://eden.zone, deployed by Abacus Works; Celestia runs Hyperlane natively in celestia-app).
- Celestia (collateral side): warp token ID
0x726f757465725f61707000000000000000000000000000010000000000000009, collateral denomutia. The locked TIA is held by Celestia's Hyperlanewarpmodule account:celestia1m20fddqpmfuwcz2r9ckj6wd70p5e75t8y22wqj. Note this module account is shared by all Celestia warp routes (it also backs TIA bridged to Ethereum, etc. — it currently holds ~825k TIA total). Per-route accounting is available via Celenium's Hyperlane API (https://api-mainnet.celenium.io/v1/hyperlane/token): the Eden route has sent 155,754.8 TIA and received back 32,814.5, so ~122,940 TIA is currently escrowed for Eden, matching Eden's native supply. - Eden side: the
EvmNativewarp router0x4A60C46f671A3b86D78E9c0b793235C2D502d44Emints/releases native TIA (18 decimals). - WTIA
0x00000000000000000000000000000000Ce1e571Ais a canonical WETH9-style wrapper, 1:1 backed by the native TIA it holds.
Example escrow-release tx on Celestia (Eden → Celestia withdrawal): be1027cc76bf7181b234072768d64547b79ed7040f780f498a7da2160e17aa94.
So for the price server: eden:0x0000000000000000000000000000000000000000 and eden:0x00000000000000000000000000000000Ce1e571A (both 18 decimals) → coingecko celestia. Happy to provide anything else you need!
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
# Conflicts: # projects/helper/coreAssets.json
|
The adapter at projects/bot-fun exports TVL: |
New chain: Eden
Eden is Celestia's native EVM chain (Evolve stack, Celestia DA), with TIA bridged from Celestia as the native gas token.
edenon chainlist.org0x00000000000000000000000000000000Ce1e571A. Per review, no client-side token mapping — prices to be added server-side once the collateral is verified. Collateral details: TIA is bridged via the canonical Hyperlane warp route from Celestia; the escrow is Celestia's Hyperlanewarpmodule accountcelestia1m20fddqpmfuwcz2r9ckj6wd70p5e75t8y22wqj(Eden route token ID0x726f757465725f61707000000000000000000000000000010000000000000009, ~122.9k TIA net escrowed).Chain metadata request: please tie Eden to Celestia in the chains list (parent chain: Celestia, gas token TIA / geckoId
celestia), since Eden is Celestia's EVM chain and uses bridged TIA for gas. Happy to open the companion PR to defillama-server if that's preferred.New protocol: bot.fun
0x279dc5E05d43644C6cd2F2813F306a320e785cdD), which holds the bonding curve reserves of every coin launched on the platform, excluding accrued creator/referral rewards. Contract addresses are published at https://bot.fun/api/v1/chainnode test.js projects/bot-fun/index.js): the adapter currently reports ~9.65k TIA undereden:0x0000…0000(matches bot.fun's/api/v1/stats/overviewtvlTia), displayed as $0 until eden token prices are added on the DefiLlama server (see review thread).🤖 Generated with Claude Code
Summary by CodeRabbit
edento the supported chain list and configuring the Eden core asset (WTIA).