Skip to content

[update] prodigy-fi - update methodology for DCI volume counting#7870

Open
brt-developer wants to merge 2 commits into
DefiLlama:masterfrom
brt-developer:feat/update-prodigyfi-methodology
Open

[update] prodigy-fi - update methodology for DCI volume counting#7870
brt-developer wants to merge 2 commits into
DefiLlama:masterfrom
brt-developer:feat/update-prodigyfi-methodology

Conversation

@brt-developer

@brt-developer brt-developer commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Flagging an issue with our previous adapter: Not covered upgraded version of smart contracts.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Summary by CodeRabbit

  • New Features

    • Updated Prodigy.Fi volume tracking to use vault metadata for daily volume calculations.
    • Improved support across multiple chain versions for more accurate reporting.
  • Bug Fixes

    • Fixed volume calculations that could previously rely on older deposit-event handling.
    • Made Premium Volume and Notional Volume totals more consistent with vault activity.

Walkthrough

The Prodigy-Fi adapter now resolves versioned vault metadata from shared config and event signatures, stores quantity with each vault record, and computes daily notional and premium volume from the resolved metadata. Methodology text was updated to match the new aggregation model.

Changes

Prodigy-Fi metadata and volume aggregation update

Layer / File(s) Summary
Shared types, event signatures, and chain config
options/prodigy-fi/interfaces.ts
Adds shared block range, vault metadata, chain config, and vault query types, plus versioned deposit event signatures and per-chain configuration entries.
Vault metadata normalization and versioned log parsing
options/prodigy-fi/index.ts
Updates metadata storage to require quantity, normalizes token fields, partitions vault log queries into v2, v1_1, and v1 ranges, and extracts quantity and yield values from the corresponding log shapes.
Daily notional and premium aggregation
options/prodigy-fi/index.ts
Replaces Deposit-event aggregation with sums derived from resolved vault metadata and updates the methodology strings to describe the new calculation model.

Estimated code review effort: 4 (Complex) | ~40 minutes

Suggested labels: methodology, bug-fix

🚥 Pre-merge checks | ✅ 13 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 50.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Efficiency And Error Handling ⚠️ Warning interfaces.ts hardcodes factory addresses and block numbers with no provenance/source comments; I found no other listed antipatterns. Add brief source comments for each address/block set (deployment or scan refs), or move them to a sourced config; keep eventAbi/getLogs usage.
✅ Passed checks (13 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the required format and clearly describes the Prodigy.Fi methodology update.
Description check ✅ Passed The description is brief, but it provides a valid reason for the change and the listing form can be ignored for this non-listing update.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Breakdown Methodology Check ✅ Passed Not applicable: this is an options SimpleAdapter; its .add() calls are token balance adds, and no breakdownMethodology/fee breakdown labels exist.
Income Statement Compliance ✅ Passed Not applicable: prodigy-fi only exports dailyNotionalVolume and dailyPremiumVolume, not fee/revenue/supply-side fields.
Version 2 Required ✅ Passed options/prodigy-fi/index.ts exports version: 2, so the adapter uses the required v2 format.
Pullhourly Required For Version 2 ✅ Passed The v2 adapter explicitly sets pullHourly: true in options/prodigy-fi/index.ts.
Dune Adapters Are Version 1 ✅ Passed prodigy-fi uses getLogs only; no queryDuneSql/queryDune/TIME_RANGE or Dune helpers are present, so the version-1 rule is not applicable.
Income Statement Balance ✅ Passed Not applicable: this adapter only computes notional/premium volume; there are no dailyFees/dailyRevenue/supply-side fields or fee attribution logic.
Fetchoptions Usage ✅ Passed fetch(options: FetchOptions) is used; it relies on getFromBlock/getToBlock and returns only balances, with no timestamp or old 3-arg signature.
Adapter Shape ✅ Passed Prodigy-Fi uses one per-chain config object with start per chain and fetch reads config[options.chain]; no separate chains/start maps are maintained.
Methodology Keys ✅ Passed adapter.methodology uses NotionalVolume and PremiumVolume keys, not daily* code field names.
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified 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.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@options/prodigy-fi/index.ts`:
- Around line 108-121: The fallback in toNotional() is masking invalid buy-low
pricing by returning principal when strike or spotPrice is zero/missing, which
can misclassify notional as premium. Update toNotional() in
options/prodigy-fi/index.ts to treat invalid buy-low metadata as an error path
instead of a silent fallback, and ensure the caller(s) around the VaultMetadata
parsing/use sites propagate or log that failure rather than continuing with
principal. Keep the buy-low vs sell-high distinction intact so options adapters
do not confuse notional and premium volume.
🪄 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: 30660e3e-d706-4d7e-bc7c-3e7aa82beda8

📥 Commits

Reviewing files that changed from the base of the PR and between 0bf4225 and a92068a6b249160a1fb9dc508a7e5cf5110e4944.

📒 Files selected for processing (1)
  • options/prodigy-fi/index.ts

Comment thread options/prodigy-fi/index.ts Outdated
@brt-developer brt-developer changed the title Update prodigyfi methodology [update] prodigy-fi - update methodology for DCI volume counting' Jun 28, 2026
@brt-developer brt-developer changed the title [update] prodigy-fi - update methodology for DCI volume counting' [update] prodigy-fi - update methodology for DCI volume counting Jun 28, 2026
@github-actions

Copy link
Copy Markdown

The prodigy-fi adapter exports:

> adapters@1.0.0 test
> ts-node --transpile-only cli/testAdapter.ts options prodigy-fi

🦙 Running PRODIGY-FI adapter 🦙
---------------------------------------------------
Start Date:	Sat, 27 Jun 2026 14:00:00 GMT
End Date:	Sun, 28 Jun 2026 14:00:00 GMT
---------------------------------------------------

 (1/24) start: 2 PM - 27/06    |  notional volume - 675.11 k | premium volume - 677.87 k
 (2/24) start: 3 PM - 27/06    |  notional volume - 527.06 k | premium volume - 529.66 k
 (3/24) start: 4 PM - 27/06    |  notional volume - 79.88 k | premium volume - 79.98 k
 (4/24) start: 5 PM - 27/06    |  notional volume - 78.40 k | premium volume - 78.40 k
 (5/24) start: 6 PM - 27/06    |  notional volume - 36.32 k | premium volume - 54.89 k
 (6/24) start: 7 PM - 27/06    |  notional volume - 0.00 | premium volume - 0.00
 (7/24) start: 8 PM - 27/06    |  notional volume - 0.00 | premium volume - 0.00
 (8/24) start: 9 PM - 27/06    |  notional volume - 69.01 k | premium volume - 68.90 k
 (9/24) start: 10 PM - 27/06    |  notional volume - 217.07 k | premium volume - 212.16 k
(10/24) start: 11 PM - 27/06    |  notional volume - 185.55 k | premium volume - 182.99 k
(11/24) start: 12 AM - 28/06    |  notional volume - 29.79 k | premium volume - 29.79 k
(12/24) start: 1 AM - 28/06    |  notional volume - 60.07 k | premium volume - 59.98 k
(13/24) start: 2 AM - 28/06    |  notional volume - 78.40 k | premium volume - 78.40 k
(14/24) start: 3 AM - 28/06    |  notional volume - 0.00 | premium volume - 0.00
(15/24) start: 4 AM - 28/06    |  notional volume - 1.14 M | premium volume - 1.13 M
(16/24) start: 5 AM - 28/06    |  notional volume - 395.72 k | premium volume - 393.55 k
(17/24) start: 6 AM - 28/06    |  notional volume - 0.00 | premium volume - 0.00
(18/24) start: 7 AM - 28/06    |  notional volume - 0.00 | premium volume - 0.00
(19/24) start: 8 AM - 28/06    |  notional volume - 1.12 M | premium volume - 1.12 M
(20/24) start: 9 AM - 28/06    |  notional volume - 564.37 k | premium volume - 563.45 k
(21/24) start: 10 AM - 28/06    |  notional volume - 235.56 k | premium volume - 233.02 k
(22/24) start: 11 AM - 28/06    |  notional volume - 78.78 k | premium volume - 78.73 k
(23/24) start: 12 PM - 28/06    |  notional volume - 78.40 k | premium volume - 78.40 k
(24/24) start: 1 PM - 28/06    |  notional volume - 119.66 k | premium volume - 118.56 k

====== TOTAL DAILY AGGREGATED (sum of slots per chain) ======

chain     | Daily notional volume | Daily premium volume
---       | ---                   | ---                 
ethereum  | 1.26 M                | 1.26 M              
base      | 4.47 M                | 4.47 M              
berachain | 43.95 k               | 43.53 k             
Aggregate | 5.77 M                | 5.77 M              



FEES BREAKDOWN 👇

@github-actions

Copy link
Copy Markdown

The prodigy-fi adapter exports:

> adapters@1.0.0 test
> ts-node --transpile-only cli/testAdapter.ts options prodigy-fi

🦙 Running PRODIGY-FI adapter 🦙
---------------------------------------------------
Start Date:	Sat, 27 Jun 2026 14:00:00 GMT
End Date:	Sun, 28 Jun 2026 14:00:00 GMT
---------------------------------------------------

 (1/24) start: 2 PM - 27/06    |  notional volume - 675.11 k | premium volume - 677.87 k
 (2/24) start: 3 PM - 27/06    |  notional volume - 527.06 k | premium volume - 529.66 k
 (3/24) start: 4 PM - 27/06    |  notional volume - 79.88 k | premium volume - 79.98 k
 (4/24) start: 5 PM - 27/06    |  notional volume - 78.40 k | premium volume - 78.40 k
 (5/24) start: 6 PM - 27/06    |  notional volume - 36.32 k | premium volume - 54.89 k
 (6/24) start: 7 PM - 27/06    |  notional volume - 217.86 k | premium volume - 215.01 k
 (7/24) start: 8 PM - 27/06    |  notional volume - 0.00 | premium volume - 0.00
 (8/24) start: 9 PM - 27/06    |  notional volume - 68.94 k | premium volume - 68.83 k
 (9/24) start: 10 PM - 27/06    |  notional volume - 217.05 k | premium volume - 212.13 k
(10/24) start: 11 PM - 27/06    |  notional volume - 185.45 k | premium volume - 182.89 k
(11/24) start: 12 AM - 28/06    |  notional volume - 29.77 k | premium volume - 29.77 k
(12/24) start: 1 AM - 28/06    |  notional volume - 60.07 k | premium volume - 59.98 k
(13/24) start: 2 AM - 28/06    |  notional volume - 78.40 k | premium volume - 78.40 k
(14/24) start: 3 AM - 28/06    |  notional volume - 0.00 | premium volume - 0.00
(15/24) start: 4 AM - 28/06    |  notional volume - 1.14 M | premium volume - 1.13 M
(16/24) start: 5 AM - 28/06    |  notional volume - 395.52 k | premium volume - 393.35 k
(17/24) start: 6 AM - 28/06    |  notional volume - 0.00 | premium volume - 0.00
(18/24) start: 7 AM - 28/06    |  notional volume - 0.00 | premium volume - 0.00
(19/24) start: 8 AM - 28/06    |  notional volume - 1.12 M | premium volume - 1.12 M
(20/24) start: 9 AM - 28/06    |  notional volume - 3.14 k | premium volume - 3.14 k
(21/24) start: 10 AM - 28/06    |  notional volume - 235.55 k | premium volume - 233.02 k
(22/24) start: 11 AM - 28/06    |  notional volume - 78.77 k | premium volume - 78.73 k
(23/24) start: 12 PM - 28/06    |  notional volume - 78.40 k | premium volume - 78.40 k
(24/24) start: 1 PM - 28/06    |  notional volume - 119.61 k | premium volume - 118.52 k

====== TOTAL DAILY AGGREGATED (sum of slots per chain) ======

chain     | Daily notional volume | Daily premium volume
---       | ---                   | ---                 
ethereum  | 1.26 M                | 1.26 M              
base      | 4.12 M                | 4.12 M              
berachain | 43.95 k               | 43.53 k             
Aggregate | 5.43 M                | 5.42 M              



FEES BREAKDOWN 👇

@bheluga bheluga self-assigned this Jun 29, 2026
@brt-developer

Copy link
Copy Markdown
Contributor Author

@bheluga Can you review this one? Thanks

@bheluga bheluga left a comment

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.

@brt-developer thanks for the PR.
Previous approach was correct,
Notional Volume : Principal Deposited
Premium Volume: Yields /Premium earned.
We use similar approach among other similar protocols

@brt-developer
brt-developer force-pushed the feat/update-prodigyfi-methodology branch from 291af25 to ccc1a73 Compare July 6, 2026 16:23

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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 `@options/prodigy-fi/index.ts`:
- Around line 143-147: The volume aggregation in the dayVaults loop is mixing
principal and premium values instead of separating notional exposure from
premium commitment. Update the metadata parsing path behind
fetchVaultMetadataRange so each vault carries distinct notional and premium
amounts, then change the dailyNotionalVolume and dailyPremiumVolume adds here to
use those precomputed fields rather than quantity and quantity * yieldValue /
WAD. Reference the dayVaults processing in the options/prodigy-fi index flow and
the metadata shape returned by fetchVaultMetadataRange.

In `@options/prodigy-fi/interfaces.ts`:
- Around line 5-9: VaultMetadata is missing the side, base/linked token, and
pricing fields needed for downstream notional calculations. Update the
VaultMetadata type to retain those metadata fields used by the options adapters,
or add a separate precomputed notional token/amount alongside token, quantity,
and yieldValue so aggregation can distinguish notional from premium volume.
Locate the change in VaultMetadata and keep the existing metadata shape aligned
with the notional computation flow.
- Around line 28-50: Add inline source comments for the hardcoded values in
config so maintainers can verify them later. Update the ChainConfig entries in
interfaces.ts for CHAIN.ETHEREUM, CHAIN.BASE, and CHAIN.BERACHAIN to annotate
the factory addresses, v1StartBlock, v1_1StartBlock, v2StartBlock, and start
date with the originating source or reference link where possible. Keep the
comments close to the relevant constants so the rationale for each magic number
is easy to find.
🪄 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: 0b4c011b-d1ed-4b24-a6be-b6ed0b5ddc67

📥 Commits

Reviewing files that changed from the base of the PR and between 291af255fc76ecc616a3f8e6338ee2db38df18f1 and ccc1a7368eaba7690cc39cfb7618dba2a32ca853.

📒 Files selected for processing (2)
  • options/prodigy-fi/index.ts
  • options/prodigy-fi/interfaces.ts

Comment thread options/prodigy-fi/index.ts
Comment on lines +5 to +9
export type VaultMetadata = {
token: string;
quantity: bigint;
yieldValue: bigint;
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Preserve side/pricing metadata needed for notional calculation.

VaultMetadata now only carries the investment token quantity, so downstream aggregation cannot compute buy-low notional as underlying base-asset exposure as described in the PR objective. Keep fields such as side, linked/base token, and pricing inputs in metadata, or precompute a separate notional token/amount before storing.

As per path instructions, options adapters must not confuse notional vs premium volume.

🤖 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 `@options/prodigy-fi/interfaces.ts` around lines 5 - 9, VaultMetadata is
missing the side, base/linked token, and pricing fields needed for downstream
notional calculations. Update the VaultMetadata type to retain those metadata
fields used by the options adapters, or add a separate precomputed notional
token/amount alongside token, quantity, and yieldValue so aggregation can
distinguish notional from premium volume. Locate the change in VaultMetadata and
keep the existing metadata shape aligned with the notional computation flow.

Source: Path instructions

Comment on lines +28 to +50
export const config: Record<string, ChainConfig> = {
[CHAIN.ETHEREUM]: {
factory: "0xAC2a612C49f29e26858Df1a53f7623180bcc3753",
v1StartBlock: 23831175,
v1_1StartBlock: 23831175,
v2StartBlock: 24036992,
start: "2025-11-19"
},
[CHAIN.BASE]: {
factory: "0xFE198B51cfb1F96b56c63fe323a934BEAAA3b281",
v1StartBlock: 22133150,
v1_1StartBlock: 30509116,
v2StartBlock: 39795788,
start: "2024-11-08"
},
[CHAIN.BERACHAIN]: {
factory: "0x29ca87b2f744127606ada4564da8219be6498ca1",
v1StartBlock: 804138,
v1_1StartBlock: 5297670,
v2StartBlock: 14682550,
start: "2025-02-07"
},
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add source comments for hardcoded chain constants.

The factory addresses, start blocks, version boundary blocks, and start dates need inline comments/source links so maintainers can verify them later.

As per coding guidelines, “Add a comment (and a source link where possible) for any hardcoded rate, address, or magic number.”

🤖 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 `@options/prodigy-fi/interfaces.ts` around lines 28 - 50, Add inline source
comments for the hardcoded values in config so maintainers can verify them
later. Update the ChainConfig entries in interfaces.ts for CHAIN.ETHEREUM,
CHAIN.BASE, and CHAIN.BERACHAIN to annotate the factory addresses, v1StartBlock,
v1_1StartBlock, v2StartBlock, and start date with the originating source or
reference link where possible. Keep the comments close to the relevant constants
so the rationale for each magic number is easy to find.

Source: Coding guidelines

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

The prodigy-fi adapter exports:

> adapters@1.0.0 test
> ts-node --transpile-only cli/testAdapter.ts options prodigy-fi

🦙 Running PRODIGY-FI adapter 🦙
---------------------------------------------------
Start Date:	Sun, 05 Jul 2026 13:00:00 GMT
End Date:	Mon, 06 Jul 2026 13:00:00 GMT
---------------------------------------------------

 (1/24) start: 1 PM - 05/07    |  notional volume - 0.00 | premium volume - 0.00
 (2/24) start: 2 PM - 05/07    |  notional volume - 0.00 | premium volume - 0.00
 (3/24) start: 3 PM - 05/07    |  notional volume - 255.45 k | premium volume - 2.66 k
 (4/24) start: 4 PM - 05/07    |  notional volume - 31.37 k | premium volume - 271.00
 (5/24) start: 5 PM - 05/07    |  notional volume - 695.36 k | premium volume - 5.90 k
 (6/24) start: 6 PM - 05/07    |  notional volume - 31.76 k | premium volume - 262.00
 (7/24) start: 7 PM - 05/07    |  notional volume - 93.61 k | premium volume - 844.00
 (8/24) start: 8 PM - 05/07    |  notional volume - 89.49 k | premium volume - 1.30 k
 (9/24) start: 9 PM - 05/07    |  notional volume - 400.30 k | premium volume - 2.37 k
(10/24) start: 10 PM - 05/07    |  notional volume - 826.19 k | premium volume - 9.76 k
(11/24) start: 11 PM - 05/07    |  notional volume - 275.74 k | premium volume - 3.54 k
(12/24) start: 12 AM - 06/07    |  notional volume - 403.82 k | premium volume - 2.32 k
(13/24) start: 1 AM - 06/07    |  notional volume - 0.00 | premium volume - 0.00
(14/24) start: 2 AM - 06/07    |  notional volume - 38.88 k | premium volume - 818.00
(15/24) start: 3 AM - 06/07    |  notional volume - 3.50 k | premium volume - 37.00
(16/24) start: 4 AM - 06/07    |  notional volume - 2.17 M | premium volume - 19.05 k
(17/24) start: 5 AM - 06/07    |  notional volume - 692.07 k | premium volume - 6.85 k
(18/24) start: 6 AM - 06/07    |  notional volume - 468.66 k | premium volume - 3.30 k
(19/24) start: 7 AM - 06/07    |  notional volume - 0.00 | premium volume - 0.00
(20/24) start: 8 AM - 06/07    |  notional volume - 90.05 k | premium volume - 2.45 k
(21/24) start: 9 AM - 06/07    |  notional volume - 739.74 k | premium volume - 5.44 k
(22/24) start: 10 AM - 06/07    |  notional volume - 0.00 | premium volume - 0.00
(23/24) start: 11 AM - 06/07    |  notional volume - 0.00 | premium volume - 0.00
(24/24) start: 12 PM - 06/07    |  notional volume - 1.06 M | premium volume - 8.49 k

====== TOTAL DAILY AGGREGATED (sum of slots per chain) ======

chain     | Daily notional volume | Daily premium volume
---       | ---                   | ---                 
ethereum  | 2.13 M                | 18.07 k             
base      | 6.11 M                | 56.73 k             
berachain | 116.11 k              | 846.00              
Aggregate | 8.36 M                | 75.66 k             



FEES BREAKDOWN 👇

@brt-developer
brt-developer force-pushed the feat/update-prodigyfi-methodology branch from ccc1a73 to fe2a2f9 Compare July 6, 2026 17:00
@brt-developer

Copy link
Copy Markdown
Contributor Author

@bheluga

Thanks for the review. Please check again. We covered an upgraded version of smart contracts that was not included before.

Notional Volume : The total value of the underlying asset in an option or derivative contract
Premium Volume: The price paid up front to buy or sell option or derivative contract.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@options/prodigy-fi/index.ts`:
- Around line 40-45: The vault metadata parsing in the Prodigy FI indexer is
silently skipping malformed entries and defaulting missing yieldValue to zero,
which hides ABI/config drift. Update the parsing logic around the vaults.set
path to validate required fields explicitly, and if vaultAddress,
investmentToken, quantity, or yieldValue are missing or invalid, surface an
error or throw instead of returning early or coercing defaults. Use the existing
vaults.set flow and the related parser in options/prodigy-fi/index.ts to
centralize this validation so malformed metadata fails visibly.
🪄 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: df3225ea-97c9-4b64-a898-e23c1bcec85f

📥 Commits

Reviewing files that changed from the base of the PR and between ccc1a7368eaba7690cc39cfb7618dba2a32ca853 and fe2a2f9.

📒 Files selected for processing (2)
  • options/prodigy-fi/index.ts
  • options/prodigy-fi/interfaces.ts

Comment thread options/prodigy-fi/index.ts Outdated
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

The prodigy-fi adapter exports:

> adapters@1.0.0 test
> ts-node --transpile-only cli/testAdapter.ts options prodigy-fi

🦙 Running PRODIGY-FI adapter 🦙
---------------------------------------------------
Start Date:	Sun, 05 Jul 2026 14:00:00 GMT
End Date:	Mon, 06 Jul 2026 14:00:00 GMT
---------------------------------------------------

 (1/24) start: 2 PM - 05/07    |  notional volume - 0.00 | premium volume - 0.00
 (2/24) start: 3 PM - 05/07    |  notional volume - 255.45 k | premium volume - 2.66 k
 (3/24) start: 4 PM - 05/07    |  notional volume - 31.37 k | premium volume - 271.00
 (4/24) start: 5 PM - 05/07    |  notional volume - 693.40 k | premium volume - 5.90 k
 (5/24) start: 6 PM - 05/07    |  notional volume - 31.84 k | premium volume - 263.00
 (6/24) start: 7 PM - 05/07    |  notional volume - 93.11 k | premium volume - 839.00
 (7/24) start: 8 PM - 05/07    |  notional volume - 89.48 k | premium volume - 1.30 k
 (8/24) start: 9 PM - 05/07    |  notional volume - 400.01 k | premium volume - 2.37 k
 (9/24) start: 10 PM - 05/07    |  notional volume - 825.55 k | premium volume - 9.76 k
(10/24) start: 11 PM - 05/07    |  notional volume - 275.89 k | premium volume - 3.54 k
(11/24) start: 12 AM - 06/07    |  notional volume - 403.56 k | premium volume - 2.32 k
(12/24) start: 1 AM - 06/07    |  notional volume - 0.00 | premium volume - 0.00
(13/24) start: 2 AM - 06/07    |  notional volume - 39.01 k | premium volume - 821.00
(14/24) start: 3 AM - 06/07    |  notional volume - 3.50 k | premium volume - 37.00
(15/24) start: 4 AM - 06/07    |  notional volume - 2.16 M | premium volume - 19.01 k
(16/24) start: 5 AM - 06/07    |  notional volume - 689.70 k | premium volume - 6.82 k
(17/24) start: 6 AM - 06/07    |  notional volume - 468.00 k | premium volume - 3.29 k
(18/24) start: 7 AM - 06/07    |  notional volume - 0.00 | premium volume - 0.00
(19/24) start: 8 AM - 06/07    |  notional volume - 89.53 k | premium volume - 2.44 k
(20/24) start: 9 AM - 06/07    |  notional volume - 737.54 k | premium volume - 5.41 k
(21/24) start: 10 AM - 06/07    |  notional volume - 0.00 | premium volume - 0.00
(22/24) start: 11 AM - 06/07    |  notional volume - 0.00 | premium volume - 0.00
(23/24) start: 12 PM - 06/07    |  notional volume - 1.06 M | premium volume - 8.47 k
(24/24) start: 1 PM - 06/07    |  notional volume - 744.30 k | premium volume - 6.47 k

====== TOTAL DAILY AGGREGATED (sum of slots per chain) ======

chain     | Daily notional volume | Daily premium volume
---       | ---                   | ---                 
ethereum  | 2.20 M                | 19.16 k             
base      | 6.76 M                | 61.84 k             
berachain | 137.56 k              | 977.00              
Aggregate | 9.09 M                | 81.98 k             



FEES BREAKDOWN 👇

@coderabbitai coderabbitai Bot added the bug-fix label Jul 8, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
options/prodigy-fi/index.ts (2)

157-164: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Add breakdownMethodology for the returned dimensions.

The adapter returns dailyNotionalVolume and dailyPremiumVolume, but the shown adapter config only includes methodology. Add matching breakdown text so validators/reviewers can verify the aggregation model.

Proposed fix
   methodology: {
     NotionalVolume: "The total value of the underlying asset in an option or derivative contract.",
     PremiumVolume: "The price paid up front to buy or sell option or derivative contract.",
   },
+  breakdownMethodology: {
+    NotionalVolume: "Sum of vault quantities from Prodigy.Fi VaultCreated events.",
+    PremiumVolume: "Sum of vault quantity multiplied by yieldValue, scaled by WAD, from Prodigy.Fi VaultCreated events.",
+  },

As per coding guidelines, “Return token breakdown where possible - always include methodology and breakdownMethodology.”

🤖 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 `@options/prodigy-fi/index.ts` around lines 157 - 164, The returned adapter
config in the `SimpleAdapter` object is missing `breakdownMethodology`, even
though `fetch` exposes `dailyNotionalVolume` and `dailyPremiumVolume`. Add a
`breakdownMethodology` field alongside the existing `methodology` in the adapter
returned from `options/prodigy-fi/index.ts`, using matching breakdown text for
the returned dimensions so validators can confirm the aggregation model.

Source: Coding guidelines


148-148: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Document the yieldValue scale used here. The 1e18 divisor is an implicit assumption across all three vault versions; add a source/comment so future ABI changes don’t silently skew dailyPremiumVolume.

🤖 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 `@options/prodigy-fi/index.ts` at line 148, The dailyPremiumVolume calculation
in the Prodigy FI options logic assumes metadata.yieldValue is WAD-scaled, but
that scale is currently implicit. Add an in-code comment or nearby documentation
in the same flow around dailyPremiumVolume.add and the metadata.yieldValue usage
to explicitly state the 1e18/WAD assumption and note that it applies across all
vault versions. Reference the metadata fields and WAD constant so future ABI
changes are easy to audit.

Source: Coding guidelines

🤖 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.

Outside diff comments:
In `@options/prodigy-fi/index.ts`:
- Around line 157-164: The returned adapter config in the `SimpleAdapter` object
is missing `breakdownMethodology`, even though `fetch` exposes
`dailyNotionalVolume` and `dailyPremiumVolume`. Add a `breakdownMethodology`
field alongside the existing `methodology` in the adapter returned from
`options/prodigy-fi/index.ts`, using matching breakdown text for the returned
dimensions so validators can confirm the aggregation model.
- Line 148: The dailyPremiumVolume calculation in the Prodigy FI options logic
assumes metadata.yieldValue is WAD-scaled, but that scale is currently implicit.
Add an in-code comment or nearby documentation in the same flow around
dailyPremiumVolume.add and the metadata.yieldValue usage to explicitly state the
1e18/WAD assumption and note that it applies across all vault versions.
Reference the metadata fields and WAD constant so future ABI changes are easy to
audit.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 41d6337e-9d9e-44cc-aeee-f3dd62f7cb81

📥 Commits

Reviewing files that changed from the base of the PR and between fe2a2f9 and 67d04a4.

📒 Files selected for processing (1)
  • options/prodigy-fi/index.ts

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

The prodigy-fi adapter exports:

> adapters@1.0.0 test
> ts-node --transpile-only cli/testAdapter.ts options prodigy-fi

🦙 Running PRODIGY-FI adapter 🦙
---------------------------------------------------
Start Date:	Tue, 07 Jul 2026 09:00:00 GMT
End Date:	Wed, 08 Jul 2026 09:00:00 GMT
---------------------------------------------------

 (1/24) start: 9 AM - 07/07    |  notional volume - 393.01 k | premium volume - 3.59 k
 (2/24) start: 10 AM - 07/07    |  notional volume - 212.78 k | premium volume - 655.00
 (3/24) start: 11 AM - 07/07    |  notional volume - 3.54 k | premium volume - 36.00
 (4/24) start: 12 PM - 07/07    |  notional volume - 914.94 k | premium volume - 6.84 k
 (5/24) start: 1 PM - 07/07    |  notional volume - 0.00 | premium volume - 0.00
 (6/24) start: 2 PM - 07/07    |  notional volume - 61.66 k | premium volume - 591.00
 (7/24) start: 3 PM - 07/07    |  notional volume - 154.15 k | premium volume - 2.39 k
 (8/24) start: 4 PM - 07/07    |  notional volume - 568.14 k | premium volume - 4.35 k
 (9/24) start: 5 PM - 07/07    |  notional volume - 98.65 k | premium volume - 814.00
(10/24) start: 6 PM - 07/07    |  notional volume - 209.47 k | premium volume - 1.26 k
(11/24) start: 7 PM - 07/07    |  notional volume - 0.00 | premium volume - 0.00
(12/24) start: 8 PM - 07/07    |  notional volume - 0.00 | premium volume - 0.00
(13/24) start: 9 PM - 07/07    |  notional volume - 0.00 | premium volume - 0.00
(14/24) start: 10 PM - 07/07    |  notional volume - 6.97 k | premium volume - 36.00
(15/24) start: 11 PM - 07/07    |  notional volume - 0.00 | premium volume - 0.00
(16/24) start: 12 AM - 08/07    |  notional volume - 3.54 k | premium volume - 33.00
(17/24) start: 1 AM - 08/07    |  notional volume - 261.98 k | premium volume - 2.72 k
(18/24) start: 2 AM - 08/07    |  notional volume - 199.07 k | premium volume - 2.32 k
(19/24) start: 3 AM - 08/07    |  notional volume - 216.55 k | premium volume - 1.23 k
(20/24) start: 4 AM - 08/07    |  notional volume - 1.25 M | premium volume - 8.86 k
(21/24) start: 5 AM - 08/07    |  notional volume - 0.00 | premium volume - 0.00
(22/24) start: 6 AM - 08/07    |  notional volume - 312.26 k | premium volume - 6.69 k
(23/24) start: 7 AM - 08/07    |  notional volume - 0.00 | premium volume - 0.00
(24/24) start: 8 AM - 08/07    |  notional volume - 1.96 M | premium volume - 17.07 k

====== TOTAL DAILY AGGREGATED (sum of slots per chain) ======

chain     | Daily notional volume | Daily premium volume
---       | ---                   | ---                 
ethereum  | 1.26 M                | 10.92 k             
base      | 5.47 M                | 47.96 k             
berachain | 97.92 k               | 622.00              
Aggregate | 6.83 M                | 59.50 k             



FEES BREAKDOWN 👇

@brt-developer
brt-developer requested a review from bheluga July 11, 2026 04:10

@bheluga bheluga left a comment

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.

@brt-developer when is vaultCreated event emitted?

is it on creation of vaults or when an user subscribes to the contract?
also what does quantity signify?

@brt-developer

Copy link
Copy Markdown
Contributor Author

@bheluga

vaultCreated event occurs with the creation/opening of an initial position on a derivatives/options contract.
quantity is the initial position size of the derivatives/options contract

@bheluga

bheluga commented Jul 13, 2026

Copy link
Copy Markdown
Member

@bheluga

vaultCreated event occurs with the creation/opening of an initial position on a derivatives/options contract. quantity is the initial position size of the derivatives/options contract

Hey @brt-developer we cant consider that as volume,
only user trades can be counted as volume

@brt-developer

Copy link
Copy Markdown
Contributor Author

@bheluga

by definition, a trade is required to change a user's derivatives/options position.
so creating/opening/changing an derivatives/options position is a trade

@bheluga

bheluga commented Jul 13, 2026

Copy link
Copy Markdown
Member

@bheluga

by definition, a trade is required to change a user's derivatives/options position. so creating/opening/changing an derivatives/options position is a trade

No, it should be traded by users, or else a protocol can create a vault of size 100m and claim volume as 100m

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants