Skip to content

core: implement sponsor yield calculation service #35

@EmeditWeb

Description

@EmeditWeb

Problem

Sponsors have no way to see their earned yield.
The API does not calculate yield based on share
price changes.

What To Build

  1. Create src/modules/yield/yield.service.ts
  2. GET /sponsors/yield endpoint
  3. Daily yield snapshots via BullMQ

Files To Touch

  • src/modules/yield/ (new)
  • src/modules/sponsors/sponsors.controller.ts
  • supabase/migrations/[ts]_yield_snapshots.sql

Acceptance Criteria

  • Yield calculated correctly from share price
  • APY calculation uses actual time held
  • Daily snapshots stored
  • History available for charts
  • npm run build passes

Mandatory Checks Before PR

  • npm run build passes
  • No any types
  • Unit tests for yield calculation
  • PR references this issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions