Skip to main content
EquityOracleFactory deploys EquityOracle instances with CREATE2. The salt is the hash of the full config, so the same inputs always produce the same address, and a repeat call returns the existing oracle. It keeps a mapping from stock token to oracle and emits the complete config so indexers can reconstruct every parameter. EquityOracleFactory lets you:
  • Deploy an oracle for a stock token from a config struct
  • Predict the oracle address before deploying
  • Look up the oracle registered for a stock token
Addresses per network. Every address is also on Addresses. The source code is src/oracles/EquityOracleFactory.sol on GitHub. The ABI is /abis/EquityOracleFactory.json.

Write methods

create

Deploys an EquityOracle for cfg or returns the existing one at the predicted address. Permissionless. Reverts with AlreadyListed if the stock token already has an oracle at a different address (a different config). The constructor may also revert with EquityOracle’s config errors.
Anyone can deploy. The oracle only matters once governance points a book at it through RiskRegistry.
Input parameters Return values

Read methods

predict

Computes the CREATE2 address create would use for cfg without deploying. Input parameters Return values

Events

OracleCreated

Fires on every successful create, with the oracle, the stock token, and the full config.

Errors

AlreadyListed

The stock token already has an oracle deployed from a different config.