📌 Description
quote_fee and open_settlement's fee calculation both use amount * bps / BPS_DENOMINATOR (i128 floor division against a denominator of 10_000), meaning the computed fee always rounds down and can round to 0 for small amounts at low rates — behavior confirmed by quote_fee's own doc comment ("never exceeds the input amount") but not spelled out anywhere in the README for integrators who only read the interface table.
🧩 Requirements and context
- Add a short paragraph to the README's fee-related section explaining the basis-points convention (1 bps = 0.01%), the
10_000 denominator, and the floor-rounding behavior including the zero-fee-at-small-amounts edge case.
- Cross-reference
max_fee_bps() as the authoritative source for the current fee cap, avoiding a hardcoded '10%' claim that could drift from MAX_FEE_BPS in src/lib.rs.
- Link to the fee-truncation regression tests (tracked separately in this backlog) as the executable specification of this behavior.
🛠️ Suggested execution
- Add the paragraph to
README.md near the existing set_fee/quote_fee/asset_fee table rows.
- No code changes — this is a pure documentation task.
- Keep wording consistent with the doc comments already present in
src/lib.rs for quote_fee and set_fee.
✅ Acceptance criteria
🔒 Security notes
Integrators who assume fees round up, or who don't realize a fee can legitimately be zero for a tiny settlement, could build off-chain accounting that mismatches on-chain accrual by a rounding difference that compounds across many small settlements.
📋 Guidelines
- Minimum 95% test coverage
- Clear documentation
- Timeframe: 96 hours
📌 Description
quote_feeandopen_settlement's fee calculation both useamount * bps / BPS_DENOMINATOR(i128floor division against a denominator of10_000), meaning the computed fee always rounds down and can round to0for small amounts at low rates — behavior confirmed byquote_fee's own doc comment ("never exceeds the input amount") but not spelled out anywhere in the README for integrators who only read the interface table.🧩 Requirements and context
10_000denominator, and the floor-rounding behavior including the zero-fee-at-small-amounts edge case.max_fee_bps()as the authoritative source for the current fee cap, avoiding a hardcoded '10%' claim that could drift fromMAX_FEE_BPSinsrc/lib.rs.🛠️ Suggested execution
README.mdnear the existingset_fee/quote_fee/asset_feetable rows.src/lib.rsforquote_feeandset_fee.✅ Acceptance criteria
max_fee_bps()rather than a hardcoded number.🔒 Security notes
Integrators who assume fees round up, or who don't realize a fee can legitimately be zero for a tiny settlement, could build off-chain accounting that mismatches on-chain accrual by a rounding difference that compounds across many small settlements.
📋 Guidelines