[fix] CallPut - correct fees and revenue accounting - #8771
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 callput adapter exports: ====== TOTAL DAILY AGGREGATED (sum of slots per chain) ====== |
bheluga
left a comment
There was a problem hiding this comment.
@ayggdrasil thanks for the PR
The reason we are against considering premium as fees is that, LP's take risk selling the options.
And you count only premiums earned by them and not their losses, leading to inflated fees
Summary
Why
The current adapter reports identical Fees and Revenue and does not include Risk Premium. In the original CallPut submission (#8667), Risk Premium handling was removed in commit
13439beebecause it was treated as option premium. The contracts record it separately from option premium:CollectPositionFees.feeUsdis the Trade Fee.NotifyPendingAmount.pendingUsdwithpriceType = 1(RP) is the Risk Premium.priceType = 0(MP) is ignored.The adapter now reads each vault's
vaultUtilsaddress, filters the RP events, and applies:This preserves the accounting invariant
Fees = Revenue + Supply-side Revenue.Period totals and backfill request
The matching 7d and 30d figures were caused by missing historical indexed days after the adapter first went live, rather than by the event timestamp boundaries. Historical onchain checks found positive activity beyond both the 24h and 7d windows.
Please backfill CallPut from the adapter start date, 2026-01-30, after this change is merged. Once backfilled, 24h, 7d, and 30d will aggregate their actual distinct date ranges.
Validation
npm run ts-check -- --pretty falsePrevious PR: #8667