feat: add evently fees adapter (MegaETH)#6335
feat: add evently fees adapter (MegaETH)#6335FelixBruguera merged 4 commits intoDefiLlama:masterfrom
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 15 minutes and 39 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughAdded a new evently adapter module for MegaETH Mainnet that calculates daily fees and volume by querying contract events ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches✨ Simplify code
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 evently adapter exports: |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@fees/evently/index.ts`:
- Around line 26-33: The loop currently sums treasuryFee and creatorFee into
dailyFees only; change it to add three labeled entries per log: add treasuryFee
to dailyRevenue (protocol) with a label (e.g., "treasury"), add creatorFee to
dailySupplySideRevenue (supply-side) with a label (e.g., "creator"), and still
add the combined amount to dailyFees; locate the loop that iterates
finalizedLogs and the balances created via options.createBalances(), and update
the .add(USDM, amount, "label") calls to use BigInt(log.treasuryFee.toString())
and BigInt(log.creatorFee.toString()) separately while also adding their sum to
dailyFees.
- Around line 60-67: The meta.methodology block currently documents Fees,
Revenue, and Volume but is missing a breakdownMethodology mapping for the
individual labels used in .add() calls (specifically the separated treasury and
creator fee labels); add a breakdownMethodology object alongside
meta.methodology that contains clear descriptions for each label used in .add()
(e.g., the treasury fee label, the creator fee label, and any other fee labels),
referencing the same label names used in the .add() calls so consumers can map
each metric to its description.
- Around line 46-51: The returned object currently sets dailyRevenue to
dailyFees which is incorrect; update the return in fees/evently/index.ts so that
dailyFees remains the gross fees, dailyUserFees (or dailySupplySideRevenue)
reflects creator/market fees as dailyFees * 0.02, and dailyRevenue reflects the
protocol/treasury portion as dailyFees * 0.03 (i.e., dailyRevenue = dailyFees *
0.03 and dailySupplySideRevenue/dailyUserFees = dailyFees * 0.02), keeping
dailyVolume unchanged and ensuring the property names used match the rest of the
adapter (dailyFees, dailyRevenue, dailySupplySideRevenue/dailyUserFees,
dailyVolume).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 931a000a-983b-4c68-bab8-7160ec6b4cd5
📒 Files selected for processing (1)
fees/evently/index.ts
fees/evently/index.ts
Outdated
| meta: { | ||
| methodology: { | ||
| Fees: | ||
| "5% of total pool at market finalization (3% treasury + 2% creator). Tracked via MarketFinalized event.", | ||
| Revenue: "Same as Fees — all fees go to treasury and market creators.", | ||
| Volume: "Sum of all bets placed on prediction markets (BetPlaced).", | ||
| }, | ||
| }, |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Add breakdownMethodology entries for fee labels.
Per coding guidelines, every label used in .add() calls must appear in a breakdownMethodology object with clear descriptions. After separating treasury and creator fees with labels, add corresponding entries:
♻️ Proposed methodology update
meta: {
methodology: {
Fees:
"5% of total pool at market finalization (3% treasury + 2% creator). Tracked via MarketFinalized event.",
- Revenue: "Same as Fees — all fees go to treasury and market creators.",
+ Revenue: "3% treasury fee from finalized markets.",
+ SupplySideRevenue: "2% creator fee paid to market creators.",
Volume: "Sum of all bets placed on prediction markets (BetPlaced).",
},
+ breakdownMethodology: {
+ "Settlement Fees": "Total fees (5%) collected at market finalization",
+ "Settlement Fees To Treasury": "3% treasury fee retained by protocol",
+ "Settlement Fees To Creators": "2% creator fee paid to market creators",
+ },
},As per coding guidelines: "Include breakdownMethodology object in fees adapters that documents all labels used in .add() calls with clear descriptions."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@fees/evently/index.ts` around lines 60 - 67, The meta.methodology block
currently documents Fees, Revenue, and Volume but is missing a
breakdownMethodology mapping for the individual labels used in .add() calls
(specifically the separated treasury and creator fee labels); add a
breakdownMethodology object alongside meta.methodology that contains clear
descriptions for each label used in .add() (e.g., the treasury fee label, the
creator fee label, and any other fee labels), referencing the same label names
used in the .add() calls so consumers can map each metric to its description.
…and add breakdown labels
|
The evently adapter exports: |
|
The evently adapter exports: |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@dexs/evently/index.ts`:
- Around line 72-73: The wording for Revenue and SupplySideRevenue is
misleading: update the string values for the keys Revenue and SupplySideRevenue
in dexs/evently/index.ts to state that the percentages apply to the total
settlement pool (e.g., "3% of the total settlement pool at settlement" and "2%
of the total settlement pool at settlement") so the description matches the
implementation that treats these as percentages of the total pool rather than
"of the fees."
- Around line 35-37: Change the labels used when recording revenue destinations:
instead of passing the source label METRIC.TRADING_FEES into dailyRevenue.add
and dailySupplySideRevenue.add, use destination-specific labels such as "Trading
Fees To Treasury" (for dailyRevenue) and "Trading Fees To Market Creators" (for
dailySupplySideRevenue) while keeping dailyFees.add using the source label
METRIC.TRADING_FEES; also update the corresponding breakdownMethodology keys to
match these new destination labels so the revenue dimension keys are consistent
with the added labels (refer to the dailyFees, dailyRevenue,
dailySupplySideRevenue add calls and breakdownMethodology entries).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 298cdc36-a752-4254-9c34-e094c9037c24
📒 Files selected for processing (2)
dexs/evently/index.tsfees/megamble.ts
💤 Files with no reviewable changes (1)
- fees/megamble.ts
| dailyFees.add(USDM, treasuryFee + creatorFee, METRIC.TRADING_FEES); | ||
| dailyRevenue.add(USDM, treasuryFee, METRIC.TRADING_FEES); | ||
| dailySupplySideRevenue.add(USDM, creatorFee, "Market Creator Fees") |
There was a problem hiding this comment.
Use destination-specific labels for revenue dimensions.
dailyRevenue currently uses a source label (METRIC.TRADING_FEES). For income-statement consistency, dailyRevenue and dailySupplySideRevenue should use destination labels (e.g., “...To Treasury”, “...To Market Creators”), and breakdownMethodology keys should match.
🔧 Proposed label fix
- dailyRevenue.add(USDM, treasuryFee, METRIC.TRADING_FEES);
- dailySupplySideRevenue.add(USDM, creatorFee, "Market Creator Fees")
+ dailyRevenue.add(USDM, treasuryFee, "Trading Fees To Treasury");
+ dailySupplySideRevenue.add(USDM, creatorFee, "Trading Fees To Market Creators")
...
- Revenue: {
- [METRIC.TRADING_FEES]: "3% treasury fee from finalized markets",
- },
+ Revenue: {
+ "Trading Fees To Treasury": "Treasury share from finalized market trading fees",
+ },
...
- SupplySideRevenue: {
- "Market Creator Fees": "2% creator fee paid to market creators from finalized markets",
- },
+ SupplySideRevenue: {
+ "Trading Fees To Market Creators": "Creator share from finalized market trading fees",
+ },Based on learnings: "Always provide breakdown labels even when there is only one source/destination of fees. Use source-of-fees labels for dailyFees ... Use detailed destination labels for dailyRevenue/dailySupplySideRevenue."
Also applies to: 80-85
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@dexs/evently/index.ts` around lines 35 - 37, Change the labels used when
recording revenue destinations: instead of passing the source label
METRIC.TRADING_FEES into dailyRevenue.add and dailySupplySideRevenue.add, use
destination-specific labels such as "Trading Fees To Treasury" (for
dailyRevenue) and "Trading Fees To Market Creators" (for dailySupplySideRevenue)
while keeping dailyFees.add using the source label METRIC.TRADING_FEES; also
update the corresponding breakdownMethodology keys to match these new
destination labels so the revenue dimension keys are consistent with the added
labels (refer to the dailyFees, dailyRevenue, dailySupplySideRevenue add calls
and breakdownMethodology entries).
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|
The evently adapter exports: |
Rename Megamble → evently (evently.market)
Name (to be shown on DefiLlama):
evently
Twitter Link:
https://x.com/eventlymarket
List of audit links if any:
None yet (audit in progress with Pashov/CertiK)
Website Link:
https://evently.market
Logo (High resolution, will be shown with rounded borders):
https://icons.llama.fi/evently.jpg
Current TVL:
(check https://evently.market)
Chain:
MegaETH
Short Description (to be shown on DefiLlama):
Fully onchain prediction markets on MegaETH. Trade your conviction on crypto, politics and more with instant liquidity via LMSR pricing.
Category:
Prediction Market
forkedFrom:
No
methodology:
TVL is the total USDM locked in evently prediction market contracts on MegaETH (contract: 0x7c56aa113be4a867936c55013b03387c7b9cd41a)
Github org/user:
isonips