Summary
The settlement function currently distributes the full repayment to investors with no protocol cut. A configurable protocol fee deducted from the repayment amount before investor distribution would sustain the protocol treasury.
Scope
- Add set_settlement_fee(fee_bps: u32) admin function to configure the settlement fee (default 200 = 2%)
- Validate fee_bps is between 0 and 1000
- In settle_invoice, compute the fee as repayment_amount * fee_bps / 10000 and transfer it to the treasury
- Distribute repayment_amount minus the fee pro-rata to investors
- Emit a fee_collected event with the fee amount and treasury address
Acceptance Criteria
ETA: 24 hours
Coordinate on Telegram
Summary
The settlement function currently distributes the full repayment to investors with no protocol cut. A configurable protocol fee deducted from the repayment amount before investor distribution would sustain the protocol treasury.
Scope
Acceptance Criteria
ETA: 24 hours
Coordinate on Telegram