SIP-322: Spot Market View Functions
|Network||Ethereum & Optimism|
|Implementor||Noah Litvin (@noahlitvin)|
This SIP proposes adding various view functions to the spot market implementation and a minor alteration to eventing functionality in the oracle manager.
To improve developer experience for integrating with the spot market, it would beneficial to allow smart contracts to return additional data from storage such that event indexing tools like subgraphs aren’t necessary. Also, the additional event in the oracle manager creates more idempotent behavior, such that developer tooling is able to more reliably retrieve the ID for a relevant node.
function getMarketFees(uint128 synthMarketId) external returns (uint256 atomicFixedFee, uint256 asyncFixedFee, int256 wrapFee, int256 unwrapFee)
function getMarketSkewScale(uint128 synthMarketId) external returns (uint256 skewScale);
function getMarketUtilizationFees(uint128 synthMarketId) external returns (uint256 utilizationFeeRate);
function getCollateralLeverage(uint128 synthMarketId) external returns (uint256 collateralLeverage);
function getCustomTransactorFees(uint128 synthMarketId, address transactor) external returns (uint256 fixedFeeAmount);
function getFeeCollector(uint128 synthMarketId) external returns (address feeCollector);
function getReferrerShare(uint128 marketId, address referrer) external returns (uint256 sharePercentage);
_registerNodefunction, even if the node has already been registered.
Relevant tests will be developed during implementation.
Configurable Values (Via SCCP)
Copyright and related rights waived via CC0.
Spot Market View Functions emit NodeRegistered even if node is already registered