Skip to content

Add strategy-level KAT rewards APR display#1128

Open
juniordevbot[bot] wants to merge 6 commits intomainfrom
feat/strategy-kat-rewards-apr
Open

Add strategy-level KAT rewards APR display#1128
juniordevbot[bot] wants to merge 6 commits intomainfrom
feat/strategy-kat-rewards-apr

Conversation

@juniordevbot
Copy link

@juniordevbot juniordevbot bot commented Mar 19, 2026

Summary

Display per-strategy KAT reward APR from Kong composition snapshots. Once katana-apr-service PR #33 merges and the webhook starts emitting strategy-addressed rows, Kong will hydrate composition[*].performance.estimated with strategy-level KAT rewards. This PR makes yearn.fi consume that data.

Ref: Kong Integration Guide (yearn/kong#372)

What changed

Schema (kongVaultSnapshotSchema.ts)

  • Made apr and apy optional in estimatedAprSchema — Kong hydration only sets apr for strategy webhook rows (component name katRewardsAPR contains "apr" not "apy"), so requiring both caused the entire estimated object to be dropped
  • Added katRewardsAPR to recognized components

Selector (kongVaultSelectors.ts)

  • Fall back to estimated.apr when estimated.apy is missing, scoped to Katana strategies only (type includes "katana") to avoid changing behavior for other chains
  • Extract katRewardsAPR from strategy estimated performance when type is katana-estimated-apr
  • Added field to TKongVaultStrategy type

Strategy UI (VaultsListStrategy.tsx / VaultStrategiesSection.tsx)

  • Show ⚔️ indicator on strategy APY when KAT rewards are present
  • Pass katRewardsAPR through from section to strategy row

How to review

  1. Start with the schema change — this is the critical fix that unblocks everything
  2. Then the selector logic — scoped katana fallback + katRewardsAPR extraction
  3. Finally the UI — minimal indicator addition

Test plan

  • TypeScript: bun run tslint passes
  • Build: bun run build passes
  • Unit tests added for: katana APR fallback, non-katana isolation, apy-preferred-over-apr
  • Manual: deploy preview → navigate to a Katana vault detail page → verify strategy rows show ⚔️ with KAT rewards APR (requires katana-apr-service PR # 33 to be merged first)

Risk / impact

  • Schema change makes apr/apy optional — low risk since .catch(null) handles missing values gracefully
  • APR fallback is scoped to katana type only — zero impact on non-Katana vaults
  • No breaking changes to existing vault-level APR display

- Schema: make estimated apr/apy optional (Kong hydration may set
  only apr for strategy-addressed rows), add katRewardsAPR component
- Selector: fall back to estimated.apr for katana strategies when
  estimated.apy is missing, extract katRewardsAPR from estimated type
- Strategy UI: show sword emoji indicator when strategy has KAT rewards
- Tests: cover katana strategy APR fallback and non-katana isolation
@vercel
Copy link

vercel bot commented Mar 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
yearnfi Ready Ready Preview, Comment Mar 20, 2026 8:36pm

Request Review

@github-actions
Copy link

github-actions bot commented Mar 19, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

…kdown

- Selector: estimatedAPY now always falls through to oracle.apy for
  Katana strategies instead of using estimated.apr (which is KAT rewards)
- UI: strategy row shows combined APY (oracle + KAT rewards)
- UI: hover tooltip breaks down Base APY and KAT Rewards APR
- Tooltip follows existing pattern (rounded-lg border surface-secondary)
- Tests updated to reflect additive behavior
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.

2 participants