LlamaRisk

RiskOracle

Function index15 functions

The RiskOracle stores discount-rate and eMode recommendations published by the router. The AgentHub reads the latest update for each registered agent and market, validates it, and passes eligible updates to the corresponding execution agent.

PropertyValue
Access modelOwner-managed authorized senders; the router is the operational publisher

Example outputs

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

RISK_ORACLE=<risk-oracle-address>
MARKET=<pt-market-address>
ROUTER=<router-address>

Update schema

Read functions return a RiskParameterUpdate tuple:

FieldTypeMeaning
timestampuint256Publication timestamp
newValuebytesABI-encoded recommendation
referenceIdstringOff-chain reference identifying the calculation
previousValuebytesPreviously published value for the same market and type
updateTypestringAgent-compatible update type
updateIduint256Monotonically increasing oracle update ID
marketaddressPT asset or address-encoded eMode category
additionalDatabytesTyped audit context supplied by the workflow

newValue must match the schema expected by its agent. A discount rate is encoded as one unsigned integer; an eMode update is encoded as (ltv, liquidationThreshold, liquidationBonus).

Metadata and update types

description

RiskOracle.description() → string0x7284e416

Returns the current description.

Example
>>> RiskOracle.description()
TODO

getAllUpdateTypes

RiskOracle.getAllUpdateTypes() → string[]0xc030ce7b

Returns every update type registered with the oracle.

Example
>>> RiskOracle.getAllUpdateTypes()
TODO

addUpdateType

RiskOracle.addUpdateType(string) → void0x77abc9bd

Adds update type.

InputTypeDescription
updateTypestringNew update type.

Authorization: Owner

Example
>>> RiskOracle.addUpdateType(updateType)
TODO

Update records

getLatestUpdateByParameterAndMarket

RiskOracle.getLatestUpdateByParameterAndMarket(string,address) → RiskParameterUpdate0x5decfee4

Returns the latest update for an update type and market.

InputTypeDescription
updateTypestringUpdate type.
marketaddressMarket.
Example
>>> RiskOracle.getLatestUpdateByParameterAndMarket(updateType, market)
TODO

getUpdateById

RiskOracle.getUpdateById(uint256) → RiskParameterUpdate0x37759b9a

Returns the update stored under an update ID.

InputTypeDescription
updateIduint256Update ID.
Example
>>> RiskOracle.getUpdateById(updateId)
TODO

latestUpdateIdByMarketAndType

RiskOracle.latestUpdateIdByMarketAndType(address,string) → uint2560x6a309fe9

Returns the current latest update id by market and type.

InputTypeDescription
marketaddressMarket.
updateTypestringUpdate type.
Example
>>> RiskOracle.latestUpdateIdByMarketAndType(market, updateType)
TODO

updateCounter

RiskOracle.updateCounter() → uint2560x1687fe8e

Returns the current update counter.

Example
>>> RiskOracle.updateCounter()
TODO

Publication

publishRiskParameterUpdate

RiskOracle.publishRiskParameterUpdate(string,bytes,string,address,bytes) → void0xb0be2505

Publishes one typed risk-parameter update.

InputTypeDescription
referenceIdstringReference ID.
newValuebytesNew value.
updateTypestringUpdate type.
marketaddressMarket.
additionalDatabytesAdditional data.

Authorization: Authorized sender

Example
>>> RiskOracle.publishRiskParameterUpdate(referenceId, newValue, updateType, market, additionalData)
TODO

publishBulkRiskParameterUpdates

RiskOracle.publishBulkRiskParameterUpdates(string[],bytes[],string[],address[],bytes[]) → void0x031ed79c

Publishes a batch of typed risk-parameter updates.

InputTypeDescription
referenceIdsstring[]Reference IDs.
newValuesbytes[]New values.
updateTypesstring[]Update types.
marketsaddress[]Markets.
additionalDatabytes[]Additional data.

Authorization: Authorized sender

Example
>>> RiskOracle.publishBulkRiskParameterUpdates(referenceIds, newValues, updateTypes, markets, additionalData)
TODO

The workflow does not call these publication functions directly. It submits a signed report to the Forwarder, and the router calls the selector configured for that workflow.

Authorized publishers

isAuthorized

RiskOracle.isAuthorized(address) → bool0xfe9fbb80

Returns whether a sender may publish updates.

InputTypeDescription
senderaddressSender address.
Example
>>> RiskOracle.isAuthorized(sender)
TODO

addAuthorizedSender

RiskOracle.addAuthorizedSender(address) → void0xfa7229ee

Adds authorized sender.

InputTypeDescription
senderaddressSender address.

Authorization: Owner

Example
>>> RiskOracle.addAuthorizedSender(sender)
TODO

removeAuthorizedSender

RiskOracle.removeAuthorizedSender(address) → void0xcbd57967

Removes authorized sender.

InputTypeDescription
senderaddressSender address.

Authorization: Owner

Example
>>> RiskOracle.removeAuthorizedSender(sender)
TODO

Ownership

owner

RiskOracle.owner() → address0x8da5cb5b

Returns the current owner.

Example
>>> RiskOracle.owner()
TODO

transferOwnership

RiskOracle.transferOwnership(address) → void0xf2fde38b

Transfers ownership.

InputTypeDescription
owneraddressNew owner.

Authorization: Owner

Example
>>> RiskOracle.transferOwnership(owner)
TODO

renounceOwnership

RiskOracle.renounceOwnership() → void0x715018a6

Renounces ownership.

Authorization: Owner

Example
>>> RiskOracle.renounceOwnership()
TODO

On this page