Skip to content

feat(AAV-962): BORROW_BL incentive zeroing in simulation#458

Merged
0xPabloLI merged 2 commits into
lovablefrom
feat/aav-962-borrow-bl-incentive
Jul 24, 2026
Merged

feat(AAV-962): BORROW_BL incentive zeroing in simulation#458
0xPabloLI merged 2 commits into
lovablefrom
feat/aav-962-borrow-bl-incentive

Conversation

@0xPabloLI

Copy link
Copy Markdown
Owner

Summary

Implements BORROW_BL incentive zeroing logic for Merkl supply opportunities where users have borrow positions.

Closes AAV-962

Changes

  • Type + Schema: Added borrowBlacklist?: true to CampaignGroup type, Zod schema, and OpenAPI spec
  • Zeroing logic: 4 functions in rateSimulationCalculator.ts now check group.borrowBlacklist === true && side === 'supply' and return 0 when user has borrow position
  • Golden Rule Merge pull request #1 from 0xPabloLI/fix/leverage-opportunity-spread #1: current uses wallet-only borrow, after uses total borrow — current never changes with simulation input
  • Tests: 17 new tests (5 aggregation + 8 simulation + 4 field-canary)

Design decisions

  1. current already uses walletMerklGroupMultiplier (AAV-1101) — no change needed
  2. Unified eligibility path (crossReserveNetEligibleUsdFn) needed zeroing too because it ignores merklGroupMultiplier
  3. borrowBlacklist?: true (not boolean) — only true is meaningful, absent = none

Validation

  • tsc: 0 errors
  • lint: 0 errors
  • test: 3170 passed
  • build: success

@linear-code

linear-code Bot commented Jul 21, 2026

Copy link
Copy Markdown

AAV-962

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Add borrowBlacklist to CampaignGroup type + Zod schema + OpenAPI. Zero supply incentive in 4 functions (merklGroupMultiplier, walletMerklGroupMultiplier, crossReserveNetEligibleUsdFn, walletCrossReserveNetEligibleUsdFn) when group.borrowBlacklist=true and user has borrow position. Golden Rule #1 preserved: current uses wallet-only borrow, after uses total borrow. 17 new tests (5 aggregation + 8 simulation + 4 field-canary).
@0xPabloLI
0xPabloLI merged commit 36b7105 into lovable Jul 24, 2026
18 checks passed
@0xPabloLI
0xPabloLI deleted the feat/aav-962-borrow-bl-incentive branch July 24, 2026 01:49
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.

1 participant