ERC7412 has been used by Synthetix to allow users to push their own price updates to complete on-chain operations.
The protocol has been difficult to maintain as the number of markets have increased on the perps platform, and it is no longer possible/practical to apply price updates using the reccomended call pattern due to hundreds of necessary simulation calls,
To resolve this problem, ERC7412 errors will now be returned in large batches.
A summary of the interface changes to ERC7412 can be on the reference impl repo.
A new custom error, error Errors(bytes[])
has been created. This error has the capability to contain many encoded OracleDataRequired
custom errors,
as well as any other errors that may be encountered during the oracle resolution process. In some cases, there may even be Errors
nested,
necessitating the use of recursion to find all the errors.
Note that a mixture of many different types of oracleContract
s may be returned by the object. A compliant erc7412 implementation
should be able to batch these required oracle datas together into a single cohesive call for each necessary oracle provider.
However, For the time being, Synthetix is still only using the PYTH
oracle provider.
To prevent the additional call necessary to compute the required fee, the OracleDataRequired
error can now optionally include an additional fee parameter.
In total, the oracle data error definition now looks like this:
error OracleDataRequired(address oracleContract, bytes oracleQuery, uint256 feePool);
If no fee is supplied by OracleDataRequired
, then the defualt fee for the provider should be used instead.
The ERC7412 changes have been applied to the Python SDK of Synthetix. This can be used as a reference.