Skip to content

Add Glorb protocol fees adapter (Base)#5845

Open
glorbwtf wants to merge 1 commit intoDefiLlama:masterfrom
glorbwtf:add-glorb-fees
Open

Add Glorb protocol fees adapter (Base)#5845
glorbwtf wants to merge 1 commit intoDefiLlama:masterfrom
glorbwtf:add-glorb-fees

Conversation

@glorbwtf
Copy link
Copy Markdown

@glorbwtf glorbwtf commented Feb 8, 2026

Summary

  • Adds fees/revenue adapter for the Glorb protocol on Base
  • Tracks Snatch V4 (onchain "last buyer wins" game): 10% fee on purchases — 5% GLORB buyback-and-burn, 3% dividends, 2% jackpot
  • Tracks Mines (idle mining game): ETH fees from registration/depth unlocks/prestige, GLORB fees from stat upgrades (10% burned)
  • Protocol revenue = deflationary mechanisms (buyback-burn + GLORB burns)

Contracts

Contract Address
Snatch V4 0x1Ef75dc4904b71021F308a8D276be346889fEe62
Mines 0x8536f84d0300Be2B6733B69Bcd48613a9E04E918
GLORB Token 0xa26303226Baa2299adA8D573a6FcD792aB1CFB07

Test output

🦙 Running GLORB adapter 🦙
BASE 👇
Daily fees: 30.00
Daily revenue: 5.00
Daily protocol revenue: 5.00

Related

Summary by CodeRabbit

  • New Features
    • Added comprehensive on-chain fee and revenue aggregation tracking for the BASE chain, starting February 1, 2025, capturing daily fees, revenue, and protocol revenue metrics.

Tracks fees and revenue from two onchain games on Base:
- Snatch V4: 10% fee on buys (5% buyback-burn, 3% dividends, 2% jackpot)
- Mines: ETH from registrations/depth unlocks/prestige + GLORB from stat upgrades (10% burned)

Protocol revenue = deflationary buyback-and-burn mechanisms.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 8, 2026

📝 Walkthrough

Walkthrough

A new TypeScript module is introduced that implements a SimpleAdapter for aggregating on-chain fees and revenue data on Base chain. The adapter processes contract events to calculate daily fees, revenue, and protocol revenue across SNATCH, MINES, and GLORB contracts.

Changes

Cohort / File(s) Summary
New Fee Aggregator Adapter
fees/glorb.ts
Introduces SimpleAdapter for on-chain fee and revenue aggregation. Defines contract constants and implements fetch function that processes ShinyBought, PlayerRegistered, DepthUnlocked, Prestiged, and StatUpgraded events to calculate dailyFees, dailyRevenue, and dailyProtocolRevenue. Exports adapter with version 2, Base chain mapping (start: 2025-02-01), and methodology description.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • treeoflife2

Poem

🐰 A glorb adapter hops into view,
Snatch and Mines fees, both shiny and new,
Events aggregated with careful precision,
Revenue tracked with blessed decision,
The fees now flow where they're meant to do. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the primary change: adding a fees adapter for the Glorb protocol on the Base chain.
Description check ✅ Passed The description provides a clear summary of the adapter's purpose, contract addresses, test output, and related links, covering the essential information needed to understand the change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
fees/glorb.ts (1)

59-59: Consider using clone() to avoid shared reference between dailyProtocolRevenue and dailyRevenue.

The current return statement creates an alias to the same dailyRevenue object. While this pattern is used consistently across 20+ adapters in the codebase and likely works because the framework treats returned values as read-only, it's fragile. If the framework ever mutates these Balances objects (e.g., to convert units or normalize values), both properties would be affected since they reference the same object.

The clone() method is available on Balances objects and can be used to create a separate instance:

Safer alternative
-  return { dailyFees, dailyRevenue, dailyProtocolRevenue: dailyRevenue };
+  return { dailyFees, dailyRevenue, dailyProtocolRevenue: dailyRevenue.clone() };

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@llamabutler
Copy link
Copy Markdown

The glorb.ts adapter exports:

> adapters@1.0.0 test
> ts-node --transpile-only cli/testAdapter.ts fees glorb.ts

🦙 Running GLORB.TS adapter 🦙
---------------------------------------------------
Start Date:	Sun, 08 Feb 2026 11:14:04 GMT
End Date:	Mon, 09 Feb 2026 11:14:04 GMT
---------------------------------------------------

BASE 👇
Backfill start time: 1/2/2025
Daily fees: 59.00
Daily revenue: 5.00
Daily protocol revenue: 5.00
End timestamp: 1770635643 (2026-02-09T11:14:03.000Z)

@bheluga bheluga self-assigned this Feb 9, 2026
}

// --- Mines: GLORB fees from stat upgrades ---
// 10% burned (deflationary revenue), 85% recycled, 5% jackpot
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@glorbwtf what do you mean by recycled? Where exactly does that fees go?
Also jackpot goes to users?

Copy link
Copy Markdown
Member

@bheluga bheluga left a comment

Choose a reason for hiding this comment

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

@glorbwtf thanks for the PR
If jackpot and dividends go to players, you can track that part as supply side revenue
Also buyback and burn can be added as holdersRevenue instead of protocolRevenue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants