index/functions/validateFeePortionConstraints.md
validateFeePortionConstraints(
minFee,maxFee,fieldName):void
Validates reverse bonding curve fee portion bounds.
Ensures that:
- minFee >= 0.1 (minimum fee portion)
- maxFee <= 0.5 (maximum fee portion)
- minFee <= maxFee (logical ordering)
min fee max field name
Parameters
| Parameter | Type | Description |
|---|---|---|
minFee | string | number | Minimum fee portion (0.1 to 0.5) |
maxFee | string | number | Maximum fee portion (0.1 to 0.5) |
fieldName | string | Field name for error messages |
min fee max field name
Returns
void
Throws
If constraints are violated
Examples
// Valid: min=0.1, max=0.5
validateFeePortionConstraints('0.1', '0.5', 'reverseBondingCurve');
// Invalid: max > 0.5
validateFeePortionConstraints(0.1, 0.6, 'feeConfig'); // throws
// Invalid: min < 0.1
validateFeePortionConstraints(0.05, 0.5, 'feeConfig'); // throws
// Invalid: min > max
validateFeePortionConstraints(0.4, 0.2, 'feeConfig'); // throws