Skip to main content

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)

Parameters​

ParameterTypeDescription
minFeestring | numberMinimum fee portion (0.1 to 0.5)
maxFeestring | numberMaximum fee portion (0.1 to 0.5)
fieldNamestringField name for error messages

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