|Ethereum & Base
|Noisekit (@noisekit), Leonardo Massazza (@leomassazza)
In order to facilitate access to markets data for integrators and developers, this proposal targets to expose configurations and internal calculations as views in Spot Markets.
The primary motivation is to answer integrators and developers' needs for data access. The added views will simplify operations for integrators and developers by allowing them to access data directly from the contracts instead of having to query historical events or do manual calculations.
The new getter view functions proposed are:
getPriceData(marketId): that will return the configured price data for the market that was configured with
getWrapper(marketId): that will return the wrapper address and max wrappable amount for the market that was set with
getMarketSkew(marketId): that will return the current market skew for the market
getNominatedMarketOwner(synthMarketId): that will return the nominated owner for the market
Expose the following functions as views:
function getPriceData(uint128 marketId) external view returns (bytes32 buyFeedId, bytes32 sellFeedId, uint256 strictPriceStalenessTolerance);
function getWrapper(uint128 marketId) external view returns (address wrapCollateralType, uint256 maxWrappableAmount);
function getMarketSkew(uint128 marketId) external view returns (int256 marketSkew);
function getNominatedMarketOwner(uint128 synthMarketId) external view returns (address);
Add tests for all the new views.
Copyright and related rights waived via CC0.