IMarketViews
Overview
Section titled “Overview”Read-only view surface for a single market proxy.
IMarketViews
Section titled “IMarketViews”Implements ERC-165 so third parties can detect AVM markets.
Functions
Section titled “Functions”balances
Section titled “balances”function balances() returns (struct MarketBalances) viewReturns
directory
Section titled “directory”function directory() returns (address) viewReturns
address
engine
Section titled “engine”Current pricing engine resolved through the directory for marketKind().
function engine() returns (address) viewReturns
address
engineState
Section titled “engineState”Opaque, engine-defined state for the current engine().
The encoding is private to the engine. Bytes returned here MUST NOT be passed to a different engine route unless that engine explicitly supports the same encoding.
function engineState() returns (bytes) viewReturns
bytes
function flags() returns (struct MarketFlags) viewReturns
getPosition
Section titled “getPosition”function getPosition(address holder) returns (struct DataTypes.PersonalPosition) viewParameters
holder—address
Returns
position— DataTypes.PersonalPosition
groupId
Section titled “groupId”function groupId() returns (GroupId) viewReturns
marketId
Section titled “marketId”function marketId() returns (MarketId) viewReturns
marketKind
Section titled “marketKind”function marketKind() returns (MarketKind) viewReturns
netIssuedSupply
Section titled “netIssuedSupply”Net-issued supply: the portion of AVM supply issued along the trading curve, in raw token units.
Reverts with Errors.NegativeNetIssuedSupply if the offset exceeds total supply, which indicates corrupted accounting.
function netIssuedSupply() returns (RawTokenQuantity) viewReturns
snapshot
Section titled “snapshot”function snapshot() returns (struct DataTypes.MarketStateSnapshot) viewReturns
State of the market, with no derived values.
function state() returns (struct MarketState) viewReturns
supplyOffset
Section titled “supplyOffset”Signed count of AVM tokens (raw units) that exist off the trading curve: option exercises add to it, floor redemptions subtract.
Net-issued (curve) supply is totalSupply() - supplyOffset(); the market prices every trade at net-issued supply, never total supply.
function supplyOffset() returns (int256) viewReturns
int256
supportsInterface
Section titled “supportsInterface”Returns true if this contract implements the interface defined by interfaceId. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section] to learn more about how these ids are created. This function call must use less than 30 000 gas.
function supportsInterface(bytes4 interfaceId) returns (bool) viewParameters
interfaceId—bytes4
Returns
bool
tenantId
Section titled “tenantId”Tenant that owns this market’s group.
Resolved dynamically through IAvmDirectoryViews.getMarketGroup. A group’s tenant is fixed at group creation, so this value is stable for the market’s lifetime.
function tenantId() returns (TenantId) viewReturns
tokens
Section titled “tokens”function tokens() returns (struct TokenSet) viewReturns