Skip to content

Implement dynamic fee rate computation endpoint #962

Description

@Chucks1093

Summary

Expose an endpoint that computes the effective dynamic fee rate for a given trade, factoring in base fee, volume-tier discount, protocol fee, and creator royalty.

Scope

  • GET /keys/:keyId/fee?amount=&direction=buy|sell endpoint
  • Fee components: base, volume tier, protocol, royalty returned individually
  • Volume tier discount computed from wallet 30-day volume
  • Effective rate and total fee in key units and USD returned
  • Fee config cached from contract with 5-minute TTL

Acceptance Criteria

  • All four fee components computed and returned correctly
  • Volume tier discount applied correctly based on wallet history
  • Effective rate and totals returned in both units
  • Fee config cache refreshed every 5 minutes
  • Edge cases: zero amount and max amount handled without error

ETA

12 hours

Activity

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions