Skip to main content
Version: mainnet (v0.71)

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.
ownerstringNot specified if network account.
market_idstringNot specified if account is not related to a market.

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.

Candle

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

NameTypeDescription
timestampint64Timestamp for the point in time when the candle was initially created/opened, in nanoseconds.
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.

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.
marketsstringOptional markets in scope.

Epoch

NameTypeDescription
sequint64Sequence is used as epoch ID.
timestampsEpochTimestampsTimestamps for start/end etc.
validatorsNodeValidators that participated in this epoch.
delegationsDelegationList 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 of epoch start in nanoseconds.
expiry_timeint64Timestamp of epoch expiry in nanoseconds.
end_timeint64Timestamp of epoch end in nanoseconds, empty if not started.
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 Ethereum network. The address should start with "0x".
deployment_block_heightuint64Block height at which the stacking contract has been deployed for this Ethereum network.

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.

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.

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.
timestampint64Unixnano timestamp at which 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.

LedgerMovement

NameTypeDescription
entriesLedgerEntryAll the entries for these ledger movements.
balancesPostTransferBalanceResulting 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 by the core

NameTypeDescription
order_idstringUnique ID of the pegged order generated by the core 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 (float).
average_entry_valuationstringAverage entry valuation of the liquidity provider for the market.
average_scorestringAverage liquidity score.

LiquidityProvision

Liquidity provider commitment

NameTypeDescription
idstringUnique ID for the liquidity provision.
party_idstringUnique party ID for the creator of the provision.
created_atint64Timestamp for when the order was created at, in nanoseconds.
updated_atint64Timestamp for when the order was updated at, in nanoseconds.
market_idstringMarket ID for the order, required field.
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.
sellsLiquidityOrderReferenceSet of liquidity sell orders to meet the liquidity provision obligation.
buysLiquidityOrderReferenceSet of liquidity buy orders to meet the liquidity provision obligation.
versionuint64Version of this liquidity provision order.
statusLiquidityProvision.StatusStatus of this liquidity provision order.
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 for the time the ledger entry was created, in nanoseconds.

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 at which this mark price was relevant, in nanoseconds.
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_boundsPriceMonitoringBoundsOne or more price monitoring bounds for the current timestamp.
market_value_proxystringMarket value proxy.
liquidity_provider_fee_shareLiquidityProviderFeeShareEquity like share of liquidity fee for each liquidity provider.
market_stateMarket.StateCurrent state of the market.
next_mark_to_marketint64Next MTM timestamp.
last_traded_pricestringLast traded price of the market. This field is an unsigned integer scaled to the market's decimal places.

MarketDepth

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

NameTypeDescription
market_idstringMarket ID for which the depth levels apply.
buyPriceLevelCollection of price levels for the buy side of the book.
sellPriceLevelCollection 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.
buyPriceLevelCollection of updated price levels for the buy side of the book.
sellPriceLevelCollection 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
valueVectorValue

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_fromint64Date/timestamp in unix nanoseconds at which market proposals will be enabled (0 indicates not set).
propose_asset_enabled_fromint64Date/timestamp in unix nanoseconds at which asset proposals will be enabled (0 indicates not set).

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.
delegationsDelegationNode'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.
promotedstringIDs of nodes that were promoted into this node set at the start of the epoch.
demotedstringIDs of nodes that were demoted into this node set at the start of the epoch.
maximumuint32Total 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. This is set by the system after consensus.
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 for the order. - For detail on `STATUS_REJECTED` please check the OrderError value given in the `reason` field.
expires_atint64Timestamp for when the order will expire, in nanoseconds.
referencestringReference given for the order, this is typically used to retrieve an order submitted through consensus - Currently set internally by the node to return a unique reference ID for the order submission.
reasonOrderErrorIf the Order `status` is `STATUS_REJECTED` then an OrderError reason will be specified - The default for this field is `ORDER_ERROR_NONE` which signifies that there were no errors.
updated_atint64Timestamp for when the order was last updated, in nanoseconds.
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 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.

OrderCancellationConfirmation

Used when cancelling an order

NameTypeDescription
orderOrderOrder that was cancelled.

OrderConfirmation

Used when confirming an order

NameTypeDescription
orderOrderOrder that was confirmed.
tradesTrade0 or more trades that were emitted.
passive_orders_affectedOrder0 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.

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.

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.

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.

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.

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

StateValueProposal

NameTypeDescription
state_var_idstringState variable ID.
event_idstringEvent ID.
kvbKeyValueBundleKey value tolerance triplets.

StateVarValue

NameTypeDescription
scalar_valScalarValue
vector_valVectorValue
matrix_valMatrixValue

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 (generated by Vega).
market_idstringMarket ID (the market that the trade occurred on).
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 for when the trade occurred, in nanoseconds.
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.

TradeSet

NameTypeDescription
tradesTradeSet 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_accountAccountOne or more accounts to transfer from.
to_accountAccountOne 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
valuestring

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

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_ORDERS6Liquidity auction due to not being able to deploy LP orders because there's nothing to peg on one or both sides of the book

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 by the network
STATUS_FINALIZED3Deposit has been finalised and accounts have been updated

DispatchMetric

NameNumberDescription
DISPATCH_METRIC_UNSPECIFIED0
DISPATCH_METRIC_MAKER_FEES_PAID1Dispatch metric that is using the total maker fees paid in the market
DISPATCH_METRIC_MAKER_FEES_RECEIVED2Dispatch metric that is using the total maker fees received in the market
DISPATCH_METRIC_LP_FEES_RECEIVED3Dispatch metric that is using the total LP fees received in the market
DISPATCH_METRIC_MARKET_VALUE4Dispatch metric that is using total value of the market if above the required threshold and not paid given proposer bonus yet

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.

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_I1H36001 hour.
INTERVAL_I6H216006 hours.
INTERVAL_I1D864001 day.

LiquidityProvision.Status

Status of a liquidity provision order.

NameNumberDescription
STATUS_UNSPECIFIED0Default value
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.

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

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

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

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