[update] SparkDEX V3-1/V4: date-gated BBB fee split from 2026-05-18#8307
[update] SparkDEX V3-1/V4: date-gated BBB fee split from 2026-05-18#83070xNx wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
Summary by CodeRabbit
WalkthroughSparkDEX V3.1 now applies BBB cutoff-based fee splits and labels early redemption penalties. A new SparkDEX V4 Flare adapter fetches daily Goldsky fees and applies the same allocation boundary. Factory configurations define updated dates, percentages, and methodologies. ChangesSparkDEX fee allocation
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Adapter
participant Goldsky
participant RevenueBuckets
Adapter->>Goldsky: Query algebraDayData by dateId
Goldsky-->>Adapter: Return feesUSD
Adapter->>RevenueBuckets: Apply BBB_START fee allocation
RevenueBuckets-->>Adapter: Return daily revenue balances
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 12 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (12 passed)
✨ 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 sparkdex-v3-1 adapter exports: |
|
The sparkdex-v4 adapter exports: |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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.
Inline comments:
In `@fees/sparkdex-v3-1/index.ts`:
- Around line 22-27: Extract the duplicated BBB_START constant and its
governance documentation into a shared helper under helpers, then update the
adapters’ fee logic to import and reuse that shared symbol. Remove the local
declarations from both sparkdex-v3-1 and sparkdex-v4 while preserving the
existing cutoff value and governance reference.
In `@fees/sparkdex-v4/index.ts`:
- Around line 12-17: Remove the duplicate BBB_START governance constant and its
associated comment from the Sparkdex v4 fee configuration, reusing the existing
shared definition or established source used by Sparkdex v3-1 instead.
- Around line 69-73: Update the version 2 adapter object in the fees adapter to
explicitly set pullHourly to false, and add a concise explanatory comment that
the algebraDayData source only provides daily aggregates and cannot support
hourly retrieval.
- Around line 19-21: Update the v2 adapter’s fetch function around fetch to
derive the date key from options.startTimestamp (or options.fromTimestamp)
instead of options.startOfDay, ensuring hourly runs produce distinct time
windows. Do not rely on start-of-day unless the adapter configuration explicitly
sets pullHourly: false.
🪄 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: 8119595f-d313-421c-a13a-bcd5b82910ef
📒 Files selected for processing (3)
factory/uniSubgraph.tsfees/sparkdex-v3-1/index.tsfees/sparkdex-v4/index.ts
|
The sparkdex-v3-1 adapter exports: |
|
The sparkdex-v4 adapter exports: |
Summary
fees/sparkdex-v4(factory cannot date-gate fee percentages; V3-1 already keeps a custom fees adapter).factory/uniSubgraph.tsstaticfeesPercentwith the post-BBB split (DEX volume surface).Proposal: https://sparkdex.ai/governance/proposal/6a046cbecd38e8c7fea826ee
Fee split
Files
fees/sparkdex-v3-1/index.ts— date-gated split + early-redemption burns unchangedfees/sparkdex-v4/index.ts— new fees adapter (algebraDayData)factory/uniSubgraph.ts— post-BBB static ratios + methodologyNotes
uniSubgraphuses the current (post-BBB) static percentages because factory configs cannot switch by date.Test plan
fees/sparkdex-v3-1for 2026-05-17 → 87.5 / 2.5 / 10fees/sparkdex-v3-1for 2026-05-18 → 75 / 0 / 25 (buyback)fees/sparkdex-v4for 2026-05-17 → 75 / 5 / 20fees/sparkdex-v4for 2026-05-18 → 75 / 0 / 25 (buyback)sparkdex-v3-1/sparkdex-v4still resolve for dexs volumeNOTE: Please enable "Allow edits by maintainers".