Skip to content

Add a protocol fee update endpoint for admins to change the global fee bps and treasury address #839

Description

@Chucks1093

Summary

Updating the protocol fee currently requires a direct contract call. A POST /admin/protocol/fee endpoint that submits a timelock proposal for the fee change and tracks it server-side would route the update through the required 48-hour delay automatically.

Scope

  • Add POST /admin/protocol/fee with { feeBps: number, treasuryAddress: string } body requiring a valid admin JWT
  • Validate feeBps is between 0 and 1000 and treasuryAddress is a valid Stellar address
  • Submit propose_config_change with changeType update_fee and the encoded payload
  • Store the pending proposal in the timelock_proposals table with executionNotBefore
  • Return the proposalId and executionNotBefore timestamp in the response

Acceptance Criteria

  • Timelock proposal created and stored for valid input
  • feeBps above 1000 returns 422
  • Invalid treasury address returns 422
  • Non-admin JWT returns 403
  • Response includes proposalId and executionNotBefore

ETA: 12 hours


Coordinate on Telegram

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