Skip to main content
Version: testnet (v0.76)

vega.proto

path vega/vega.proto

package vega


Messages

Account

Represents an account for an asset on Vega for a particular owner or party

NameTypeDescription
idstringUnique account ID, used internally by Vega.
ownerstringParty that the account belongs to, special values include `network`, which represents the Vega network and is most commonly seen during liquidation of distressed trading positions.
balancestringBalance of the asset, the balance is an integer, for example `123456` is a correctly formatted price of `1.23456` assuming market configured to 5 decimal places and importantly balances cannot be negative.
assetstringAsset ID for the account.
market_idstringMarket ID for the account, if `AccountType.ACCOUNT_TYPE_GENERAL` this will be empty.
typeAccountTypeAccount type related to this account.

AccountDetails

NameTypeDescription
asset_idstringAsset ID of the asset for this account.
typeAccountTypeType of the account.
owneroptional stringNot specified if network account.
market_idoptional stringNot specified if account is not related to a market.

ActivityStreakBenefitTier

An activity streak benefit tier

NameTypeDescription
minimum_activity_streakuint64Number of epochs a party must be active to receive the multiplier.
reward_multiplierstringReward multiplier applicable to this tier.
vesting_multiplierstringVesting bonus applicable to this tier.

ActivityStreakBenefitTiers

A list of activity streak benefit tiers

NameTypeDescription
tiersrepeated ActivityStreakBenefitTierDefined benefit tiers ordered by increasing reward multipliers.

AuctionIndicativeState

AuctionIndicativeState is used to emit an event with the indicative price/volume per market during an auction

NameTypeDescription
market_idstringMarket ID for which this state relates to.
indicative_pricestringIndicative uncrossing price is the price at which all trades would occur if the auction uncrossed now.
indicative_volumeuint64Indicative uncrossing volume is the volume available at the indicative crossing price if the auction uncrossed now.
auction_startint64Timestamp at which the auction started.
auction_endint64Timestamp at which the auction is meant to stop.

BenefitTier

NameTypeDescription
minimum_running_notional_taker_volumestringRequired running notional taker volume in quantum units for parties to access this tier.
minimum_epochsstringRequired number of epochs a party must have been in a referral set to access this tier.
referral_reward_factorstringProportion of the referee's taker fees to be rewarded to the referrer.
referral_discount_factorstringProportion of the referee's taker fees to be discounted.

Candle

Represents the high, low, open, and closing prices for an interval of trading, referred to commonly as a candlestick or candle

NameTypeDescription
timestampint64Timestamp in Unix nanoseconds for the point in time when the candle was initially created/opened.
datetimestringISO-8601 datetime with nanosecond precision for when the candle was last updated.
highstringHighest price for trading during the candle interval. This field is an unsigned integer scaled to the market's decimal places.
lowstringLowest price for trading during the candle interval. This field is an unsigned integer scaled to the market's decimal places.
openstringOpen trade price. This field is an unsigned integer scaled to the market's decimal places.
closestringClosing trade price. This field is an unsigned integer scaled to the market's decimal places.
volumeuint64Total trading volume during the candle interval.
intervalIntervalTime interval for the candle.
notionaluint64Total notional value traded during the candle interval.

CompositePriceSource

NameTypeDescription
price_sourcestringSource of the price.
pricestringCurrent value of the composite source price.
last_updatedint64Timestamp in Unix nanoseconds when the price source was last updated.

CompositePriceState

Underlying state of the composite price..

NameTypeDescription
price_sourcesrepeated CompositePriceSource

Delegation

NameTypeDescription
partystringParty which is delegating.
node_idstringNode ID to delegate to.
amountstringAmount delegated. This field is an unsigned integer scaled to the asset's decimal places.
epoch_seqstringEpoch of delegation.

Deposit

Deposit on to the Vega network

NameTypeDescription
idstringUnique ID for the deposit.
statusDeposit.StatusStatus of the deposit.
party_idstringParty ID of the user initiating the deposit.
assetstringVega asset targeted by this deposit.
amountstringAmount to be deposited. This field is an unsigned integer scaled to the asset's decimal places.
tx_hashstringHash of the transaction from the foreign chain.
credited_timestampint64Timestamp for when the Vega account was updated with the deposit.
created_timestampint64Timestamp for when the deposit was created on the Vega network.

DispatchStrategy

NameTypeDescription
asset_for_metricstringAsset to use for metric.
metricDispatchMetricMetric to apply.
marketsrepeated stringOptional markets in scope.
entity_scopeEntityScopeMandatory enum that defines the entities within scope.
individual_scopeIndividualScopeOptional enum if the entity scope defined is for individuals, which determines the subset of individuals that are eligible to be rewarded.
team_scoperepeated stringOptional list applicable if the reward type has a scope of teams, which allows the funder to define a list of team IDs that are eligible to be rewarded from this transfer
n_top_performersstringThe proportion of the top performers in the team for a given metric to be averaged for the metric calculation if the scope is team
staking_requirementstringMinimum number of governance (e.g. VEGA) tokens staked for a party to be considered eligible. Defaults to 0
notional_time_weighted_average_position_requirementstringMinimum notional time-weighted averaged position required for a party to be considered eligible. Defaults to 0
window_lengthuint64Number of epochs to evaluate the metric on
lock_perioduint64Number of epochs after distribution to delay vesting of rewards by
distribution_strategyDistributionStrategyControls how the reward is distributed between qualifying parties
rank_tablerepeated RankOrdered list, using start rank, defining the rank bands and share ratio for each band. Mandatory for the rank distribution strategy.
cap_reward_fee_multipleoptional stringIf set, the actual amount of rewards transferred to each public key during distribution for this transfer will be `min(calculated_reward_in_quantum, cap_reward_fee_multiple × fees_paid_this_epoch_in_quantum).

EVMChainConfig

EVM Chain configuration details.

NameTypeDescription
network_idstringNetwork ID of this EVM compatible network.
chain_idstringChain ID of this EVM compatible network.
collateral_bridge_contractEthereumContractConfigContract configuration of the collateral bridge contract for this EVM compatible network.
confirmationsuint32Number of block confirmations to wait to consider an EVM compatible chain transaction trusted. An EVM compatible chain block is trusted when there are at least "n" blocks confirmed by the network, "n" being the number of `confirmations` required. If `confirmations` was set to `3`, and the current block to be forged (or mined) on the EVM compatible chain is block 14, block 10 would be considered as trusted, but not block 11.
multisig_control_contractEthereumContractConfigContract configuration of the multisig control contract for this EVM compatible network.

Epoch

NameTypeDescription
sequint64Sequence is used as epoch ID.
timestampsEpochTimestampsTimestamps for start/end etc.
validatorsrepeated NodeValidators that participated in this epoch.
delegationsrepeated DelegationList of all delegations in epoch.

EpochData

NameTypeDescription
totalint32Total number of epochs since node was created.
offlineint32Total number of offline epochs since node was created.
onlineint32Total number of online epochs since node was created.

EpochParticipation

NameTypeDescription
epochEpoch
offlineuint64
onlineuint64
total_rewardsdouble

EpochRewardSummary

Details for rewards for a combination of asset, market, and reward type in a given epoch

NameTypeDescription
epochuint64Epoch in which the reward is being paid.
asset_idstringAsset ID in which the reward is being paid.
market_idstringMarket ID in which the reward is being paid.
reward_typestringType of reward being paid.
amountstringAmount distributed. This field is an unsigned integer scaled to the asset's decimal places.

EpochTimestamps

Describes in both human readable and block time when an epoch spans

NameTypeDescription
start_timeint64Timestamp in Unix nanoseconds for when epoch started.
expiry_timeint64Timestamp in Unix nanoseconds for the epoch's expiry.
end_timeint64Timestamp in Unix nanoseconds for when the epoch ended, empty if not ended.
first_blockuint64Height of first block in the epoch.
last_blockuint64Height of last block in the epoch, empty if not ended.

Erc20WithdrawExt

Extension of data required for the withdraw submissions

NameTypeDescription
receiver_addressstringAddress into which the bridge will release the funds.

ErrorDetail

Represents Vega domain specific error information over gRPC/Protobuf

NameTypeDescription
codeint32Vega API domain specific unique error code, useful for client side mappings, e.g. 10004.
messagestringMessage that describes the error in more detail, should describe the problem encountered.
innerstringAny inner error information that could add more context, or be helpful for error reporting.

EthereumConfig

Ethereum configuration details.

NameTypeDescription
network_idstringNetwork ID of this Ethereum network.
chain_idstringChain ID of this Ethereum network.
collateral_bridge_contractEthereumContractConfigContract configuration of the collateral bridge contract for this Ethereum network.
confirmationsuint32Number of block confirmations to wait to consider an Ethereum transaction trusted. An Ethereum block is trusted when there are at least "n" blocks confirmed by the network, "n" being the number of `confirmations` required. If `confirmations` was set to `3`, and the current block to be forged (or mined) on Ethereum is block 14, block 10 would be considered as trusted, but not block 11.
staking_bridge_contractEthereumContractConfigContract configuration of the stacking bridge contract for this Ethereum network.
token_vesting_contractEthereumContractConfigContract configuration of the token vesting contract for this Ethereum network.
multisig_control_contractEthereumContractConfigContract configuration of the multisig control contract for this Ethereum network.

EthereumContractConfig

NameTypeDescription
addressstringAddress of the contract for this EVM compatible network. The address should start with "0x".
deployment_block_heightuint64Block height at which the stacking contract has been deployed for this Ethereum network.

EthereumL2Config

NameTypeDescription
network_idstringNetwork ID of this Ethereum layer 2 network.
chain_idstringChain ID of this Ethereum layer 2 network.
confirmationsuint32Number of block confirmations to wait to consider an Ethereum transaction trusted. An Ethereum block is trusted when there are at least "n" blocks confirmed by the network, "n" being the number of `confirmations` required. If `confirmations` was set to `3`, and the current block to be forged, or mined, on the L2 is block 14, block 10 would be considered as trusted, but not block 11.
namestringDisplay name of this network
block_intervaluint64Polling interval for the internal engine, needs to be adapted to the source chain depending on its block production rate.

EthereumL2Configs

NameTypeDescription
configsrepeated EthereumL2Config

Fee

Represents any fees paid by a party, resulting from a trade

NameTypeDescription
maker_feestringFee amount paid to the non-aggressive party of the trade. This field is an unsigned integer scaled to the asset's decimal places.
infrastructure_feestringFee amount paid for maintaining the Vega infrastructure. This field is an unsigned integer scaled using the asset's decimal places.
liquidity_feestringFee amount paid to market makers. This field is an unsigned integer scaled to the asset's decimal places.
maker_fee_volume_discountstringVolume discounts. Discount on maker fee based on the taker volume.
infrastructure_fee_volume_discountstringDiscount on infrastructure fee based on the taker volume.
liquidity_fee_volume_discountstringDiscount on liquidity fee basedo on taker volume.
maker_fee_referrer_discountstringReferrer discounts. Discount on maker fee for eligible referrer.
infrastructure_fee_referrer_discountstringDiscount on infrastructure fee for eligible referrer.
liquidity_fee_referrer_discountstringDiscount on liquidity fee for eligible referrer.

FinancialAmount

Asset value information used within a transfer

NameTypeDescription
amountstringUnsigned integer amount of asset scaled to the asset's decimal places.
assetstringAsset ID the amount applies to.

IcebergOrder

Details of an iceberg order

NameTypeDescription
peak_sizeuint64Size of the order that will be made visible if the iceberg order is replenished after trading.
minimum_visible_sizeuint64If the visible size of the order falls below this value, it will be replenished back to the peak size using the reserved amount.
reserved_remaininguint64Size of the order that is reserved and used to restore the iceberg's peak when it is refreshed.

KeyValueBundle

NameTypeDescription
keystring
tolerancestring
valueStateVarValue

LedgerEntry

Represents a ledger entry on Vega

NameTypeDescription
from_accountAccountDetailsOne or more accounts to transfer from.
to_accountAccountDetailsOne or more accounts to transfer to.
amountstringAmount to transfer. This field is an unsigned integer scaled to the asset's decimal places.
typeTransferTypeTransfer type for this entry.
timestampint64Timestamp in nanoseconds of when the ledger entry was created.
from_account_balancestringSender account balance after the transfer. This field is an unsigned integer scaled to the asset's decimal places.
to_account_balancestringReceiver account balance after the transfer. This field is an unsigned integer scaled to the asset's decimal places.
transfer_idoptional stringTransfer ID the ledger entry relates to.

LedgerMovement

NameTypeDescription
entriesrepeated LedgerEntryAll the entries for these ledger movements.
balancesrepeated PostTransferBalanceResulting balances once the ledger movement are applied.

LiquidityOrder

Represents a liquidity order

NameTypeDescription
referencePeggedReferencePegged reference point for the order.
proportionuint32Relative proportion of the commitment to be allocated at a price level.
offsetstringOffset/amount of units away for the order. This field is an unsigned integer scaled using the market's decimal places.

LiquidityOrderReference

Pair of a liquidity order and the ID of the generated order

NameTypeDescription
order_idstringUnique ID of the pegged order generated to fulfil this liquidity order.
liquidity_orderLiquidityOrderLiquidity order from the original submission.

LiquidityProviderFeeShare

Equity-like share of liquidity fee for each liquidity provider

NameTypeDescription
partystringLiquidity provider party ID.
equity_like_sharestringShare own by this liquidity provider.
average_entry_valuationstringAverage entry valuation of the liquidity provider for the market.
average_scorestringAverage liquidity score.
virtual_stakestringThe virtual stake of this liquidity provider.

LiquidityProviderSLA

SLA performance for each liquidity provider

NameTypeDescription
partystringLiquidity provider party ID.
current_epoch_fraction_of_time_on_bookstringIndicates how often LP meets the commitment during the current epoch.
last_epoch_fraction_of_time_on_bookstringIndicates how often LP met the commitment in the previous epoch.
last_epoch_fee_penaltystringIndicates the fee penalty amount applied in the previous epoch.
last_epoch_bond_penaltystringShows the bond penalties from past epochs.
hysteresis_period_fee_penaltiesrepeated stringDetermines how the fee penalties from past epochs affect future fee revenue.
required_liquiditystringRepresents the total amount of funds LP must supply. The amount to be supplied is in the market’s settlement currency, spread on both buy and sell sides of the order book within a defined range.
notional_volume_buysstringNotional volume of orders within the range provided on the buy side of the book.
notional_volume_sellsstringNotional volume of orders within the range provided on the sell side of the book.

LiquidityProvision

Liquidity provider commitment

NameTypeDescription
idstringUnique ID for the liquidity provision.
party_idstringUnique party ID for the creator of the provision.
created_atint64Timestamp in Unix nanoseconds for when the liquidity provision was created.
updated_atint64Timestamp in Unix nanoseconds for when the liquidity provision was updated.
market_idstringMarket ID for the liquidity provision.
commitment_amountstringSpecified as a unitless number that represents the amount of settlement asset of the market. This field is an unsigned integer scaled to the asset's decimal places.
feestringNominated liquidity fee factor, which is an input to the calculation of taker fees on the market, as per setting fees and rewarding liquidity providers.
sellsrepeated LiquidityOrderReferenceSet of liquidity sell orders to meet the liquidity provision obligation.
buysrepeated LiquidityOrderReferenceSet of liquidity buy orders to meet the liquidity provision obligation.
versionuint64Version of this liquidity provision.
statusLiquidityProvision.StatusStatus of this liquidity provision.
referencestringReference shared between this liquidity provision and all its orders.

MarginLevels

Represents the margin levels for a party on a market at a given time

NameTypeDescription
maintenance_marginstringMaintenance margin value. This field is an unsigned integer scaled to the asset's decimal places.
search_levelstringMargin search level value. This field is an unsigned integer scaled to the asset's decimal places.
initial_marginstringInitial margin value. This field is an unsigned integer scaled to the asset's decimal places.
collateral_release_levelstringCollateral release level value. This field is an unsigned integer scaled to the asset's decimal places.
party_idstringParty ID for whom the margin levels apply.
market_idstringMarket ID for which the margin levels apply.
assetstringAsset ID for which the margin levels apply.
timestampint64Timestamp in Unix nanoseconds for when the ledger entry was created.
order_marginstringMargin required to cover orders in isolated margin mode.
margin_modeMarginModeMargin mode for the party, cross margin or isolated margin.
margin_factorstringMargin factor, relevant only for isolated margin, 0 otherwise.

MarketData

Represents data generated by a market when open

NameTypeDescription
mark_pricestringMark price, as an unsigned integer, for example `123456` is a correctly formatted price of `1.23456` assuming market configured to 5 decimal places.
best_bid_pricestringHighest price level on an order book for buy orders, as an unsigned integer, for example `123456` is a correctly formatted price of `1.23456` assuming market configured to 5 decimal places.
best_bid_volumeuint64Aggregated volume being bid at the best bid price, as an integer, for example `123456` is a correctly formatted price of `1.23456` assuming market is configured to 5 decimal places.
best_offer_pricestringLowest price level on an order book for offer orders. This field is an unsigned integer scaled to the market's decimal places.
best_offer_volumeuint64Aggregated volume being offered at the best offer price, as an integer, for example `123456` is a correctly formatted price of `1.23456` assuming market is configured to 5 decimal places.
best_static_bid_pricestringHighest price on the order book for buy orders not including pegged orders. This field is an unsigned integer scaled to the market's decimal places.
best_static_bid_volumeuint64Total volume at the best static bid price excluding pegged orders.
best_static_offer_pricestringLowest price on the order book for sell orders not including pegged orders. This field is an unsigned integer scaled to the market's decimal places.
best_static_offer_volumeuint64Total volume at the best static offer price, excluding pegged orders.
mid_pricestringArithmetic average of the best bid price and best offer price, as an integer, for example `123456` is a correctly formatted price of `1.23456` assuming market configured to 5 decimal places.
static_mid_pricestringArithmetic average of the best static bid price and best static offer price. This field is an unsigned integer scaled to the market's decimal places.
marketstringMarket ID for the data
timestampint64Timestamp in Unix nanoseconds at which this mark price was relevant.
open_interestuint64Sum of the size of all positions greater than zero on the market.
auction_endint64Time in seconds until the end of the auction (zero if currently not in auction period).
auction_startint64Time until next auction, or start time of the current auction if market is in auction period.
indicative_pricestringIndicative price (zero if not in auction). This field is an unsigned scaled to the market's decimal places.
indicative_volumeuint64Indicative volume (zero if not in auction).
market_trading_modeMarket.TradingModeCurrent trading mode for the market.
triggerAuctionTriggerWhen a market is in an auction trading mode, this field indicates what triggered the auction.
extension_triggerAuctionTriggerWhen a market auction is extended, this field indicates what caused the extension.
target_stakestringTargeted stake for the given market. This field is an unsigned integer scaled to the settlement asset's decimal places.
supplied_stakestringAvailable stake for the given market. This field is an unsigned integer scaled to the settlement asset's decimal places.
price_monitoring_boundsrepeated PriceMonitoringBoundsOne or more price monitoring bounds for the current timestamp.
market_value_proxystringMarket value proxy.
liquidity_provider_fee_sharerepeated LiquidityProviderFeeShareEquity-like share of liquidity fee for each liquidity provider.
market_stateMarket.StateCurrent state of the market.
next_mark_to_marketint64Time in Unix nanoseconds when the next mark-to-market calculation will occur.
last_traded_pricestringLast traded price of the market. This field is an unsigned integer scaled to the market's decimal places.
market_growthstringMarket growth at the last market time window.
product_dataoptional ProductDataData related to the particular product type of the market.
liquidity_provider_slarepeated LiquidityProviderSLASLA performance for each liquidity provider.
next_network_closeoutint64Time in Unix nanoseconds when the market will next submit a trade to reduce its position.
mark_price_typeCompositePriceTypeThe method used for calculating the mark price.
mark_price_stateCompositePriceStateState of the internal composite price.

MarketDepth

Represents market depth or order book data for the specified market on Vega

NameTypeDescription
market_idstringMarket ID for which the depth levels apply.
buyrepeated PriceLevelCollection of price levels for the buy side of the book.
sellrepeated PriceLevelCollection of price levels for the sell side of the book.
sequence_numberuint64Sequence number for the market depth data returned.

MarketDepthUpdate

Represents the changed market depth since the last update

NameTypeDescription
market_idstringMarket ID for which the market depth updates are for.
buyrepeated PriceLevelCollection of updated price levels for the buy side of the book.
sellrepeated PriceLevelCollection of updated price levels for the sell side of the book.
sequence_numberuint64Sequence number for the market depth update data returned. It is increasing but not monotonic.
previous_sequence_numberuint64Sequence number of the previous market depth update, for checking there are no gaps.

MatrixValue

NameTypeDescription
valuerepeated VectorValue

Metadata

Generic structure holding a key/value pair.

NameTypeDescription
keystringKey of the metadata.
valuestringValue of the metadata.

NetworkLimits

Network limits, defined in the genesis file

NameTypeDescription
can_propose_marketboolAre market proposals allowed at this point in time.
can_propose_assetboolAre asset proposals allowed at this point in time.
propose_market_enabledboolAre market proposals enabled on this chain.
propose_asset_enabledboolAre asset proposals enabled on this chain.
genesis_loadedboolTrue once the genesis file is loaded.
propose_market_enabled_fromint64Timestamp in Unix nanoseconds at which market proposals will be enabled (0 indicates not set).
propose_asset_enabled_fromint64Timestamp in Unix nanoseconds at which asset proposals will be enabled (0 indicates not set).
can_propose_spot_marketboolAre spot market proposals allowed at this point in time.
can_propose_perpetual_marketboolAre perpetual market proposals allowed at this point in time.

NetworkParameter

Represents a network parameter on Vega

NameTypeDescription
keystringUnique key of the network parameter.
valuestringValue for the network parameter.

Node

NameTypeDescription
idstringNode ID i.e. the node's wallet ID.
pub_keystringPublic key of the node operator.
tm_pub_keystringPublic key of Tendermint.
ethereum_addressstringEthereum public key of the node.
info_urlstringURL where users can find out more information on the node.
locationstringCountry code for the location of the node.
staked_by_operatorstringAmount the node operator has put up themselves. This field is an unsigned integer scaled to the asset's decimal places.
staked_by_delegatesstringAmount of stake that has been delegated by token holders. This field is an unsigned integer scaled to the asset's decimal places.
staked_totalstringTotal amount staked on node. This field is an unsigned integer scaled to the asset's decimal places.
max_intended_stakestringMax amount of (wanted) stake. This field is an unsigned integer scaled to the asset's decimal places.
pending_stakestringAmount of stake on the next epoch. This field is an unsigned integer scaled to the asset's decimal places.
epoch_dataEpochDataInformation about epoch.
statusNodeStatusNode status.
delegationsrepeated DelegationNode's delegations.
reward_scoreRewardScoreNode reward score.
ranking_scoreRankingScoreNode ranking information.
namestringNode name.
avatar_urlstringAvatar url.

NodeData

NameTypeDescription
staked_totalstringTotal staked amount across all nodes. This field is an unsigned integer scaled to the asset's decimal places.
total_nodesuint32Total number of nodes across all node sets.
inactive_nodesuint32Total number of nodes that had a performance score of 0 at the end of the last epoch.
tendermint_nodesNodeSetDetails on the set of consensus nodes in the network.
ersatz_nodesNodeSetDetails on the set of ersatz (standby) nodes in the network.
pending_nodesNodeSetDetails on the set of pending nodes in the network.
uptimefloatTotal uptime for all epochs across all nodes.

NodeSet

Details on the collection of nodes for a particular validator status

NameTypeDescription
totaluint32Total number of nodes in the node set.
inactiveuint32Number of nodes in the node set that had a performance score of 0 at the end of the last epoch.
promotedrepeated stringIDs of nodes that were promoted into this node set at the start of the epoch.
demotedrepeated stringIDs of nodes that were demoted into this node set at the start of the epoch.
maximumoptional uint32Total number of nodes allowed in the node set.

Order

Orders can be submitted, amended and cancelled on Vega in an attempt to make trades with other parties

NameTypeDescription
idstringUnique ID generated for the order.
market_idstringMarket ID for the order.
party_idstringParty ID for the order.
sideSideSide for the order, e.g. SIDE_BUY or SIDE_SELL.
pricestringPrice for the order, the price is an integer, for example `123456` is a correctly formatted price of `1.23456` assuming market configured to 5 decimal places.
sizeuint64Size for the order, for example, in a futures market the size equals the number of contracts.
remaininguint64Size remaining, when this reaches 0 then the order is fully filled and status becomes STATUS_FILLED.
time_in_forceOrder.TimeInForceTime in force indicates how long an order will remain active before it is executed or expires. - See OrderTimeInForce
typeOrder.TypeType for the order.
created_atint64Timestamp for when the order was created at, in nanoseconds.
statusOrder.StatusCurrent status of the order.
expires_atint64Timestamp in Unix nanoseconds for when the order will expire.
referencestringReference given for the order.
reasonoptional OrderErrorFuther details for why an order with status `STATUS_REJECTED` was rejected.
updated_atint64Timestamp in Unix nanoseconds for when the order was last updated.
versionuint64Version for the order, initial value is version 1 and is incremented after each successful amend.
batch_iduint64Batch ID for the order, used internally for orders submitted during auctions to keep track of the auction batch this order falls under. Required for fees calculation.
pegged_orderPeggedOrderPegged order details, used only if the order represents a pegged order.
liquidity_provision_idstringSet if the order was created as part of a liquidity provision, will be empty if not.
post_onlyboolOnly valid for Limit orders. Cannot be True at the same time as Reduce-Only.
reduce_onlyboolOnly valid for Non-Persistent orders. Cannot be True at the same time as Post-Only. If set, order will only be executed if the outcome of the trade moves the trader's position closer to 0.
iceberg_orderoptional IcebergOrderDetails of an iceberg order

OrderCancellationConfirmation

Used when cancelling an order

NameTypeDescription
orderOrderOrder that was cancelled.

OrderConfirmation

Used when confirming an order

NameTypeDescription
orderOrderOrder that was confirmed.
tradesrepeated Trade0 or more trades that were emitted.
passive_orders_affectedrepeated Order0 or more passive orders that were affected.

Party

Party represents an entity who wishes to trade on or query a Vega network

NameTypeDescription
idstringUnique ID for the party, typically represented by a public key.
aliasstringAlias given to the party.
metadatarepeated MetadataMetadata to associate to a party, in a key/value format where the key describes the type of metadata in the value field.

PartyProfile

Holds metadata associated to a party.

NameTypeDescription
party_idstringParty ID associated to the profile.
aliasstringAlias given to the party.
metadatarepeated MetadataMetadata to associate to a party, in a key/value format where the key describes the type of metadata in the value field.

PeggedOrder

Pegged orders are limit orders where the price is specified in the form REFERENCE +/- OFFSET They can be used for any limit order that is valid during continuous trading

NameTypeDescription
referencePeggedReferencePrice point the order is linked to.
offsetstringOffset from the price reference.

PerpetualData

Represents market data specific to a perpetual market.

NameTypeDescription
funding_paymentstringCurrent funding payment for the in-progress funding period.
funding_ratestringCurrent funding rate for the in-progress funding period.
internal_twapstringTime-weighted-average the internal data-points for the in-progress funding period.
external_twapstringTime-weighted-average the external data points for the in-progress funding period.
seq_numuint64Funding period sequence number
start_timeint64Funding period start time
internal_composite_pricestringThe internal composite price used for perpetual markets.
next_internal_composite_price_calcint64The next time the internal composite price is calculated for the perpetual market, in Unix nanoseconds.
internal_composite_price_typeCompositePriceTypeThe method used for calculating the internal composite price, for perpetual markets only.
underlying_index_pricestringLast seen value of the settlement oracle.
internal_composite_price_stateCompositePriceStateState of the internal composite price.

Position

Represents position data for a party on the specified market on Vega

NameTypeDescription
market_idstringMarket ID in which the position is held.
party_idstringParty ID holding the position.
open_volumeint64Open volume for the position, value is signed +ve for long and -ve for short.
realised_pnlstringRealised profit and loss for the position, value is signed +ve for long and -ve for short. This field is a signed integer scaled to the market's decimal places.
unrealised_pnlstringUnrealised profit and loss for the position, value is signed +ve for long and -ve for short. This field is a signed integer scaled to the market's decimal places.
average_entry_pricestringAverage entry price for the position, the price is an integer, for example `123456` is a correctly formatted price of `1.23456` assuming market configured to 5 decimal places.
updated_atint64Timestamp for the latest time the position was updated.
loss_socialisation_amountstringSum of profit that could not be paid due to loss socialisation.
position_statusPositionStatusPosition status, indicating whether the party was distressed and had orders cancelled or was closed out.

PositionTrade

NameTypeDescription
volumeint64Volume for the position trade, value is signed +ve for long and -ve for short.
pricestringPrice for the position trade, the price is an integer, for example `123456` is a correctly formatted price of `1.23456` assuming market configured to 5 decimal places.

PostTransferBalance

Represents the balance for an account during a transfer

NameTypeDescription
accountAccountDetailsAccount relating to the transfer.
balancestringBalance relating to the transfer. This field is an unsigned integer scaled to the asset's decimal places.

PriceLevel

Represents a price level from market depth or order book data

NameTypeDescription
pricestringPrice for the price level, the price is an integer, for example `123456` is a correctly formatted price of `1.23456` assuming market configured to 5 decimal places. This field is an unsigned integer passed as a string and needs to be scaled using the market's decimal places.
number_of_ordersuint64Number of orders at the price level.
volumeuint64Volume at the price level.

PriceMonitoringBounds

Represents a list of valid (at the current timestamp) price ranges per associated trigger

NameTypeDescription
min_valid_pricestringMinimum price that isn't currently breaching the specified price monitoring trigger. This field is an unsigned integer scaled to the market's decimal places.
max_valid_pricestringMaximum price that isn't currently breaching the specified price monitoring trigger. This field is an unsigned integer scaled to the market's decimal places.
triggerPriceMonitoringTriggerPrice monitoring trigger associated with the bounds.
reference_pricestringReference price used to calculate the valid price range. This field is an unsigned integer scaled to the market's decimal places.

ProductData

Represents market data specific to a particular product type.

NameTypeDescription
perpetual_dataPerpetualData

Rank

NameTypeDescription
start_rankuint32
share_ratiouint32

RankingScore

NameTypeDescription
stake_scorestringStake based score - no anti-whaling.
performance_scorestringPerformance based score.
previous_statusValidatorNodeStatusStatus of the validator in the previous epoch.
statusValidatorNodeStatusStatus of the validator in the current epoch.
voting_poweruint32Tendermint voting power of the validator.
ranking_scorestringFinal score.

ReferralProgram

NameTypeDescription
versionuint64Incremental version of the program. It is incremented after each program update.
idstringUnique ID generated from the proposal that created this program.
benefit_tiersrepeated BenefitTierDefined benefit tiers ordered by increasing discounts.
end_of_program_timestampint64Timestamp in Unix nanoseconds, after which when the current epoch ends, the program will end and benefits will be disabled.
window_lengthuint64Number of epochs over which the referral set's running volume is evaluated.
staking_tiersrepeated StakingTierDefined benefit tiers ordered by increasing reward multiplier. Determines the level of benefit a party can expect based on their staking.

Reward

Details for a single reward payment

NameTypeDescription
asset_idstringAsset ID in which the reward is being paid.
party_idstringParty ID to whom the reward is being paid.
epochuint64Epoch in which the reward is being paid.
amountstringAmount paid as a reward. This field is an unsigned integer scaled to the asset's decimal places.
percentage_of_totalstringPercentage of total rewards paid in the epoch.
received_atint64Timestamp at which the reward was paid as Unix nano time.
market_idstringMarket ID in which the reward is being paid.
reward_typestringType of reward being paid.
locked_until_epochuint64The epoch when the reward is being released.
quantum_amountstringAmount paid as a reward, expressed in asset's quantum unit.
game_idoptional stringID of the game the reward payment was made for if the payment was made for participation in a game.
team_idoptional stringID of the team the party is a member of, if the party is a member of a participating team, and the reward payment was made for participation in a game. This field is currently only populated by the rewards API.

RewardScore

NameTypeDescription
raw_validator_scorestringStake based score - with anti-whaling.
performance_scorestringPerformance based score.
multisig_scorestringMultisig score.
validator_scorestringUn-normalised score.
normalised_scorestringNormalised validator score for rewards.
validator_statusValidatorNodeStatusStatus of the validator for reward.

RewardSummary

Details for rewards for a single asset

NameTypeDescription
asset_idstringAsset ID in which the reward is being paid.
party_idstringParty ID to whom the reward is being paid.
amountstringTotal amount of rewards paid in the asset. This field is an unsigned integer scaled to the asset's decimal places.

RiskFactor

Risk factors are used to calculate the current risk associated with orders trading on a given market

NameTypeDescription
marketstringMarket ID that relates to this risk factor.
shortstringShort Risk factor value.
longstringLong Risk factor value.

ScalarValue

NameTypeDescription
valuestring

StakingTier

NameTypeDescription
minimum_staked_tokensstringRequired number of governance tokens ($VEGA) a referrer must have staked to receive the multiplier.
referral_reward_multiplierstringMultiplier applied to the referral reward factor when calculating referral rewards due to the referrer.

StateValueProposal

NameTypeDescription
state_var_idstringState variable ID.
event_idstringEvent ID.
kvbrepeated KeyValueBundleKey value tolerance triplets.

StateVarValue

NameTypeDescription
scalar_valScalarValue
vector_valVectorValue
matrix_valMatrixValue

StopOrder

NameTypeDescription
idstringID of this stop order also the ID of the associated order if it is ever triggered
oco_link_idoptional stringThe ID of the 'other' part of the OCO if 2 stop orders were submitted at once
expires_atoptional int64Optional expiry timestamp.
expiry_strategyoptional StopOrder.ExpiryStrategyStrategy to adopt if the expiry time is reached.
trigger_directionStopOrder.TriggerDirectionTrigger direction for this stop order.
statusStopOrder.StatusStatus of the stop order.
created_atint64Creation time of the stop order.
updated_atoptional int64Last update of this stop order.
order_idstringID of the order created once the trigger is hit.
party_idstringID of the party that submitted this stop order.
market_idstringID of the market the stop order is submitted to.
rejection_reasonoptional StopOrder.RejectionReasonAn optional reason for why a stop order was rejected
size_override_settingStopOrder.SizeOverrideSettingSize override setting
size_override_valueoptional StopOrder.SizeOverrideValueSize override value
pricestringFixed price at which the order will be submitted.
trailing_percent_offsetstringTrailing percentage at which the order will be submitted. This should be expressed as a decimal value between 0 and 1, e.g. 0.01 for 1%

StopOrder.SizeOverrideValue

NameTypeDescription
percentagestringScaling percentage of the current position’s size

Trade

A trade occurs when an aggressive order crosses one or more passive orders on the order book for a market on Vega

NameTypeDescription
idstringUnique ID for the trade.
market_idstringMarket ID on which the trade occurred.
pricestringPrice for the trade, the price is an integer, for example `123456` is a correctly formatted price of `1.23456` assuming market configured to 5 decimal places.
sizeuint64Size filled for the trade.
buyerstringUnique party ID for the buyer.
sellerstringUnique party ID for the seller.
aggressorSideDirection of the aggressive party e.g. SIDE_BUY or SIDE_SELL.
buy_orderstringIdentifier of the order from the buy side.
sell_orderstringIdentifier of the order from the sell side.
timestampint64Timestamp in Unix nanoseconds for when the trade occurred.
typeTrade.TypeType for the trade.
buyer_feeFeeFee amount charged to the buyer party for the trade.
seller_feeFeeFee amount charged to the seller party for the trade.
buyer_auction_batchuint64Auction batch number that the buy side order was placed in.
seller_auction_batchuint64Auction batch number that the sell side order was placed in.
asset_pricestringPrice for the trade using asset decimals, as opposed to market decimals used in the price field. This is only used in trade events for position updates.

TradeSet

NameTypeDescription
tradesrepeated TradeSet of one or more trades.

Transfer

Represents a financial transfer within Vega

NameTypeDescription
ownerstringParty ID for the owner of the transfer.
amountFinancialAmountFinancial amount of an asset to transfer.
typeTransferTypeType of transfer, gives the reason for the transfer.
min_amountstringMinimum amount. This field is an unsigned integer scaled to the asset's decimal places.
market_idstringMarket ID the transfer is for

TransferRequest

Represents a request to transfer from one set of accounts to another

NameTypeDescription
from_accountrepeated AccountOne or more accounts to transfer from.
to_accountrepeated AccountOne or more accounts to transfer to.
amountstringAmount to transfer for the asset. This field is an unsigned integer scaled to the asset's decimal places.
min_amountstringMinimum amount that needs to be transferred for the transfer request. If this minimum isn't reached, it will error. This field is an unsigned integer scaled to the asset's decimal places.
assetstringAsset ID of the asset being transferred.
typeTransferTypeType of the request for transfer.

VectorValue

NameTypeDescription
valuerepeated string

VestingBenefitTier

NameTypeDescription
minimum_quantum_balancestring
reward_multiplierstring

VestingBenefitTiers

NameTypeDescription
tiersrepeated VestingBenefitTier

VolumeBenefitTier

NameTypeDescription
minimum_running_notional_taker_volumestringRequired running notional taker volume in quantum units for parties to access this tier.
volume_discount_factorstringProportion of the taker fees to be discounted.

VolumeDiscountProgram

NameTypeDescription
versionuint64Incremental version of the program. It is incremented after each program update.
idstringUnique ID generated from the proposal that created this program.
benefit_tiersrepeated VolumeBenefitTierDefined benefit tiers ordered by increasing discounts.
end_of_program_timestampint64Timestamp in Unix seconds, after which when the current epoch ends, the program will end and benefits will be disabled.
window_lengthuint64Number of epochs over which a referral set's running volume is evaluated.

WithdrawExt

Withdrawal external details

NameTypeDescription
erc20Erc20WithdrawExtERC20 withdrawal details.

Withdrawal

Withdrawal from the Vega network

NameTypeDescription
idstringUnique ID for the withdrawal.
party_idstringUnique party ID of the user initiating the withdrawal.
amountstringAmount to be withdrawn. This field is an unsigned integer scaled to the asset's decimal places.
assetstringAsset to withdraw funds from.
statusWithdrawal.StatusStatus of the withdrawal.
refstringReference which is used by the foreign chain to refer to this withdrawal.
tx_hashstringHash of the foreign chain for this transaction.
created_timestampint64Timestamp for when the network started to process this withdrawal.
withdrawn_timestampint64Timestamp for when the withdrawal was finalised by the network.
extWithdrawExtForeign chain specifics.

Enums

AccountType

Various collateral/account types as used by Vega

NameNumberDescription
ACCOUNT_TYPE_UNSPECIFIED0Default value
ACCOUNT_TYPE_INSURANCE1Insurance pool accounts contain insurance pool funds for a market
ACCOUNT_TYPE_SETTLEMENT2Settlement accounts exist only during settlement or mark-to-market
ACCOUNT_TYPE_MARGIN3Margin accounts contain funds set aside for the margin needed to support a party's open positions. Each party will have a margin account for each market they have traded in. Required initial margin is allocated to each market from user's general account. Collateral in the margin account can't be withdrawn or used as margin on another market until it is released back to the general account. Vega protocol uses an internal accounting system to segregate funds held as margin from other funds to ensure they are never lost or 'double spent' Margin account funds will vary as margin requirements on positions change
ACCOUNT_TYPE_GENERAL4General accounts contain the collateral for a party that is not otherwise allocated. A party will have multiple general accounts, one for each asset they want to trade with General accounts are where funds are initially deposited or withdrawn from, it is also the account where funds are taken to fulfil fees and initial margin requirements
ACCOUNT_TYPE_FEES_INFRASTRUCTURE5Infrastructure accounts contain fees earned by providing infrastructure on Vega
ACCOUNT_TYPE_FEES_LIQUIDITY6Liquidity accounts contain fees earned by providing liquidity on Vega markets
ACCOUNT_TYPE_FEES_MAKER7This account is created to hold fees earned by placing orders that sit on the book and are then matched with an incoming order to create a trade - These fees reward parties who provide the best priced liquidity that actually allows trading to take place
ACCOUNT_TYPE_BOND9This account is created to maintain liquidity providers funds commitments
ACCOUNT_TYPE_EXTERNAL10External account represents an external source (deposit/withdrawal)
ACCOUNT_TYPE_GLOBAL_INSURANCE11Global insurance account for the asset
ACCOUNT_TYPE_GLOBAL_REWARD12Global reward account for the asset
ACCOUNT_TYPE_PENDING_TRANSFERS13Per asset account used to store pending transfers (if any)
ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES14Per asset reward account for fees paid to makers
ACCOUNT_TYPE_REWARD_MAKER_RECEIVED_FEES15Per asset reward account for fees received by makers
ACCOUNT_TYPE_REWARD_LP_RECEIVED_FEES16Per asset reward account for fees received by liquidity providers
ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS17Per asset reward account for market proposers when the market goes above some trading threshold
ACCOUNT_TYPE_HOLDING18Per asset account for holding in-flight unfilled orders' funds
ACCOUNT_TYPE_LP_LIQUIDITY_FEES19Network controlled liquidity provider's account, per market, to hold accrued liquidity fees.
ACCOUNT_TYPE_LIQUIDITY_FEES_BONUS_DISTRIBUTION20Network controlled liquidity fees bonus distribution account, per market.
ACCOUNT_TYPE_NETWORK_TREASURY21Network controlled treasury
ACCOUNT_TYPE_VESTING_REWARDS22Account holding user's rewards for the vesting period
ACCOUNT_TYPE_VESTED_REWARDS23Account holding user's rewards after the vesting period
ACCOUNT_TYPE_REWARD_AVERAGE_POSITION24Per asset market reward account given for average position
ACCOUNT_TYPE_REWARD_RELATIVE_RETURN25Per asset market reward account given for relative return
ACCOUNT_TYPE_REWARD_RETURN_VOLATILITY26Per asset market reward account given for return volatility
ACCOUNT_TYPE_REWARD_VALIDATOR_RANKING27Per asset market reward account given to validators by their ranking
ACCOUNT_TYPE_PENDING_FEE_REFERRAL_REWARD28Per asset account for pending fee referral reward payouts
ACCOUNT_TYPE_ORDER_MARGIN29Per asset market account for party in isolated margin mode

AuctionTrigger

Auction triggers indicate what condition triggered an auction (if market is in auction mode)

NameNumberDescription
AUCTION_TRIGGER_UNSPECIFIED0Default value for AuctionTrigger, no auction triggered
AUCTION_TRIGGER_BATCH1Batch auction
AUCTION_TRIGGER_OPENING2Opening auction
AUCTION_TRIGGER_PRICE3Price monitoring trigger
AUCTION_TRIGGER_LIQUIDITY4Deprecated
AUCTION_TRIGGER_LIQUIDITY_TARGET_NOT_MET5Liquidity auction due to not enough committed liquidity
AUCTION_TRIGGER_UNABLE_TO_DEPLOY_LP_ORDERS6Deprecated
AUCTION_TRIGGER_GOVERNANCE_SUSPENSION7Market is suspended and put into auction via governance

ChainStatus

Vega blockchain status as reported by the node the caller is connected to

NameNumberDescription
CHAIN_STATUS_UNSPECIFIED0Default value, always invalid
CHAIN_STATUS_DISCONNECTED1Blockchain is disconnected
CHAIN_STATUS_REPLAYING2Blockchain is replaying historic transactions
CHAIN_STATUS_CONNECTED3Blockchain is connected and receiving transactions

Deposit.Status

Status of the deposit

NameNumberDescription
STATUS_UNSPECIFIED0Default value, always invalid
STATUS_OPEN1Deposit is being processed by the network
STATUS_CANCELLED2Deposit has been cancelled or failed to be verified by the network
STATUS_FINALIZED3Deposit has been finalised and accounts have been updated
STATUS_DUPLICATE_REJECTED4Deposit has been rejected as a duplicate transaction.

DispatchMetric

NameNumberDescription
DISPATCH_METRIC_UNSPECIFIED0
DISPATCH_METRIC_MAKER_FEES_PAID1Dispatch metric that uses the total maker fees paid in the market
DISPATCH_METRIC_MAKER_FEES_RECEIVED2Dispatch metric that uses the total maker fees received in the market
DISPATCH_METRIC_LP_FEES_RECEIVED3Dispatch metric that uses the total LP fees received in the market
DISPATCH_METRIC_MARKET_VALUE4Dispatch metric that uses total value of the market if above the required threshold and not paid given proposer bonus yet
DISPATCH_METRIC_AVERAGE_POSITION5Dispatch metric that uses the time weighted average position
DISPATCH_METRIC_RELATIVE_RETURN6Dispatch metric that uses the relative PNL of the party in the market
DISPATCH_METRIC_RETURN_VOLATILITY7Dispatch metric that uses return volatility of the party in the market
DISPATCH_METRIC_VALIDATOR_RANKING8Dispatch metric that uses the validator ranking of the validator as metric

DistributionStrategy

NameNumberDescription
DISTRIBUTION_STRATEGY_UNSPECIFIED0
DISTRIBUTION_STRATEGY_PRO_RATA1Rewards funded using the pro-rata strategy should be distributed pro-rata by each entity's reward metric, scaled by any active multipliers that party has.
DISTRIBUTION_STRATEGY_RANK2Rewards funded using the party rank.

EntityScope

NameNumberDescription
ENTITY_SCOPE_UNSPECIFIED0
ENTITY_SCOPE_INDIVIDUALS1Rewards must be distributed directly to eligible parties.
ENTITY_SCOPE_TEAMS2Rewards must be distributed to directly eligible teams, and then amongst team members

EpochAction

What epoch action has occurred

NameNumberDescription
EPOCH_ACTION_UNSPECIFIED0
EPOCH_ACTION_START1Epoch update is for a new epoch.
EPOCH_ACTION_END2Epoch update is for the end of an epoch.

IndividualScope

NameNumberDescription
INDIVIDUAL_SCOPE_UNSPECIFIED0
INDIVIDUAL_SCOPE_ALL1All parties on the network are within the scope of this reward.
INDIVIDUAL_SCOPE_IN_TEAM2All parties that are part of a team are within the scope of this reward.
INDIVIDUAL_SCOPE_NOT_IN_TEAM3All parties that are not part of a team are within the scope of this reward.

Interval

Represents a set of time intervals that are used when querying for candle-stick data

NameNumberDescription
INTERVAL_UNSPECIFIED0Default value, always invalid
INTERVAL_BLOCK-1Block interval is not a fixed amount of time, rather it is used to indicate grouping of events that occur in a single block. It is usually about a second.
INTERVAL_I1M601 minute.
INTERVAL_I5M3005 minutes.
INTERVAL_I15M90015 minutes.
INTERVAL_I30M180030 minutes.
INTERVAL_I1H36001 hour.
INTERVAL_I4H144004 hours.
INTERVAL_I6H216006 hours.
INTERVAL_I8H288008 hours.
INTERVAL_I12H4320012 hours.
INTERVAL_I1D864001 day.
INTERVAL_I7D6048007 days.

LiquidityProvision.Status

Status of a liquidity provision.

NameNumberDescription
STATUS_UNSPECIFIED0Always invalid
STATUS_ACTIVE1Liquidity provision is active
STATUS_STOPPED2Liquidity provision was stopped by the network
STATUS_CANCELLED3Liquidity provision was cancelled by the liquidity provider
STATUS_REJECTED4Liquidity provision was invalid and got rejected
STATUS_UNDEPLOYED5Liquidity provision is valid and accepted by network, but orders aren't deployed
STATUS_PENDING6Liquidity provision is valid and accepted by network but has never been deployed. If when it's possible to deploy the orders for the first time margin check fails, then they will be cancelled without any penalties.

MarginMode

NameNumberDescription
MARGIN_MODE_UNSPECIFIED0Never valid.
MARGIN_MODE_CROSS_MARGIN1Cross margin mode - margin is dynamically acquired and released as a position is marked to market
MARGIN_MODE_ISOLATED_MARGIN2Isolated margin mode - margin for any newly opened position volume is transferred to the margin account when the trade is executed

NodeStatus

Node status type

NameNumberDescription
NODE_STATUS_UNSPECIFIED0
NODE_STATUS_VALIDATOR1Node is a validating node
NODE_STATUS_NON_VALIDATOR2Node is a non-validating node

Order.Status

Status values for an order

NameNumberDescription
STATUS_UNSPECIFIED0Default value, always invalid
STATUS_ACTIVE1Used for active unfilled or partially filled orders
STATUS_EXPIRED2Used for expired GTT orders
STATUS_CANCELLED3Used for orders cancelled by the party that created the order
STATUS_STOPPED4Used for unfilled FOK or IOC orders, and for orders that were stopped by the network
STATUS_FILLED5Used for closed fully filled orders
STATUS_REJECTED6Used for orders when not enough collateral was available to fill the margin requirements
STATUS_PARTIALLY_FILLED7Used for closed partially filled IOC orders
STATUS_PARKED8Order has been removed from the order book and has been parked, this applies to pegged orders and liquidity orders (orders created from a liquidity provision shape)

Order.TimeInForce

Time In Force for an order

NameNumberDescription
TIME_IN_FORCE_UNSPECIFIED0Default value for TimeInForce, can be valid for an amend
TIME_IN_FORCE_GTC1Good until cancelled, the order trades any amount and as much as possible and remains on the book until it either trades completely or is cancelled
TIME_IN_FORCE_GTT2Good until specified time, this order type trades any amount and as much as possible and remains on the book until it either trades completely, is cancelled, or expires at a set time NOTE: this may in future be multiple types or have sub types for orders that provide different ways of specifying expiry
TIME_IN_FORCE_IOC3Immediate or cancel, the order trades any amount and as much as possible but does not remain on the book (whether it trades or not)
TIME_IN_FORCE_FOK4Fill or kill, the order either trades completely i.e. remainingSize == 0 after adding, or not at all, and does not remain on the book if it doesn't trade
TIME_IN_FORCE_GFA5Good for auction, this order is only accepted during an auction period
TIME_IN_FORCE_GFN6Good for normal, this order is only accepted during normal trading (that can be continuous trading or frequent batched auctions)

Order.Type

Type values for an order

NameNumberDescription
TYPE_UNSPECIFIED0Default value, always invalid
TYPE_LIMIT1Used for Limit orders
TYPE_MARKET2Used for Market orders
TYPE_NETWORK3Used for orders where the initiating party is the network (with distressed parties)

OrderError

OrderError codes are returned in the Order.reason field - If there is an issue with an order during its life-cycle, it will be marked with `status.ORDER_STATUS_REJECTED`

NameNumberDescription
ORDER_ERROR_UNSPECIFIED0Default value, no error reported
ORDER_ERROR_INVALID_MARKET_ID1Order was submitted for a market that does not exist
ORDER_ERROR_INVALID_ORDER_ID2Order was submitted with an invalid ID
ORDER_ERROR_OUT_OF_SEQUENCE3Order was amended with a sequence number that was not previous version + 1
ORDER_ERROR_INVALID_REMAINING_SIZE4Order was amended with an invalid remaining size (e.g. remaining greater than total size)
ORDER_ERROR_TIME_FAILURE5Node was unable to get Vega (blockchain) time
ORDER_ERROR_REMOVAL_FAILURE6Failed to remove an order from the book
ORDER_ERROR_INVALID_EXPIRATION_DATETIME7Order with `TimeInForce.TIME_IN_FORCE_GTT` was submitted or amended with an expiration that was badly formatted or otherwise invalid
ORDER_ERROR_INVALID_ORDER_REFERENCE8Order was submitted or amended with an invalid reference field
ORDER_ERROR_EDIT_NOT_ALLOWED9Order amend was submitted for an order field that cannot not be amended (e.g. order ID)
ORDER_ERROR_AMEND_FAILURE10Amend failure because amend details do not match original order
ORDER_ERROR_NOT_FOUND11Order not found in an order book or store
ORDER_ERROR_INVALID_PARTY_ID12Order was submitted with an invalid or missing party ID
ORDER_ERROR_MARKET_CLOSED13Order was submitted for a market that has closed
ORDER_ERROR_MARGIN_CHECK_FAILED14Order was submitted, but the party did not have enough collateral to cover the order
ORDER_ERROR_MISSING_GENERAL_ACCOUNT15Order was submitted, but the party did not have an account for this asset
ORDER_ERROR_INTERNAL_ERROR16Unspecified internal error
ORDER_ERROR_INVALID_SIZE17Order was submitted with an invalid or missing size (e.g. 0)
ORDER_ERROR_INVALID_PERSISTENCE18Order was submitted with an invalid persistence for its type
ORDER_ERROR_INVALID_TYPE19Order was submitted with an invalid type field
ORDER_ERROR_SELF_TRADING20Order was stopped as it would have traded with another order submitted from the same party
ORDER_ERROR_INSUFFICIENT_FUNDS_TO_PAY_FEES21Order was submitted, but the party did not have enough collateral to cover the fees for the order
ORDER_ERROR_INCORRECT_MARKET_TYPE22Order was submitted with an incorrect or invalid market type
ORDER_ERROR_INVALID_TIME_IN_FORCE23Order was submitted with invalid time in force
ORDER_ERROR_CANNOT_SEND_GFN_ORDER_DURING_AN_AUCTION24Good For Normal order has reached the market when it is in auction mode
ORDER_ERROR_CANNOT_SEND_GFA_ORDER_DURING_CONTINUOUS_TRADING25Good For Auction order has reached the market when it is in continuous trading mode
ORDER_ERROR_CANNOT_AMEND_TO_GTT_WITHOUT_EXPIRYAT26Attempt to amend order to GTT without ExpiryAt
ORDER_ERROR_EXPIRYAT_BEFORE_CREATEDAT27Attempt to amend ExpiryAt to a value before CreatedAt
ORDER_ERROR_CANNOT_HAVE_GTC_AND_EXPIRYAT28Attempt to amend to GTC without an ExpiryAt value
ORDER_ERROR_CANNOT_AMEND_TO_FOK_OR_IOC29Amending to FOK or IOC is invalid
ORDER_ERROR_CANNOT_AMEND_TO_GFA_OR_GFN30Amending to GFA or GFN is invalid
ORDER_ERROR_CANNOT_AMEND_FROM_GFA_OR_GFN31Amending from GFA or GFN is invalid
ORDER_ERROR_CANNOT_SEND_IOC_ORDER_DURING_AUCTION32IOC orders are not allowed during auction
ORDER_ERROR_CANNOT_SEND_FOK_ORDER_DURING_AUCTION33FOK orders are not allowed during auction
ORDER_ERROR_MUST_BE_LIMIT_ORDER34Pegged orders must be LIMIT orders
ORDER_ERROR_MUST_BE_GTT_OR_GTC35Pegged orders can only have TIF GTC or GTT
ORDER_ERROR_WITHOUT_REFERENCE_PRICE36Pegged order must have a reference price
ORDER_ERROR_BUY_CANNOT_REFERENCE_BEST_ASK_PRICE37Buy pegged order cannot reference best ask price
ORDER_ERROR_OFFSET_MUST_BE_GREATER_OR_EQUAL_TO_ZERO40Pegged order offset must be >= 0
ORDER_ERROR_SELL_CANNOT_REFERENCE_BEST_BID_PRICE41Sell pegged order cannot reference best bid price
ORDER_ERROR_OFFSET_MUST_BE_GREATER_THAN_ZERO42Pegged order offset must be > zero
ORDER_ERROR_INSUFFICIENT_ASSET_BALANCE43Party has an insufficient balance, or does not have a general account to submit the order (no deposits made for the required asset)
ORDER_ERROR_CANNOT_AMEND_PEGGED_ORDER_DETAILS_ON_NON_PEGGED_ORDER44Cannot amend details of a non pegged details
ORDER_ERROR_UNABLE_TO_REPRICE_PEGGED_ORDER45Could not re-price a pegged order because a market price is unavailable
ORDER_ERROR_UNABLE_TO_AMEND_PRICE_ON_PEGGED_ORDER46It is not possible to amend the price of an existing pegged order
ORDER_ERROR_NON_PERSISTENT_ORDER_OUT_OF_PRICE_BOUNDS47FOK, IOC, or GFN order was rejected because it resulted in trades outside the price bounds
ORDER_ERROR_TOO_MANY_PEGGED_ORDERS48Unable to submit pegged order, temporarily too many pegged orders across all markets
ORDER_ERROR_POST_ONLY_ORDER_WOULD_TRADE49Post order would trade
ORDER_ERROR_REDUCE_ONLY_ORDER_WOULD_NOT_REDUCE_POSITION50Post order would trade
ORDER_ERROR_ISOLATED_MARGIN_CHECK_FAILED51Isolated margin check failed
ORDER_ERROR_PEGGED_ORDERS_NOT_ALLOWED_IN_ISOLATED_MARGIN_MODE52In isolated margin pegged orders are rejected
ORDER_ERROR_PRICE_NOT_IN_TICK_SIZE53Order price does not respect market's required tick size

PeggedReference

Pegged reference defines which price point a pegged order is linked to - meaning the price for a pegged order is calculated from the value of the reference price point

NameNumberDescription
PEGGED_REFERENCE_UNSPECIFIED0Default value for PeggedReference, no reference given
PEGGED_REFERENCE_MID1Mid price reference
PEGGED_REFERENCE_BEST_BID2Best bid price reference
PEGGED_REFERENCE_BEST_ASK3Best ask price reference

PositionStatus

Represents the status of a position

NameNumberDescription
POSITION_STATUS_UNSPECIFIED0
POSITION_STATUS_ORDERS_CLOSED1
POSITION_STATUS_CLOSED_OUT2
POSITION_STATUS_DISTRESSED4

Side

Side relates to the direction of an order, to Buy, or Sell

NameNumberDescription
SIDE_UNSPECIFIED0Default value, always invalid
SIDE_BUY1Buy order
SIDE_SELL2Sell order

StopOrder.ExpiryStrategy

NameNumberDescription
EXPIRY_STRATEGY_UNSPECIFIED0Never valid
EXPIRY_STRATEGY_CANCELS1Stop order should be cancelled if the expiry time is reached.
EXPIRY_STRATEGY_SUBMIT2Order should be submitted if the expiry time is reached.

StopOrder.RejectionReason

NameNumberDescription
REJECTION_REASON_UNSPECIFIED0Never valid
REJECTION_REASON_TRADING_NOT_ALLOWED1Trading is not allowed yet
REJECTION_REASON_EXPIRY_IN_THE_PAST2Expiry of the stop order is in the past
REJECTION_REASON_MUST_BE_REDUCE_ONLY3Stop orders submission must be reduce only
REJECTION_REASON_MAX_STOP_ORDERS_PER_PARTY_REACHED4Party has reached the maximum stop orders allowed for this market
REJECTION_REASON_STOP_ORDER_NOT_ALLOWED_WITHOUT_A_POSITION5Stop orders are not allowed if there is no open position
REJECTION_REASON_STOP_ORDER_NOT_CLOSING_THE_POSITION6This stop order does not close the position
REJECTION_REASON_STOP_ORDER_LINKED_PERCENTAGE_INVALID7The percentage value for the linked stop order is invalid
REJECTION_REASON_STOP_ORDER_NOT_ALLOWED_DURING_OPENING_AUCTION8Stop orders are not allowed during the opening auction
REJECTION_REASON_STOP_ORDER_CANNOT_MATCH_OCO_EXPIRY_TIMES9Stop OCO orders cannot have the same expiry timestamp

StopOrder.SizeOverrideSetting

NameNumberDescription
SIZE_OVERRIDE_SETTING_UNSPECIFIED0Never valid
SIZE_OVERRIDE_SETTING_NONE1No override, the size within the contained normal order submission will be used
SIZE_OVERRIDE_SETTING_POSITION2Use the total position of the trader

StopOrder.Status

NameNumberDescription
STATUS_UNSPECIFIED0Never valid
STATUS_PENDING1Pending to be executed once the trigger is breached
STATUS_CANCELLED2Cancelled by the user
STATUS_STOPPED3Stopped by the network, e.g: OCO on the other side has been triggered
STATUS_TRIGGERED4Stop order has been triggered and generated an order
STATUS_EXPIRED5Stop order has expired
STATUS_REJECTED6Stop order was rejected at submission

StopOrder.TriggerDirection

NameNumberDescription
TRIGGER_DIRECTION_UNSPECIFIED0Never valid
TRIGGER_DIRECTION_RISES_ABOVE1Stop order is triggered once the price rises above a certain level
TRIGGER_DIRECTION_FALLS_BELOW2Stop order is triggered once the price falls below a certain level

Trade.Type

Type values for a trade

NameNumberDescription
TYPE_UNSPECIFIED0Default value, always invalid
TYPE_DEFAULT1Normal trading between two parties
TYPE_NETWORK_CLOSE_OUT_GOOD2Trading initiated by the network with another party on the book, which helps to zero-out the positions of one or more distressed parties
TYPE_NETWORK_CLOSE_OUT_BAD3Trading initiated by the network with another party off the book, with a distressed party in order to zero-out the position of the party

TransferType

Transfers can occur between parties on Vega, these are the types that indicate why a transfer took place

NameNumberDescription
TRANSFER_TYPE_UNSPECIFIED0Default value, always invalid
TRANSFER_TYPE_LOSS1Funds deducted after final settlement loss
TRANSFER_TYPE_WIN2Funds added to general account after final settlement gain
TRANSFER_TYPE_MTM_LOSS4Funds deducted from margin account after mark to market loss
TRANSFER_TYPE_MTM_WIN5Funds added to margin account after mark to market gain
TRANSFER_TYPE_MARGIN_LOW6Funds transferred from general account to meet margin requirement
TRANSFER_TYPE_MARGIN_HIGH7Excess margin amount returned to general account
TRANSFER_TYPE_MARGIN_CONFISCATED8Margin confiscated from margin account to fulfil closeout
TRANSFER_TYPE_MAKER_FEE_PAY9Maker fee paid from general account
TRANSFER_TYPE_MAKER_FEE_RECEIVE10Maker fee received into general account
TRANSFER_TYPE_INFRASTRUCTURE_FEE_PAY11Infrastructure fee paid from general account
TRANSFER_TYPE_INFRASTRUCTURE_FEE_DISTRIBUTE12Infrastructure fee received into general account
TRANSFER_TYPE_LIQUIDITY_FEE_PAY13Liquidity fee paid from general account
TRANSFER_TYPE_LIQUIDITY_FEE_DISTRIBUTE14Liquidity fee received into general account
TRANSFER_TYPE_BOND_LOW15Bond account funded from general account to meet required bond amount
TRANSFER_TYPE_BOND_HIGH16Bond returned to general account after liquidity commitment was reduced
TRANSFER_TYPE_WITHDRAW18Funds withdrawn from general account
TRANSFER_TYPE_DEPOSIT19Funds deposited to general account
TRANSFER_TYPE_BOND_SLASHING20Bond account penalised when liquidity commitment not met
TRANSFER_TYPE_REWARD_PAYOUT21Reward payout received
TRANSFER_TYPE_TRANSFER_FUNDS_SEND22Internal Vega network instruction for the collateral engine to move funds from a user's general account into the pending transfers pool
TRANSFER_TYPE_TRANSFER_FUNDS_DISTRIBUTE23Internal Vega network instruction for the collateral engine to move funds from the pending transfers pool account into the destination account
TRANSFER_TYPE_CLEAR_ACCOUNT24Market-related accounts emptied because market has closed
TRANSFER_TYPE_CHECKPOINT_BALANCE_RESTORE25Balances restored after network restart
TRANSFER_TYPE_SPOT26Spot trade delivery
TRANSFER_TYPE_HOLDING_LOCK27An internal instruction to transfer a quantity corresponding to an active spot order from a general account into a party holding account.
TRANSFER_TYPE_HOLDING_RELEASE28An internal instruction to transfer an excess quantity corresponding to an active spot order from a holding account into a party general account.
TRANSFER_TYPE_SUCCESSOR_INSURANCE_FRACTION29Insurance pool fraction transfer from parent to successor market.
TRANSFER_TYPE_LIQUIDITY_FEE_ALLOCATE30Allocates liquidity fee earnings to each liquidity provider's network controlled liquidity fee account.
TRANSFER_TYPE_LIQUIDITY_FEE_NET_DISTRIBUTE31Distributes net fee earnings from liquidity provider's fee account to their general account.
TRANSFER_TYPE_SLA_PENALTY_BOND_APPLY32Applies SLA penalty by moving funds from party's bond account to market's insurance pool.
TRANSFER_TYPE_SLA_PENALTY_LP_FEE_APPLY33Applies SLA penalty by moving funds from the liquidity provider's fee account to market insurance pool.
TRANSFER_TYPE_LIQUIDITY_FEE_UNPAID_COLLECT34Collects penalties from the liquidity provider's fee account before the fee revenue is paid, and transfers it to the market's bonus distribution account.
TRANSFER_TYPE_SLA_PERFORMANCE_BONUS_DISTRIBUTE35Distributes performance bonus from market bonus to liquidity provider's general account.
TRANSFER_TYPE_PERPETUALS_FUNDING_LOSS36Funds deducted from margin account after a perpetuals funding loss.
TRANSFER_TYPE_PERPETUALS_FUNDING_WIN37Funds added to margin account after a perpetuals funding gain.
TRANSFER_TYPE_REWARDS_VESTED38Funds moved from the vesting account to the vested account once the vesting period is reached.
TRANSFER_TYPE_FEE_REFERRER_REWARD_PAY39Fee referrer reward paid from general account.
TRANSFER_TYPE_FEE_REFERRER_REWARD_DISTRIBUTE44Fee referrer reward received into general account of the referrer.
TRANSFER_TYPE_ORDER_MARGIN_LOW45Funds transferred from general account to meet order margin requirement in isolated margin mode.
TRANSFER_TYPE_ORDER_MARGIN_HIGH46Excess order margin amount returned to general account.
TRANSFER_TYPE_ISOLATED_MARGIN_LOW47Transfer from order margin account to margin account due to increase of position.
TRANSFER_TYPE_ISOLATED_MARGIN_HIGH48Transfer from excess order margin account to general account.

ValidatorNodeStatus

Validation status of the node

NameNumberDescription
VALIDATOR_NODE_STATUS_UNSPECIFIED0
VALIDATOR_NODE_STATUS_TENDERMINT1Node is a tendermint validator
VALIDATOR_NODE_STATUS_ERSATZ2Node is an ersatz validator
VALIDATOR_NODE_STATUS_PENDING3Node is a pending validator

Withdrawal.Status

Status of the withdrawal

NameNumberDescription
STATUS_UNSPECIFIED0Default value, always invalid
STATUS_OPEN1Withdrawal is open and being processed by the network
STATUS_REJECTED2Withdrawal have been cancelled
STATUS_FINALIZED3Withdrawal went through and is fully finalised, the funds are removed from the Vega network and are unlocked on the foreign chain bridge, for example, on the Ethereum network