LlamaRisk

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.

PropertyValue
Access modelAgentHub 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=1

Schemas

A RangeConfig contains:

FieldTypeMeaning
maxIncreaseuint120Maximum permitted upward movement
maxDecreaseuint120Maximum permitted downward movement
isIncreaseRelativeboolInterpret maxIncrease as basis points of the current value
isDecreaseRelativeboolInterpret 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) → RangeConfig0x11742eee

Returns the default movement range for an update type.

InputTypeDescription
agentHubaddressAgent hub contract.
agentIduint256Agent ID.
updateTypestringUpdate type.
Example
>>> RangeValidationModule.getDefaultRangeConfig(agentHub, agentId, updateType)
TODO

getRangeConfigByMarket

RangeValidationModule.getRangeConfigByMarket(address,uint256,address,string) → RangeConfig0x8ab19807

Returns the market-specific movement range for an update type.

InputTypeDescription
agentHubaddressAgent hub contract.
agentIduint256Agent ID.
marketaddressMarket.
updateTypestringUpdate type.
Example
>>> RangeValidationModule.getRangeConfigByMarket(agentHub, agentId, market, updateType)
TODO

setDefaultRangeConfig

RangeValidationModule.setDefaultRangeConfig(address,uint256,string,(uint120,uint120,bool,bool)) → void0xb8a14d99

Sets default range config.

InputTypeDescription
agentHubaddressAgent hub contract.
agentIduint256Agent ID.
updateTypestringUpdate type.
rangeConfig(uint120,uint120,bool,bool)Range config.

Authorization: Hub owner or agent admin

Example
>>> RangeValidationModule.setDefaultRangeConfig(agentHub, agentId, updateType, rangeConfig)
TODO

setRangeConfigByMarket

RangeValidationModule.setRangeConfigByMarket(address,uint256,address,string,(uint120,uint120,bool,bool)) → void0x514c8ced

Sets range config by market.

InputTypeDescription
agentHubaddressAgent hub contract.
agentIduint256Agent ID.
marketaddressMarket.
updateTypestringUpdate type.
rangeConfig(uint120,uint120,bool,bool)Range config.

Authorization: Hub owner or agent admin

Example
>>> RangeValidationModule.setRangeConfigByMarket(agentHub, agentId, market, updateType, rangeConfig)
TODO

Validation

validate (single update)

RangeValidationModule.validate(address,uint256,address,(uint256,uint256,string)) → bool0xe5ba3a61

Returns whether the proposed update satisfies the agent constraints.

InputTypeDescription
agentHubaddressAgent hub contract.
agentIduint256Agent ID.
marketaddressMarket.
input(uint256,uint256,string)One movement.
Example
>>> RangeValidationModule.validate(agentHub, agentId, market, input)
TODO

validate (batch)

RangeValidationModule.validate(address,uint256,address,(uint256,uint256,string)[]) → bool0x4e2dccb2

Returns whether the proposed update satisfies the agent constraints.

InputTypeDescription
agentHubaddressAgent hub contract.
agentIduint256Agent ID.
marketaddressMarket.
input(uint256,uint256,string)[]Movement array.
Example
>>> RangeValidationModule.validate(agentHub, agentId, market, input)
TODO

The module does not publish or execute updates. It only answers whether a proposed movement is within the configuration identified by (agentHub, agentId, updateType, market).

On this page