SIP-334: Add Optional Bytes Field for Oracle Manager Requests
Author | |
---|---|
Status | Implemented |
Type | Governance |
Network | Ethereum & Optimism |
Implementor | TBD |
Release | TBD |
Proposal | Loading status... |
Created | 2023-07-25 |
Abstract
This SIP proposes enhancing the Oracle Manager in the Synthetix protocol to support custom bytes data in requests, enabling Oracle Manager nodes to alter outcomes based on the provided information. This upgrade opens up new possibilities for use cases, such as sensitivity to order size when quoting prices.
Motivation
The current Oracle Manager in the Synthetix protocol does not allow the inclusion of custom bytes data in requests. This limitation restricts the flexibility of the system and prevents certain use cases that require additional information to be passed to nodes. For example, the V3 Perpetual Futures Market implementation accepts synthetic spot assets as collateral. To get an accurate quote of the value of these assets from the V3 Spot Market implementation, it should have the ability to specify the amount of the spot assets it is assessing the value of to get a more accurate price for each unit, if they were to be liquidated in a single transaction.
Specification
The proposed upgrade involves modifying the NodeModule
of the Oracle Manager system to add a new function. The new function signature will be as follows:
function processWithRuntime(
bytes32 nodeId,
bytes32[] memory runtimeKeys,
bytes32[] memory runtimeValues
) external view returns (NodeOutput.Data memory node);
Within the oracle-manager, This is a non-breaking change. The existing process
function will continue to operate as before for regular oracle price requests that do not have custom data.
For the initial implementation change, only the ExternalNode
will support receiving these parameters. Since we have no known implementations using the ExternalNode
, we are changing the implementation of the external node's process
function to take the additional parameters, as follows:
function process(
NodeOutput.Data[] memory parentNodeOutputs,
bytes memory parameters,
bytes32[] memory runtimeKeys,
bytes32[] memory runtimeValuess
) external view returns (NodeOutput.Data memory);
This replaces the existing process
function for the external node.
When a request is made with the new processWithRuntime
function which includes customData, the Oracle Manager will pass this data to the nodes along with the usual oracle price information. This enables the oracle manager nodes to utilize the custom data while executing the request and alter the outcome based on the provided information.
Configurable Values (Via SCCP)
N/A
Copyright
Copyright and related rights waived via CC0.