RangeValidationModule
Function index6 functions
The RangeValidationModule stores the maximum permitted increase and decrease for each agent and update type. The discount-rate and eMode agents query it from their validate functions before the AgentHub allows an update to be injected.
| Property | Value |
|---|---|
| Access model | AgentHub owner or the configured admin of the agent |
Example outputs
Example outputs remain TODO until a production deployment is published and can be queried.
RANGE_MODULE=<range-validation-module-address>
AGENT_HUB=<agent-hub-address>
MARKET=<pt-market-address>
DISCOUNT_AGENT_ID=0
EMODE_AGENT_ID=1Schemas
A RangeConfig contains:
| Field | Type | Meaning |
|---|---|---|
maxIncrease | uint120 | Maximum permitted upward movement |
maxDecrease | uint120 | Maximum permitted downward movement |
isIncreaseRelative | bool | Interpret maxIncrease as basis points of the current value |
isDecreaseRelative | bool | Interpret maxDecrease as basis points of the current value |
When a relative flag is false, its maximum is an absolute value in the parameter's native units. A relative decrease cannot exceed 10_000 basis points.
A validation input is (from: uint256, to: uint256, updateType: string). Market-specific configuration takes precedence; when both market-specific maxima are zero, validation falls back to the default configuration.
Range configuration
getDefaultRangeConfig
RangeValidationModule.getDefaultRangeConfig(address,uint256,string) → RangeConfig0x11742eeeReturns the default movement range for an update type.
| Input | Type | Description |
|---|---|---|
agentHub | address | Agent hub contract. |
agentId | uint256 | Agent ID. |
updateType | string | Update type. |
>>> RangeValidationModule.getDefaultRangeConfig(agentHub, agentId, updateType)
TODOgetRangeConfigByMarket
RangeValidationModule.getRangeConfigByMarket(address,uint256,address,string) → RangeConfig0x8ab19807Returns the market-specific movement range for an update type.
| Input | Type | Description |
|---|---|---|
agentHub | address | Agent hub contract. |
agentId | uint256 | Agent ID. |
market | address | Market. |
updateType | string | Update type. |
>>> RangeValidationModule.getRangeConfigByMarket(agentHub, agentId, market, updateType)
TODOsetDefaultRangeConfig
RangeValidationModule.setDefaultRangeConfig(address,uint256,string,(uint120,uint120,bool,bool)) → void0xb8a14d99Sets default range config.
| Input | Type | Description |
|---|---|---|
agentHub | address | Agent hub contract. |
agentId | uint256 | Agent ID. |
updateType | string | Update type. |
rangeConfig | (uint120,uint120,bool,bool) | Range config. |
>>> RangeValidationModule.setDefaultRangeConfig(agentHub, agentId, updateType, rangeConfig)
TODOsetRangeConfigByMarket
RangeValidationModule.setRangeConfigByMarket(address,uint256,address,string,(uint120,uint120,bool,bool)) → void0x514c8cedSets range config by market.
| Input | Type | Description |
|---|---|---|
agentHub | address | Agent hub contract. |
agentId | uint256 | Agent ID. |
market | address | Market. |
updateType | string | Update type. |
rangeConfig | (uint120,uint120,bool,bool) | Range config. |
>>> RangeValidationModule.setRangeConfigByMarket(agentHub, agentId, market, updateType, rangeConfig)
TODOValidation
validate (single update)
RangeValidationModule.validate(address,uint256,address,(uint256,uint256,string)) → bool0xe5ba3a61Returns whether the proposed update satisfies the agent constraints.
| Input | Type | Description |
|---|---|---|
agentHub | address | Agent hub contract. |
agentId | uint256 | Agent ID. |
market | address | Market. |
input | (uint256,uint256,string) | One movement. |
>>> RangeValidationModule.validate(agentHub, agentId, market, input)
TODOvalidate (batch)
RangeValidationModule.validate(address,uint256,address,(uint256,uint256,string)[]) → bool0x4e2dccb2Returns whether the proposed update satisfies the agent constraints.
| Input | Type | Description |
|---|---|---|
agentHub | address | Agent hub contract. |
agentId | uint256 | Agent ID. |
market | address | Market. |
input | (uint256,uint256,string)[] | Movement array. |
>>> RangeValidationModule.validate(agentHub, agentId, market, input)
TODOThe module does not publish or execute updates. It only answers whether a proposed movement is within the configuration identified by (agentHub, agentId, updateType, market).