index/functions/validateMinMaxRelationship.md
validateMinMaxRelationship(
min,max,minLabel,maxLabel):void
Validates that min <= max constraint is satisfied.
Ensures that a minimum value does not exceed the maximum value. Supports both string and numeric inputs for flexibility.
min label max
Parameters
| Parameter | Type | Description |
|---|---|---|
min | string | number | Minimum value (can be number or string) |
max | string | number | Maximum value (can be number or string) |
minLabel | string | Label for minimum value (e.g., 'minPrice') for error messages |
maxLabel | string | Label for maximum value (e.g., 'maxPrice') for error messages |
min label max
Returns
void
Throws
If min > max
Examples
// Valid: min < max
validateMinMaxRelationship(0.5, 1.0, 'minPrice', 'maxPrice');
// Valid: min = max
validateMinMaxRelationship(100, 100, 'minLiquidity', 'maxLiquidity');
// Invalid: min > max
validateMinMaxRelationship(10, 5, 'startTick', 'endTick'); // throws