markets.proto
path vega/markets.proto
package vega
Messages
AuctionDuration
Auction duration is used to configure 3 auction periods: 1. `duration > 0`, `volume == 0`: The auction will last for at least N seconds 2. `duration == 0`, `volume > 0`: The auction will end once the given volume will match at uncrossing 3. `duration > 0`, `volume > 0`: The auction will take at least N seconds, but can end sooner if the market can trade a certain volume
Name | Type | Description |
---|---|---|
duration | int64 | Duration of the auction in seconds. |
volume | uint64 | Target uncrossing trading volume. |
DataSourceSpecToFutureBinding
DataSourceSpecToFutureBinding describes which property of the data source data is to be used as settlement data and which to use as the trading terminated trigger
Name | Type | Description |
---|---|---|
settlement_data_property | string | Name of the property in the source data that should be used as settlement data. If it is set to "prices.BTC.value", then the Future will use the value of this property as settlement data. |
trading_termination_property | string | Name of the property in the data source data that signals termination of trading. |
FeeFactors
Fee factors definition
Name | Type | Description |
---|---|---|
maker_fee | string | Market maker fee charged network wide. |
infrastructure_fee | string | Infrastructure fee charged network wide for staking and governance. |
liquidity_fee | string | Liquidity fee applied per market for market making. |
Fees
Fees definition
Name | Type | Description |
---|---|---|
factors | FeeFactors | Fee factors. |
Future
Future product definition
Name | Type | Description |
---|---|---|
settlement_asset | string | Underlying asset for the future. |
quote_name | string | Quote name of the instrument. |
data_source_spec_for_settlement_data | DataSourceSpec | Data source specification that describes the settlement data source filter. |
data_source_spec_for_trading_termination | DataSourceSpec | Data source specification that describes the trading termination data source filter. |
data_source_spec_binding | DataSourceSpecToFutureBinding | Binding between the data spec and the data source. |
Instrument
Instrument definition
Name | Type | Description |
---|---|---|
id | string | Unique instrument ID. |
code | string | Code for the instrument. |
name | string | Name of the instrument. |
metadata | InstrumentMetadata | Collection of instrument meta-data. |
future | Future | Future. |
InstrumentMetadata
Instrument metadata definition
Name | Type | Description |
---|---|---|
tags | string | List of 0 or more tags. |
LiquidityMonitoringParameters
LiquidityMonitoringParameters contains settings used for liquidity monitoring
Name | Type | Description |
---|---|---|
target_stake_parameters | TargetStakeParameters | Specifies parameters related to target stake calculation. |
triggering_ratio | string | Specifies the triggering ratio for entering liquidity auction. |
auction_extension | int64 | Specifies by how many seconds an auction should be extended if leaving the auction were to trigger a liquidity auction. |
LogNormalModelParams
Risk model parameters for log normal
Name | Type | Description |
---|---|---|
mu | double | Mu parameter, annualised growth rate of the underlying asset. |
r | double | R parameter, annualised growth rate of the risk-free asset, used for discounting of future cash flows, can be any real number. |
sigma | double | Sigma parameter, annualised volatility of the underlying asset, must be a strictly non-negative real number. |
LogNormalRiskModel
Risk model for log normal
Name | Type | Description |
---|---|---|
risk_aversion_parameter | double | Risk Aversion Parameter. |
tau | double | Tau parameter of the risk model, projection horizon measured as a year fraction used in the expected shortfall calculation to obtain the maintenance margin, must be a strictly non-negative real number. |
params | LogNormalModelParams | Risk model parameters for log normal. |
MarginCalculator
Margin Calculator definition
Name | Type | Description |
---|---|---|
scaling_factors | ScalingFactors | Scaling factors for margin calculation. |
Market
Market definition
Name | Type | Description |
---|---|---|
id | string | Unique ID for the market. |
tradable_instrument | TradableInstrument | Tradable instrument configuration. |
decimal_places | uint64 | Number of decimal places that a price must be shifted by in order to get a correct price denominated in the currency of the market, for example: `realPrice = price / 10^decimalPlaces`. |
fees | Fees | Fees configuration that apply to the market. |
opening_auction | AuctionDuration | Auction duration specifies how long the opening auction will run (minimum duration and optionally a minimum traded volume). |
price_monitoring_settings | PriceMonitoringSettings | PriceMonitoringSettings for the market. |
liquidity_monitoring_parameters | LiquidityMonitoringParameters | LiquidityMonitoringParameters for the market. |
trading_mode | Market.TradingMode | Current mode of execution of the market. |
state | Market.State | Current state of the market. |
market_timestamps | MarketTimestamps | Timestamps for when the market state changes. |
position_decimal_places | int64 | The number of decimal places for a position. |
lp_price_range | string | Percentage move up and down from the mid price which specifies the range of price levels over which automated liquidity provision orders will be deployed. |
linear_slippage_factor | string | Linear slippage factor is used to cap the slippage component of maintenance margin - it is applied to the slippage volume. |
quadratic_slippage_factor | string | Quadratic slippage factor is used to cap the slippage component of maintenance margin - it is applied to the square of the slippage volume. |
MarketTimestamps
Time stamps for important times about creating, enacting etc the market
Name | Type | Description |
---|---|---|
proposed | int64 | Time when the market is first proposed. |
pending | int64 | Time when the market has been voted in and began its opening auction. |
open | int64 | Time when the market has left the opening auction and is ready to accept trades. |
close | int64 | Time when the market closed. |
PriceMonitoringParameters
PriceMonitoringParameters contains a collection of triggers to be used for a given market
Name | Type | Description |
---|---|---|
triggers | PriceMonitoringTrigger |
PriceMonitoringSettings
PriceMonitoringSettings contains the settings for price monitoring
Name | Type | Description |
---|---|---|
parameters | PriceMonitoringParameters | Specifies price monitoring parameters to be used for price monitoring purposes. |
PriceMonitoringTrigger
PriceMonitoringTrigger holds together price projection horizon τ, probability level p, and auction extension duration
Name | Type | Description |
---|---|---|
horizon | int64 | Price monitoring projection horizon τ in seconds. |
probability | string | Price monitoring probability level p. |
auction_extension | int64 | Price monitoring auction extension duration in seconds should the price breach its theoretical level over the specified horizon at the specified probability level. |
ScalingFactors
Scaling Factors (for use in margin calculation)
Name | Type | Description |
---|---|---|
search_level | double | Collateral search level. If collateral dips below this value, the system will search for collateral to release. |
initial_margin | double | Initial margin level. This is the minimum amount of collateral required to open a position in a market that requires margin. |
collateral_release | double | Collateral release level. If a trader has collateral above this level, the system will release collateral to a trader's general collateral account for the asset. |
SimpleModelParams
Risk model parameters for simple modelling
Name | Type | Description |
---|---|---|
factor_long | double | Pre-defined risk factor value for long. |
factor_short | double | Pre-defined risk factor value for short. |
max_move_up | double | Pre-defined maximum price move up that the model considers as valid. |
min_move_down | double | Pre-defined minimum price move down that the model considers as valid. |
probability_of_trading | double | Pre-defined constant probability of trading. |
SimpleRiskModel
Risk model for simple modelling
Name | Type | Description |
---|---|---|
params | SimpleModelParams | Risk model params for simple modelling. |
TargetStakeParameters
TargetStakeParameters contains parameters used in target stake calculation
Name | Type | Description |
---|---|---|
time_window | int64 | Specifies length of time window expressed in seconds for target stake calculation. |
scaling_factor | double | Specifies scaling factors used in target stake calculation. |
TradableInstrument
Tradable Instrument definition
Name | Type | Description |
---|---|---|
instrument | Instrument | Details for the underlying instrument. |
margin_calculator | MarginCalculator | Margin calculator for the instrument. |
log_normal_risk_model | LogNormalRiskModel | Log normal. |
simple_risk_model | SimpleRiskModel | Simple. |
Enums
Market.State
Current state of the market
Name | Number | Description |
---|---|---|
STATE_UNSPECIFIED | 0 | Default value, invalid |
STATE_PROPOSED | 1 | Governance proposal valid and accepted |
STATE_REJECTED | 2 | Outcome of governance votes is to reject the market |
STATE_PENDING | 3 | Governance vote passes/wins |
STATE_CANCELLED | 4 | Market triggers cancellation condition or governance votes to close before market becomes Active |
STATE_ACTIVE | 5 | Enactment date reached and usual auction exit checks pass |
STATE_SUSPENDED | 6 | Price monitoring or liquidity monitoring trigger |
STATE_CLOSED | 7 | Governance vote to close (Not currently implemented) |
STATE_TRADING_TERMINATED | 8 | Defined by the product (i.e. from a product parameter, specified in market definition, giving close date/time) |
STATE_SETTLED | 9 | Settlement triggered and completed as defined by product |
Market.TradingMode
Trading mode the market is currently running, also referred to as 'market state'
Name | Number | Description |
---|---|---|
TRADING_MODE_UNSPECIFIED | 0 | Default value, this is invalid |
TRADING_MODE_CONTINUOUS | 1 | Normal trading |
TRADING_MODE_BATCH_AUCTION | 2 | Auction trading (FBA) |
TRADING_MODE_OPENING_AUCTION | 3 | Opening auction |
TRADING_MODE_MONITORING_AUCTION | 4 | Auction triggered by monitoring |
TRADING_MODE_NO_TRADING | 5 | No trading is allowed |