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.
| Property | Value |
|---|---|
| AgentHub ID | 1 |
| Execution access | inject 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=0x000000000000000000000000000000000000002fRisk update input
The RiskOracle tuple passed to validate and inject uses:
| Field | Type | eMode interpretation |
|---|---|---|
timestamp | uint256 | Publication time checked by AgentHub |
newValue | bytes | ABI-encoded (uint256 ltv, uint256 liquidationThreshold, uint256 liquidationBonus) |
referenceId | string | Calculation reference |
previousValue | bytes | Previous oracle value |
updateType | string | Must equal EModeCategoryUpdate |
updateId | uint256 | Replay-protected by AgentHub |
market | address | eMode category ID encoded into the low byte of an address |
additionalData | bytes | Audit 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() → address0x625cbff2Returns the current agent hub.
>>> AaveEModeAgent.AGENT_HUB()
TODOPOOL
AaveEModeAgent.POOL() → address0x7535d246Returns the current pool.
>>> AaveEModeAgent.POOL()
TODORANGE_VALIDATION_MODULE
AaveEModeAgent.RANGE_VALIDATION_MODULE() → address0xaea8e856Returns the current range validation module.
>>> AaveEModeAgent.RANGE_VALIDATION_MODULE()
TODOUPDATE_TYPE
AaveEModeAgent.UPDATE_TYPE() → bytes320x8111ad51Returns the current update type.
>>> AaveEModeAgent.UPDATE_TYPE()
TODOgetUpdateType
AaveEModeAgent.getUpdateType() → string0x2161bc0bReturns the update type handled by the agent.
>>> AaveEModeAgent.getUpdateType()
TODOgetMarkets
AaveEModeAgent.getMarkets(uint256) → address[]0x333c8403Returns the markets supplied by the agent.
| Input | Type | Description |
|---|---|---|
agentId | uint256 | Agent id. |
>>> AaveEModeAgent.getMarkets(agentId)
TODOValidation
validate
AaveEModeAgent.validate(uint256,bytes,(uint256,bytes,string,bytes,string,uint256,address,bytes)) → bool0x041b01b3Returns whether the proposed update satisfies the agent constraints.
| Input | Type | Description |
|---|---|---|
agentId | uint256 | Agent ID. |
context | bytes | Context. |
riskOracleUpdate | (uint256,bytes,string,bytes,string,uint256,address,bytes) | RiskOracle update. |
>>> AaveEModeAgent.validate(agentId, context, riskOracleUpdate)
TODOvalidate 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)) → void0x96e17302Applies an eligible risk update to the configured protocol target.
| Input | Type | Description |
|---|---|---|
agentId | uint256 | Agent ID. |
agentContext | bytes | Encoded configuration-engine context. |
riskParameterUpdate | (uint256,bytes,string,bytes,string,uint256,address,bytes) | And RiskParameterUpdate. |
>>> AaveEModeAgent.inject(agentId, agentContext, riskParameterUpdate)
TODOThe 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.