LlamaRisk

AaveEModeAgent

Function index8 functions

The AaveEModeAgent validates recommended LTV, liquidation-threshold, and liquidation-bonus values stored in RiskOracle. It checks all three movements through the RangeValidationModule and, when called by AgentHub, applies the approved category configuration through the Aave configuration engine encoded in the agent's hub context.

PropertyValue
AgentHub ID1
Execution accessinject can only be called by the immutable AgentHub

Example outputs

Example outputs remain TODO until a production deployment is published and can be queried.

EMODE_AGENT=<emode-agent-address>
AGENT_HUB=<agent-hub-address>
EMODE_47=0x000000000000000000000000000000000000002f

Risk update input

The RiskOracle tuple passed to validate and inject uses:

FieldTypeeMode interpretation
timestampuint256Publication time checked by AgentHub
newValuebytesABI-encoded (uint256 ltv, uint256 liquidationThreshold, uint256 liquidationBonus)
referenceIdstringCalculation reference
previousValuebytesPrevious oracle value
updateTypestringMust equal EModeCategoryUpdate
updateIduint256Replay-protected by AgentHub
marketaddresseMode category ID encoded into the low byte of an address
additionalDatabytesAudit context; not decoded by the agent

The agent compares the three values using range keys EModeLTV, EModeLiquidationThreshold, and EModeLiquidationBonus. Liquidation bonus is represented as the net bonus, excluding the protocol's 10_000 base.

Dependencies and identity

AGENT_HUB

AaveEModeAgent.AGENT_HUB() → address0x625cbff2

Returns the current agent hub.

Example
>>> AaveEModeAgent.AGENT_HUB()
TODO

POOL

AaveEModeAgent.POOL() → address0x7535d246

Returns the current pool.

Example
>>> AaveEModeAgent.POOL()
TODO

RANGE_VALIDATION_MODULE

AaveEModeAgent.RANGE_VALIDATION_MODULE() → address0xaea8e856

Returns the current range validation module.

Example
>>> AaveEModeAgent.RANGE_VALIDATION_MODULE()
TODO

UPDATE_TYPE

AaveEModeAgent.UPDATE_TYPE() → bytes320x8111ad51

Returns the current update type.

Example
>>> AaveEModeAgent.UPDATE_TYPE()
TODO

getUpdateType

AaveEModeAgent.getUpdateType() → string0x2161bc0b

Returns the update type handled by the agent.

Example
>>> AaveEModeAgent.getUpdateType()
TODO

getMarkets

AaveEModeAgent.getMarkets(uint256) → address[]0x333c8403

Returns the markets supplied by the agent.

InputTypeDescription
agentIduint256Agent id.
Example
>>> AaveEModeAgent.getMarkets(agentId)
TODO

Validation

validate

AaveEModeAgent.validate(uint256,bytes,(uint256,bytes,string,bytes,string,uint256,address,bytes)) → bool0x041b01b3

Returns whether the proposed update satisfies the agent constraints.

InputTypeDescription
agentIduint256Agent ID.
contextbytesContext.
riskOracleUpdate(uint256,bytes,string,bytes,string,uint256,address,bytes)RiskOracle update.
Example
>>> AaveEModeAgent.validate(agentId, context, riskOracleUpdate)
TODO

validate returns false when all three recommendations equal the current category configuration or when any configured movement range fails. It reverts if the update type does not match the agent.

Execution

inject

AaveEModeAgent.inject(uint256,bytes,(uint256,bytes,string,bytes,string,uint256,address,bytes)) → void0x96e17302

Applies an eligible risk update to the configured protocol target.

InputTypeDescription
agentIduint256Agent ID.
agentContextbytesEncoded configuration-engine context.
riskParameterUpdate(uint256,bytes,string,bytes,string,uint256,address,bytes)And RiskParameterUpdate.

Authorization: Immutable AGENT_HUB only

Example
>>> AaveEModeAgent.inject(agentId, agentContext, riskParameterUpdate)
TODO

The eMode category is decoded from update.market. agentContext must ABI-decode to the Aave configuration-engine address. The agent delegate-calls that engine with one updateEModeCategories entry, preserving the existing category label.

Only AGENT_HUB may call this function.

In normal operation, the hub supplies the stored agentContext and the latest RiskOracle update. Direct calls from the router, workflow, or an EOA revert.

On this page