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.
| Property | Value |
|---|---|
| Access model | Owner-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:
| Field | Type | Meaning |
|---|---|---|
timestamp | uint256 | Publication timestamp |
newValue | bytes | ABI-encoded recommendation |
referenceId | string | Off-chain reference identifying the calculation |
previousValue | bytes | Previously published value for the same market and type |
updateType | string | Agent-compatible update type |
updateId | uint256 | Monotonically increasing oracle update ID |
market | address | PT asset or address-encoded eMode category |
additionalData | bytes | Typed 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() → string0x7284e416Returns the current description.
>>> RiskOracle.description()
TODOgetAllUpdateTypes
RiskOracle.getAllUpdateTypes() → string[]0xc030ce7bReturns every update type registered with the oracle.
>>> RiskOracle.getAllUpdateTypes()
TODOaddUpdateType
RiskOracle.addUpdateType(string) → void0x77abc9bdAdds update type.
| Input | Type | Description |
|---|---|---|
updateType | string | New update type. |
>>> RiskOracle.addUpdateType(updateType)
TODOUpdate records
getLatestUpdateByParameterAndMarket
RiskOracle.getLatestUpdateByParameterAndMarket(string,address) → RiskParameterUpdate0x5decfee4Returns the latest update for an update type and market.
| Input | Type | Description |
|---|---|---|
updateType | string | Update type. |
market | address | Market. |
>>> RiskOracle.getLatestUpdateByParameterAndMarket(updateType, market)
TODOgetUpdateById
RiskOracle.getUpdateById(uint256) → RiskParameterUpdate0x37759b9aReturns the update stored under an update ID.
| Input | Type | Description |
|---|---|---|
updateId | uint256 | Update ID. |
>>> RiskOracle.getUpdateById(updateId)
TODOlatestUpdateIdByMarketAndType
RiskOracle.latestUpdateIdByMarketAndType(address,string) → uint2560x6a309fe9Returns the current latest update id by market and type.
| Input | Type | Description |
|---|---|---|
market | address | Market. |
updateType | string | Update type. |
>>> RiskOracle.latestUpdateIdByMarketAndType(market, updateType)
TODOupdateCounter
RiskOracle.updateCounter() → uint2560x1687fe8eReturns the current update counter.
>>> RiskOracle.updateCounter()
TODOPublication
publishRiskParameterUpdate
RiskOracle.publishRiskParameterUpdate(string,bytes,string,address,bytes) → void0xb0be2505Publishes one typed risk-parameter update.
| Input | Type | Description |
|---|---|---|
referenceId | string | Reference ID. |
newValue | bytes | New value. |
updateType | string | Update type. |
market | address | Market. |
additionalData | bytes | Additional data. |
>>> RiskOracle.publishRiskParameterUpdate(referenceId, newValue, updateType, market, additionalData)
TODOpublishBulkRiskParameterUpdates
RiskOracle.publishBulkRiskParameterUpdates(string[],bytes[],string[],address[],bytes[]) → void0x031ed79cPublishes a batch of typed risk-parameter updates.
| Input | Type | Description |
|---|---|---|
referenceIds | string[] | Reference IDs. |
newValues | bytes[] | New values. |
updateTypes | string[] | Update types. |
markets | address[] | Markets. |
additionalData | bytes[] | Additional data. |
>>> RiskOracle.publishBulkRiskParameterUpdates(referenceIds, newValues, updateTypes, markets, additionalData)
TODOThe 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) → bool0xfe9fbb80Returns whether a sender may publish updates.
| Input | Type | Description |
|---|---|---|
sender | address | Sender address. |
>>> RiskOracle.isAuthorized(sender)
TODOaddAuthorizedSender
RiskOracle.addAuthorizedSender(address) → void0xfa7229eeAdds authorized sender.
| Input | Type | Description |
|---|---|---|
sender | address | Sender address. |
>>> RiskOracle.addAuthorizedSender(sender)
TODOremoveAuthorizedSender
RiskOracle.removeAuthorizedSender(address) → void0xcbd57967Removes authorized sender.
| Input | Type | Description |
|---|---|---|
sender | address | Sender address. |
>>> RiskOracle.removeAuthorizedSender(sender)
TODOOwnership
owner
RiskOracle.owner() → address0x8da5cb5bReturns the current owner.
>>> RiskOracle.owner()
TODOtransferOwnership
RiskOracle.transferOwnership(address) → void0xf2fde38bTransfers ownership.
| Input | Type | Description |
|---|---|---|
owner | address | New owner. |
>>> RiskOracle.transferOwnership(owner)
TODOrenounceOwnership
RiskOracle.renounceOwnership() → void0x715018a6Renounces ownership.
>>> RiskOracle.renounceOwnership()
TODO