Protocol Documentation

Table of Contents

github.com/mwitkow/go-proto-validators/validator.proto

Top

FieldValidator

FieldTypeLabelDescription
regex string optional

Uses a Golang RE2-syntax regex to match the field contents.

int_gt int64 optional

Field value of integer strictly greater than this value.

int_lt int64 optional

Field value of integer strictly smaller than this value.

msg_exists bool optional

Used for nested message types, requires that the message type exists.

human_error string optional

Human error specifies a user-customizable error that is visible to the user.

float_gt double optional

Field value of double strictly greater than this value. Note that this value can only take on a valid floating point value. Use together with float_epsilon if you need something more specific.

float_lt double optional

Field value of double strictly smaller than this value. Note that this value can only take on a valid floating point value. Use together with float_epsilon if you need something more specific.

float_epsilon double optional

Field value of double describing the epsilon within which any comparison should be considered to be true. For example, when using float_gt = 0.35, using a float_epsilon of 0.05 would mean that any value above 0.30 is acceptable. It can be thought of as a {float_value_condition} +- {float_epsilon}. If unset, no correction for floating point inaccuracies in comparisons will be attempted.

float_gte double optional

Floating-point value compared to which the field content should be greater or equal.

float_lte double optional

Floating-point value compared to which the field content should be smaller or equal.

string_not_empty bool optional

Used for string fields, requires the string to be not empty (i.e different from "").

repeated_count_min int64 optional

Repeated field with at least this number of elements.

repeated_count_max int64 optional

Repeated field with at most this number of elements.

length_gt int64 optional

Field value of length greater than this value.

length_lt int64 optional

Field value of length smaller than this value.

length_eq int64 optional

Field value of integer strictly equal this value.

is_in_enum bool optional

Requires that the value is in the enum.

uuid_ver int32 optional

Ensures that a string value is in UUID format. uuid_ver specifies the valid UUID versions. Valid values are: 0-5. If uuid_ver is 0 all UUID versions are accepted.

OneofValidator

FieldTypeLabelDescription
required bool optional

Require that one of the oneof fields is set.

File-level Extensions

ExtensionTypeBaseNumberDescription
field FieldValidator .google.protobuf.FieldOptions 65020

oneof OneofValidator .google.protobuf.OneofOptions 65021

vega/oracles/v1/spec.proto

Top

Condition

Condition describes the condition that must be validated by the

FieldTypeLabelDescription
operator Condition.Operator

comparator is the type of comparison to make on the value.

value string

value is used by the comparator.

Filter

Filter describes the conditions under which an oracle data is considered of

interest or not.

FieldTypeLabelDescription
key PropertyKey

key is the oracle data property key targeted by the filter.

conditions Condition repeated

conditions are the conditions that should be matched by the data to be considered of interest.

OracleSpec

An oracle spec describe the oracle data that a product (or a risk model)

wants to get from the oracle engine.

This message contains additional information used by the API.

FieldTypeLabelDescription
id string

id is a hash generated from the OracleSpec data.

created_at int64

Creation Date time

updated_at int64

Last Updated timestamp

pub_keys string repeated

pubKeys is the list of authorized public keys that signed the data for this oracle. All the public keys in the oracle data should be contained in these public keys.

filters Filter repeated

filters describes which oracle data are considered of interest or not for the product (or the risk model).

status OracleSpec.Status

status describes the status of the oracle spec

OracleSpecConfiguration

An oracle spec describe the oracle data that a product (or a risk model)

wants to get from the oracle engine.

FieldTypeLabelDescription
pub_keys string repeated

pubKeys is the list of authorized public keys that signed the data for this oracle. All the public keys in the oracle data should be contained in these public keys.

filters Filter repeated

filters describes which oracle data are considered of interest or not for the product (or the risk model).

PropertyKey

PropertyKey describes the property key contained in an oracle data.

FieldTypeLabelDescription
name string

name is the name of the property.

type PropertyKey.Type

type is the type of the property.

Condition.Operator

Comparator describes the type of comparison.

NameNumberDescription
OPERATOR_UNSPECIFIED 0

The default value

OPERATOR_EQUALS 1

Verify if the property values are strictly equal or not.

OPERATOR_GREATER_THAN 2

Verify if the oracle data value is greater than the Condition value.

OPERATOR_GREATER_THAN_OR_EQUAL 3

Verify if the oracle data value is greater than or equal to the Condition value.

OPERATOR_LESS_THAN 4

Verify if the oracle data value is less than the Condition value.

OPERATOR_LESS_THAN_OR_EQUAL 5

Verify if the oracle data value is less or equal to than the Condition value.

OracleSpec.Status

Status describe the status of the oracle spec

NameNumberDescription
STATUS_UNSPECIFIED 0

The default value.

STATUS_ACTIVE 1

STATUS_ACTIVE describes an active oracle spec.

STATUS_DEACTIVATED 2

STATUS_DEACTIVATED describes an oracle spec that is not listening to data anymore.

PropertyKey.Type

Type describes the type of properties that are supported by the oracle

engine.

NameNumberDescription
TYPE_UNSPECIFIED 0

The default value.

TYPE_EMPTY 1

Any type.

TYPE_INTEGER 2

Integer type.

TYPE_STRING 3

String type.

TYPE_BOOLEAN 4

Boolean type.

TYPE_DECIMAL 5

Any floating point decimal type.

TYPE_TIMESTAMP 6

Timestamp date type.

vega/markets.proto

Top

AuctionDuration

An auction duration is used to configure 3 auction periods:

1. `duration > 0`, `volume == 0`:

The auction will last for at least N seconds

2. `duration == 0`, `volume > 0`:

The auction will end once we can close with given traded volume

3. `duration > 0`, `volume > 0`:

The auction will take at least N seconds, but can end sooner if we can trade a certain volume

FieldTypeLabelDescription
duration int64

Duration of the auction in seconds

volume uint64

Target uncrossing trading volume

ContinuousTrading

Continuous trading

FieldTypeLabelDescription
tick_size string

Tick size

DiscreteTrading

Discrete trading

FieldTypeLabelDescription
duration_ns int64

Duration in nanoseconds, maximum 1 month (2592000000000000 ns)

tick_size string

Tick size

Validated Fields

Field Validations
duration_ns
  • int_gt: 0
  • int_lt: 2592000000000000

FeeFactors

Fee factors definition

FieldTypeLabelDescription
maker_fee string

Maker fee

infrastructure_fee string

Infrastructure fee

liquidity_fee string

Liquidity fee

Fees

Fees definition

FieldTypeLabelDescription
factors FeeFactors

Fee factors

Future

Future product definition

FieldTypeLabelDescription
maturity string

The maturity for the future

settlement_asset string

The asset for the future

quote_name string

Quote name of the instrument

oracle_spec_for_settlement_price oracles.v1.OracleSpec

The oracle spec describing the settlement price oracle filter

oracle_spec_for_trading_termination oracles.v1.OracleSpec

the oracle spec describing the trading termination oracle filter

oracle_spec_binding OracleSpecToFutureBinding

The binding between the oracle spec and the oracle data

Instrument

Instrument definition

FieldTypeLabelDescription
id string

Instrument identifier

code string

Code for the instrument

name string

Name of the instrument

metadata InstrumentMetadata

A collection of instrument meta-data

future Future

Future

InstrumentMetadata

Instrument metadata definition

FieldTypeLabelDescription
tags string repeated

A list of 0 or more tags

LiquidityMonitoringParameters

LiquidityMonitoringParameters contains settings used for liquidity monitoring

FieldTypeLabelDescription
target_stake_parameters TargetStakeParameters

Specifies parameters related to target stake calculation

triggering_ratio double

Specifies the triggering ratio for entering liquidity auction

auction_extension int64

Specifies by how many seconds an auction should be extended if leaving the auction were to trigger a liquidity auction

Validated Fields

Field Validations
triggering_ratio
  • float_gte: 0
  • float_lte: 1

LogNormalModelParams

Risk model parameters for log normal

FieldTypeLabelDescription
mu double

Mu param

r double

R param

sigma double

Sigma param

LogNormalRiskModel

Risk model for log normal

FieldTypeLabelDescription
risk_aversion_parameter double

Risk Aversion Parameter

tau double

Tau

params LogNormalModelParams

Risk model parameters for log normal

MarginCalculator

Margin Calculator definition

FieldTypeLabelDescription
scaling_factors ScalingFactors

Scaling factors for margin calculation

Market

Market definition

FieldTypeLabelDescription
id string

Unique identifier

tradable_instrument TradableInstrument

Tradable instrument configuration

decimal_places uint64

Number of decimal places that a price must be shifted by in order to get a correct price denominated in the currency of the market, for example: `realPrice = price / 10^decimalPlaces`

fees Fees

Fees configuration

opening_auction AuctionDuration

Auction duration specifies how long the opening auction will run (minimum duration and optionally a minimum traded volume)

continuous ContinuousTrading

Continuous

discrete DiscreteTrading

Discrete

price_monitoring_settings PriceMonitoringSettings

PriceMonitoringSettings for the market

liquidity_monitoring_parameters LiquidityMonitoringParameters

LiquidityMonitoringParameters for the market

trading_mode Market.TradingMode

Current mode of execution of the market

state Market.State

Current state of the market

market_timestamps MarketTimestamps

Timestamps for when the market stay changes

MarketTimestamps

Time stamps for important times about creating, enacting etc the market

FieldTypeLabelDescription
proposed int64

Time when the market is first proposed

pending int64

Time when the market has been voted in and is created into an opening auction

open int64

Time when the market has left the opening auction and is ready to accept trades

close int64

Time when the market is closed

OracleSpecToFutureBinding

OracleSpecToFutureBinding tells on which property oracle data should be

used as settlement price and which to use the trading terminated trigger

FieldTypeLabelDescription
settlement_price_property string

settlement_price_property holds the name of the property in the oracle data that should be used as settlement price. If it is set to "prices.BTC.value", then the Future will use the value of this property as settlement price.

trading_termination_property string

the name of the property in the oracle data that signals termination of trading

PriceMonitoringParameters

PriceMonitoringParameters contains a collection of triggers to be used for a given market

FieldTypeLabelDescription
triggers PriceMonitoringTrigger repeated

PriceMonitoringSettings

PriceMonitoringSettings contains the settings for price monitoring

FieldTypeLabelDescription
parameters PriceMonitoringParameters

Specifies price monitoring parameters to be used for price monitoring purposes

update_frequency int64

Specifies how often (expressed in seconds) the price monitoring bounds should be updated

PriceMonitoringTrigger

PriceMonitoringTrigger holds together price projection horizon τ, probability level p, and auction extension duration

FieldTypeLabelDescription
horizon int64

Price monitoring projection horizon τ in seconds

probability double

Price monitoring probability level p

auction_extension int64

Price monitoring auction extension duration in seconds should the price breach it's theoretical level over the specified horizon at the specified probability level

Validated Fields

Field Validations
horizon
  • int_gt: 0
probability
  • float_gt: 0
  • float_lt: 1
auction_extension
  • int_gt: 0

ScalingFactors

Scaling Factors (for use in margin calculation)

FieldTypeLabelDescription
search_level double

Search level

initial_margin double

Initial margin level

collateral_release double

Collateral release level

SimpleModelParams

Risk model parameters for simple modelling

FieldTypeLabelDescription
factor_long double

Pre-defined risk factor value for long

factor_short double

Pre-defined risk factor value for short

max_move_up double

Pre-defined maximum price move up that the model considers as valid

min_move_down double

Pre-defined minimum price move down that the model considers as valid

probability_of_trading double

Pre-defined constant probability of trading

Validated Fields

Field Validations
max_move_up
  • float_gte: 0
min_move_down
  • float_lte: 0
probability_of_trading
  • float_gte: 0
  • float_lte: 1

SimpleRiskModel

Risk model for simple modelling

FieldTypeLabelDescription
params SimpleModelParams

Risk model params for simple modelling

TargetStakeParameters

TargetStakeParameters contains parameters used in target stake calculation

FieldTypeLabelDescription
time_window int64

Specifies length of time window expressed in seconds for target stake calculation

scaling_factor double

Specifies scaling factors used in target stake calculation

Validated Fields

Field Validations
time_window
  • int_gt: 0
scaling_factor
  • float_gt: 0

TradableInstrument

Tradable Instrument definition

FieldTypeLabelDescription
instrument Instrument

Instrument details

margin_calculator MarginCalculator

Margin calculator for the instrument

log_normal_risk_model LogNormalRiskModel

Log normal

simple_risk_model SimpleRiskModel

Simple

Market.State

The current state of the Market

NameNumberDescription
STATE_UNSPECIFIED 0

Default value, invalid

STATE_PROPOSED 1

The Governance proposal valid and accepted

STATE_REJECTED 2

Outcome of governance votes is to reject the market

STATE_PENDING 3

Governance vote passes/wins

STATE_CANCELLED 4

Market triggers cancellation condition or governance votes to close before market becomes Active

STATE_ACTIVE 5

Enactment date reached and usual auction exit checks pass

STATE_SUSPENDED 6

Price monitoring or liquidity monitoring trigger

STATE_CLOSED 7

Governance vote (to close)

STATE_TRADING_TERMINATED 8

Defined by the product (i.e. from a product parameter, specified in market definition, giving close date/time)

STATE_SETTLED 9

Settlement triggered and completed as defined by product

Market.TradingMode

The trading mode the market is currently running, also referred to as 'market state'

NameNumberDescription
TRADING_MODE_UNSPECIFIED 0

Default value, this is invalid

TRADING_MODE_CONTINUOUS 1

Normal trading

TRADING_MODE_BATCH_AUCTION 2

Auction trading (FBA)

TRADING_MODE_OPENING_AUCTION 3

Opening auction

TRADING_MODE_MONITORING_AUCTION 4

Auction triggered by monitoring

vega/assets.proto

Top

Asset

The Vega representation of an external asset

FieldTypeLabelDescription
id string

Internal identifier of the asset

details AssetDetails

The definition of the external source for this asset

AssetDetails

The Vega representation of an external asset

FieldTypeLabelDescription
name string

Name of the asset (e.g: Great British Pound)

symbol string

Symbol of the asset (e.g: GBP)

total_supply string

Total circulating supply for the asset

decimals uint64

Number of decimal / precision handled by this asset

min_lp_stake string

Min stake required for this asset from liquidity providers

builtin_asset BuiltinAsset

A built-in asset

erc20 ERC20

An Ethereum ERC20 asset

BuiltinAsset

A Vega internal asset

FieldTypeLabelDescription
max_faucet_amount_mint string

Maximum amount that can be requested by a party through the built-in asset faucet at a time

ERC20

An ERC20 token based asset, living on the ethereum network

FieldTypeLabelDescription
contract_address string

The address of the contract for the token, on the ethereum network

vega/vega.proto

Top

Account

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

FieldTypeLabelDescription
id string

Unique account identifier (used internally by Vega)

owner string

The party 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

balance string

Balance 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

asset string

Asset identifier for the account

market_id string

Market identifier for the account, if [`AccountType`](#vega.AccountType).`ACCOUNT_TYPE_GENERAL` this will be empty

type AccountType

The account type related to this account

AuctionIndicativeState

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

FieldTypeLabelDescription
market_id string

The market identifier for which this state relates to

indicative_price string

The Indicative Uncrossing Price is the price at which all trades would occur if we uncrossed the auction now

indicative_volume uint64

The Indicative Uncrossing Volume is the volume available at the Indicative crossing price if we uncrossed the auction now

auction_start int64

The timestamp at which the auction started

auction_end int64

The timestamp 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

FieldTypeLabelDescription
timestamp int64

Timestamp for the point in time when the candle was initially created/opened, in nanoseconds since the epoch - See [`VegaTimeResponse`](#api.VegaTimeResponse).`timestamp`

datetime string

An ISO-8601 datetime with nanosecond precision for when the candle was last updated

high string

Highest price for trading during the candle interval

low string

Lowest price for trading during the candle interval

open string

Open trade price

close string

Closing trade price

volume uint64

Total trading volume during the candle interval

interval Interval

Time interval for the candle - See [`Interval`](#vega.Interval)

Delegation

FieldTypeLabelDescription
party string

Party which is delegating

node_id string

Node ID

amount string

Amount delegated

epoch_seq string

Epoch of delegation

Deposit

A deposit on to the Vega network

FieldTypeLabelDescription
id string

Unique identifier for the deposit

status Deposit.Status

Status of the deposit

party_id string

Party identifier of the user initiating the deposit

asset string

The Vega asset targeted by this deposit

amount string

The amount to be deposited

tx_hash string

The hash of the transaction from the foreign chain

credited_timestamp int64

Timestamp for when the Vega account was updated with the deposit

created_timestamp int64

Timestamp for when the deposit was created on the Vega network

Epoch

FieldTypeLabelDescription
seq uint64

Sequence is used as epoch identifier

timestamps EpochTimestamps

Timestamps for start/end etc

validators Node repeated

Validators that participated in this epoch

delegations Delegation repeated

List of all delegations in epoch

Validated Fields

Field Validations
timestamps
  • msg_exists: true

EpochData

FieldTypeLabelDescription
total int32

Total number of epochs since node was created

offline int32

Total number of offline epochs since node was created

online int32

Total number of online epochs since node was created

EpochParticipation

FieldTypeLabelDescription
epoch Epoch

offline uint64

online uint64

total_rewards double

Validated Fields

Field Validations
epoch
  • string_not_empty: true

EpochTimestamps

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

FieldTypeLabelDescription
start_time int64

Timestamp of epoch start in nanoseconds - See [`VegaTimeResponse`](#api.VegaTimeResponse).`timestamp`

expiry_time int64

Timestamp of epoch expiry in nanoseconds - See [`VegaTimeResponse`](#api.VegaTimeResponse).`timestamp`

end_time int64

Timestamp of epoch end in nanoseconds, empty if not started - See [`VegaTimeResponse`](#api.VegaTimeResponse).`timestamp`

first_block uint64

Height of first block in the epoch

last_block uint64

Height of last block in the epoch, empty if not ended

Erc20WithdrawExt

An extension of data required for the withdraw submissions

FieldTypeLabelDescription
receiver_address string

The address into which the bridge will release the funds

ErrorDetail

Represents Vega domain specific error information over gRPC/Protobuf

FieldTypeLabelDescription
code int32

A Vega API domain specific unique error code, useful for client side mappings, e.g. 10004

message string

A message that describes the error in more detail, should describe the problem encountered

inner string

Any inner error information that could add more context, or be helpful for error reporting

EthereumConfig

Ethereum configuration details

FieldTypeLabelDescription
network_id string

Network identifier of this Ethereum network

chain_id string

Chain identifier of this Ethereum network

bridge_address string

Bridge address for this Ethereum network

confirmations uint32

Number of confirmations

staking_bridge_addresses string repeated

Staking Bridge addresses for the ethereum network

Fee

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

FieldTypeLabelDescription
maker_fee string

Fee amount paid to the non-aggressive party of the trade

infrastructure_fee string

Fee amount paid for maintaining the Vega infrastructure

liquidity_fee string

Fee amount paid to market makers

FinancialAmount

Asset value information used within a transfer

FieldTypeLabelDescription
amount string

A signed integer amount of asset

asset string

Asset identifier

LedgerEntry

Represents a ledger entry on Vega

FieldTypeLabelDescription
from_account string

One or more accounts to transfer from

to_account string

One or more accounts to transfer to

amount string

An amount to transfer

reference string

A reference for auditing purposes

type string

Type of ledger entry

timestamp int64

Timestamp for the time the ledger entry was created, in nanoseconds since the epoch - See [`VegaTimeResponse`](#api.VegaTimeResponse).`timestamp`

LiquidityOrder

Represents a liquidity order

FieldTypeLabelDescription
reference PeggedReference

The pegged reference point for the order

proportion uint32

The relative proportion of the commitment to be allocated at a price level

offset int64

The offset/amount of units away for the order

LiquidityOrderReference

A pair of a liquidity order and the id of the generated order by the core

FieldTypeLabelDescription
order_id string

Unique identifier of the pegged order generated by the core to fulfil this liquidity order

liquidity_order LiquidityOrder

The liquidity order from the original submission

LiquidityProviderFeeShare

The equity like share of liquidity fee for each liquidity provider

FieldTypeLabelDescription
party string

The liquidity provider party id

equity_like_share string

The share own by this liquidity provider (float)

average_entry_valuation string

The average entry valuation of the liquidity provider for the market

LiquidityProvision

An Liquidity provider commitment

FieldTypeLabelDescription
id string

Unique identifier

party_id string

Unique party identifier for the creator of the provision

created_at int64

Timestamp for when the order was created at, in nanoseconds since the epoch - See [`VegaTimeResponse`](#api.VegaTimeResponse).`timestamp`

updated_at int64

Timestamp for when the order was updated at, in nanoseconds since the epoch - See [`VegaTimeResponse`](#api.VegaTimeResponse).`timestamp`

market_id string

Market identifier for the order, required field

commitment_amount string

Specified as a unitless number that represents the amount of settlement asset of the market

fee string

Nominated liquidity fee factor, which is an input to the calculation of taker fees on the market, as per seeting fees and rewarding liquidity providers

sells LiquidityOrderReference repeated

A set of liquidity sell orders to meet the liquidity provision obligation

buys LiquidityOrderReference repeated

A set of liquidity buy orders to meet the liquidity provision obligation

version string

Version of this liquidity provision order

status LiquidityProvision.Status

Status of this liquidity provision order

reference string

A reference shared between this liquidity provision and all it's orders

Validated Fields

Field Validations
market_id
  • string_not_empty: true

MarginLevels

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

FieldTypeLabelDescription
maintenance_margin string

Maintenance margin value

search_level string

Search level value

initial_margin string

Initial margin value

collateral_release_level string

Collateral release level value

party_id string

Party identifier

market_id string

Market identifier

asset string

Asset identifier

timestamp int64

Timestamp for the time the ledger entry was created, in nanoseconds since the epoch - See [`VegaTimeResponse`](#api.VegaTimeResponse).`timestamp`

MarketData

Represents data generated by a market when open

FieldTypeLabelDescription
mark_price string

Mark price, as an integer, for example `123456` is a correctly formatted price of `1.23456` assuming market configured to 5 decimal places

best_bid_price string

Highest price level on an order book for buy orders, as an integer, for example `123456` is a correctly formatted price of `1.23456` assuming market configured to 5 decimal places

best_bid_volume uint64

Aggregated volume being bid at the best bid price

best_offer_price string

Lowest price level on an order book for offer orders

best_offer_volume uint64

Aggregated volume being offered at the best offer price, as an integer, for example `123456` is a correctly // formatted price of `1.23456` assuming market configured to 5 decimal places

best_static_bid_price string

Highest price on the order book for buy orders not including pegged orders

best_static_bid_volume uint64

Total volume at the best static bid price excluding pegged orders

best_static_offer_price string

Lowest price on the order book for sell orders not including pegged orders

best_static_offer_volume uint64

Total volume at the best static offer price excluding pegged orders

mid_price string

Arithmetic 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_price string

Arithmetic average of the best static bid price and best static offer price

market string

Market identifier for the data

timestamp int64

Timestamp at which this mark price was relevant, in nanoseconds since the epoch - See [`VegaTimeResponse`](#api.VegaTimeResponse).`timestamp`

open_interest uint64

The sum of the size of all positions greater than 0 on the market

auction_end int64

Time in seconds until the end of the auction (0 if currently not in auction period)

auction_start int64

Time until next auction (used in FBA's) - currently always 0

indicative_price string

Indicative price (zero if not in auction)

indicative_volume uint64

Indicative volume (zero if not in auction)

market_trading_mode Market.TradingMode

The current trading mode for the market

trigger AuctionTrigger

When a market is in an auction trading mode, this field indicates what triggered the auction

extension_trigger AuctionTrigger

When a market auction is extended, this field indicates what caused the extension

target_stake string

Targeted stake for the given market

supplied_stake string

Available stake for the given market

price_monitoring_bounds PriceMonitoringBounds repeated

One or more price monitoring bounds for the current timestamp

market_value_proxy string

the market value proxy

liquidity_provider_fee_share LiquidityProviderFeeShare repeated

the equity like share of liquidity fee for each liquidity provider

MarketDepth

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

FieldTypeLabelDescription
market_id string

Market identifier

buy PriceLevel repeated

Collection of price levels for the buy side of the book

sell PriceLevel repeated

Collection of price levels for the sell side of the book

sequence_number uint64

Sequence number for the market depth data returned

MarketDepthUpdate

Represents the changed market depth since the last update

FieldTypeLabelDescription
market_id string

Market identifier

buy PriceLevel repeated

Collection of updated price levels for the buy side of the book

sell PriceLevel repeated

Collection of updated price levels for the sell side of the book

sequence_number uint64

Sequence number for the market depth update data returned

NetworkParameter

Represents a network parameter on Vega

FieldTypeLabelDescription
key string

The unique key

value string

The value for the network parameter

Node

FieldTypeLabelDescription
id string

The node ID (wallet ID)

pub_key string

Pub key of the node operator

tm_pub_key string

Public key of Tendermint

ethereum_adddress string

Ethereum public key of the node

info_url string

URL where I can find out more info on the node

location string

Country code for the location of the node

staked_by_operator string

The amount the node has put up themselves

staked_by_delegates string

The amount of stake that has been delegated by token holders

staked_total string

Total amount staked on node

max_intended_stake string

Max amount of (wanted) stake, is this a network param or a node param

pending_stake string

Amount of stake on the next epoch

epoch_data EpochData

Informantion about epoch

status NodeStatus

Node status

delegations Delegation repeated

Node's delegations

score string

Node score

normalised_score string

Node normalised score

name string

Node name

avatar_url string

Avatar url

Validated Fields

Field Validations
pub_key
  • string_not_empty: true
epoch_data
  • msg_exists: true
status
  • msg_exists: true

NodeData

FieldTypeLabelDescription
staked_total string

Total staked amount across all nodes

total_nodes uint32

Total number of nodes

inactive_nodes uint32

Number of inactive nodes

validating_nodes uint32

Number of nodes validating

uptime float

Total uptime for all epochs across all nodes

Order

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

FieldTypeLabelDescription
id string

Unique identifier for the order (set by the system after consensus)

market_id string

Market identifier for the order

party_id string

Party identifier for the order

side Side

Side for the order, e.g. SIDE_BUY or SIDE_SELL - See [`Side`](#vega.Side)

price string

Price 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

size uint64

Size for the order, for example, in a futures market the size equals the number of contracts

remaining uint64

Size remaining, when this reaches 0 then the order is fully filled and status becomes STATUS_FILLED

time_in_force Order.TimeInForce

Time in force indicates how long an order will remain active before it is executed or expires. - See [`Order.TimeInForce`](#vega.Order.TimeInForce)

type Order.Type

Type for the order - See [`Order.Type`](#vega.Order.Type)

created_at int64

Timestamp for when the order was created at, in nanoseconds since the epoch - See [`VegaTimeResponse`](#api.VegaTimeResponse).`timestamp`

status Order.Status

The current status for the order. See [`Order.Status`](#vega.Order.Status) - For detail on `STATUS_REJECTED` please check the [`OrderError`](#vega.OrderError) value given in the `reason` field

expires_at int64

Timestamp for when the order will expire, in nanoseconds since the epoch - See [`VegaTimeResponse`](#api.VegaTimeResponse).`timestamp`, valid only for [`Order.TimeInForce`](#vega.Order.TimeInForce)`.TIME_IN_FORCE_GTT`

reference string

Reference 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 identifier for the order submission

reason OrderError

If the Order `status` is `STATUS_REJECTED` then an [`OrderError`](#vega.OrderError) reason will be specified - The default for this field is `ORDER_ERROR_NONE` which signifies that there were no errors

updated_at int64

Timestamp for when the Order was last updated, in nanoseconds since the epoch - See [`VegaTimeResponse`](#api.VegaTimeResponse).`timestamp`

version uint64

The version for the order, initial value is version 1 and is incremented after each successful amend

batch_id uint64

Batch identifier 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_order PeggedOrder

Pegged order details, used only if the order represents a pegged order.

liquidity_provision_id string

Is this order created as part of a liquidity provision, will be empty if not.

OrderCancellationConfirmation

Used when cancelling an Order

FieldTypeLabelDescription
order Order

The order that was cancelled

OrderConfirmation

Used when confirming an Order

FieldTypeLabelDescription
order Order

The order that was confirmed

trades Trade repeated

0 or more trades that were emitted

passive_orders_affected Order repeated

0 or more passive orders that were affected

Party

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

FieldTypeLabelDescription
id string

A unique identifier for the party, typically represented by a public key

Validated Fields

Field Validations
id
  • msg_exists: true

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

FieldTypeLabelDescription
reference PeggedReference

Which price point are we linked to

offset int64

Offset from the price reference

Position

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

FieldTypeLabelDescription
market_id string

Market identifier

party_id string

Party identifier

open_volume int64

Open volume for the position, value is signed +ve for long and -ve for short

realised_pnl string

Realised profit and loss for the position, value is signed +ve for long and -ve for short

unrealised_pnl string

Unrealised profit and loss for the position, value is signed +ve for long and -ve for short

average_entry_price string

Average 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_at int64

Timestamp for the latest time the position was updated

PositionTrade

FieldTypeLabelDescription
volume int64

Volume for the position trade, value is signed +ve for long and -ve for short

price string

Price 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

Price

FieldTypeLabelDescription
value string

Price value, given as an integer, for example `123456` is a correctly formatted price of `1.23456` assuming market configured to 5 decimal places

PriceLevel

Represents a price level from market depth or order book data

FieldTypeLabelDescription
price string

Price 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

number_of_orders uint64

Number of orders at the price level

volume uint64

Volume at the price level

PriceMonitoringBounds

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

FieldTypeLabelDescription
min_valid_price string

Minimum price that isn't currently breaching the specified price monitoring trigger

max_valid_price string

Maximum price that isn't currently breaching the specified price monitoring trigger

trigger PriceMonitoringTrigger

Price monitoring trigger associated with the bounds

reference_price double

Reference price used to calculate the valid price range

RewardDetails

Details for a single reward payment

FieldTypeLabelDescription
asset_id string

party_id string

epoch uint64

amount string

percentage_of_total string

received_at int64

RewardPerAssetDetail

Details for rewards for a single asset

FieldTypeLabelDescription
asset string

asset details

details RewardDetails repeated

rewards ordered by received_at

total_for_asset string

Total amount of rewards for the asset

RiskFactor

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

FieldTypeLabelDescription
market string

Market ID that relates to this risk factor

short double

Short Risk factor value

long double

Long Risk factor value

RiskResult

Risk results are calculated internally by Vega to attempt to maintain safe trading

FieldTypeLabelDescription
updated_timestamp int64

Timestamp for when risk factors were generated

risk_factors RiskResult.RiskFactorsEntry repeated

Risk factors (long and short) for each margin-able asset/currency (usually == settlement assets) in the market

next_update_timestamp int64

Timestamp for when risk factors are expected to change (or empty if risk factors are continually updated)

predicted_next_risk_factors RiskResult.PredictedNextRiskFactorsEntry repeated

Predicted risk factors at next change (what they would be if the change occurred now)

RiskResult.PredictedNextRiskFactorsEntry

FieldTypeLabelDescription
key string

value RiskFactor

RiskResult.RiskFactorsEntry

FieldTypeLabelDescription
key string

value RiskFactor

Timestamp

A timestamp in nanoseconds since epoch

See [`VegaTimeResponse`](#api.VegaTimeResponse).`timestamp`

FieldTypeLabelDescription
value int64

Timestamp value

Trade

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

FieldTypeLabelDescription
id string

Unique identifier for the trade (generated by Vega)

market_id string

Market identifier (the market that the trade occurred on)

price string

Price 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

size uint64

Size filled for the trade

buyer string

Unique party identifier for the buyer

seller string

Unique party identifier for the seller

aggressor Side

Direction of the aggressive party e.g. SIDE_BUY or SIDE_SELL - See [`Side`](#vega.Side)

buy_order string

Identifier of the order from the buy side

sell_order string

Identifier of the order from the sell side

timestamp int64

Timestamp for when the trade occurred, in nanoseconds since the epoch - See [`VegaTimeResponse`](#api.VegaTimeResponse).`timestamp`

type Trade.Type

Type for the trade - See [`Trade.Type`](#vega.Trade.Type)

buyer_fee Fee

Fee amount charged to the buyer party for the trade

seller_fee Fee

Fee amount charged to the seller party for the trade

buyer_auction_batch uint64

Auction batch number that the buy side order was placed in

seller_auction_batch uint64

Auction batch number that the sell side order was placed in

TradeSet

FieldTypeLabelDescription
trades Trade repeated

A set of one or more trades

Transfer

Represents a financial transfer within Vega

FieldTypeLabelDescription
owner string

Party identifier for the owner of the transfer

amount FinancialAmount

A financial amount (of an asset) to transfer

type TransferType

The type of transfer, gives the reason for the transfer

min_amount string

A minimum amount

TransferBalance

Represents the balance for an account during a transfer

FieldTypeLabelDescription
account Account

The account relating to the transfer

balance string

The balance relating to the transfer

TransferRequest

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

FieldTypeLabelDescription
from_account Account repeated

One or more accounts to transfer from

to_account Account repeated

One or more accounts to transfer to

amount string

An amount to transfer for the asset

min_amount string

A minimum amount

asset string

Asset identifier

reference string

A reference for auditing purposes

TransferResponse

Represents the response from a transfer

FieldTypeLabelDescription
transfers LedgerEntry repeated

One or more ledger entries representing the transfers

balances TransferBalance repeated

One or more account balances

WithdrawExt

Withdrawal external details

FieldTypeLabelDescription
erc20 Erc20WithdrawExt

ERC20 withdrawal details

Withdrawal

A withdrawal from the Vega network

FieldTypeLabelDescription
id string

Unique identifier for the withdrawal

party_id string

Unique party identifier of the user initiating the withdrawal

amount string

The amount to be withdrawn

asset string

The asset we want to withdraw funds from

status Withdrawal.Status

The status of the withdrawal

ref string

The reference which is used by the foreign chain to refer to this withdrawal

expiry int64

The time until when the withdrawal is valid

tx_hash string

The hash of the foreign chain for this transaction

created_timestamp int64

Timestamp for when the network started to process this withdrawal

withdrawn_timestamp int64

Timestamp for when the withdrawal was finalised by the network

ext WithdrawExt

Foreign chain specifics

AccountType

Various collateral/account types as used by Vega

NameNumberDescription
ACCOUNT_TYPE_UNSPECIFIED 0

Default value

ACCOUNT_TYPE_INSURANCE 1

Insurance pool accounts contain insurance pool funds for a market

ACCOUNT_TYPE_SETTLEMENT 2

Settlement accounts exist only during settlement or mark-to-market

ACCOUNT_TYPE_MARGIN 3

Margin accounts contain margin funds for a party and each party will have multiple margin accounts, one for each market they have traded in Margin account funds will alter as margin requirements on positions change

ACCOUNT_TYPE_GENERAL 4

General accounts contains general funds for a party. 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_INFRASTRUCTURE 5

Infrastructure accounts contain fees earned by providing infrastructure on Vega

ACCOUNT_TYPE_FEES_LIQUIDITY 6

Liquidity accounts contain fees earned by providing liquidity on Vega markets

ACCOUNT_TYPE_FEES_MAKER 7

This 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_LOCK_WITHDRAW 8

This account is created to lock funds to be withdrawn by parties

ACCOUNT_TYPE_BOND 9

This account is created to maintain liquidity providers funds commitments

ACCOUNT_TYPE_EXTERNAL 10

External account represents an external source (deposit/withdrawal)

ACCOUNT_TYPE_GLOBAL_INSURANCE 11

Global insurance account for the asset

ACCOUNT_TYPE_GLOBAL_REWARD 12

Global reward account for the asset

AuctionTrigger

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

NameNumberDescription
AUCTION_TRIGGER_UNSPECIFIED 0

Default value for AuctionTrigger, no auction triggered

AUCTION_TRIGGER_BATCH 1

Batch auction

AUCTION_TRIGGER_OPENING 2

Opening auction

AUCTION_TRIGGER_PRICE 3

Price monitoring trigger

AUCTION_TRIGGER_LIQUIDITY 4

Liquidity monitoring trigger

ChainStatus

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

NameNumberDescription
CHAIN_STATUS_UNSPECIFIED 0

Default value, always invalid

CHAIN_STATUS_DISCONNECTED 1

Blockchain is disconnected

CHAIN_STATUS_REPLAYING 2

Blockchain is replaying historic transactions

CHAIN_STATUS_CONNECTED 3

Blockchain is connected and receiving transactions

Deposit.Status

The status of the deposit

NameNumberDescription
STATUS_UNSPECIFIED 0

Default value, always invalid

STATUS_OPEN 1

The deposit is being processed by the network

STATUS_CANCELLED 2

The deposit has been cancelled by the network

STATUS_FINALIZED 3

The deposit has been finalised and accounts have been updated

EpochAction

What epoch action has occurred

NameNumberDescription
EPOCH_ACTION_UNSPECIFIED 0

EPOCH_ACTION_START 1

The epoch update is for a new epoch

EPOCH_ACTION_END 2

The epoch 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_UNSPECIFIED 0

Default value, always invalid

INTERVAL_I1M 60

1 minute.

INTERVAL_I5M 300

5 minutes.

INTERVAL_I15M 900

15 minutes.

INTERVAL_I1H 3600

1 hour.

INTERVAL_I6H 21600

6 hours.

INTERVAL_I1D 86400

1 day.

LiquidityProvision.Status

Status of a liquidity provision order

NameNumberDescription
STATUS_UNSPECIFIED 0

The default value

STATUS_ACTIVE 1

The liquidity provision is active

STATUS_STOPPED 2

The liquidity provision was stopped by the network

STATUS_CANCELLED 3

The liquidity provision was cancelled by the liquidity provider

STATUS_REJECTED 4

The liquidity provision was invalid and got rejected

STATUS_UNDEPLOYED 5

The liquidity provision is valid and accepted by network, but orders aren't deployed

STATUS_PENDING 6

The liquidity provision is valid and accepted by network but have never been deployed. I when it's possible to deploy them for the first time margin check fails, then they will be cancelled without any penalties.

NodeStatus

Node status type

NameNumberDescription
NODE_STATUS_UNSPECIFIED 0

NODE_STATUS_VALIDATOR 1

The node is validating

NODE_STATUS_NON_VALIDATOR 2

The node is non-validating

Order.Status

Status values for an order

See resulting status in [What order types are available to trade on Vega?](https://docs.testnet.vega.xyz/docs/trading-questions/#what-order-types-are-available-to-trade-on-vega) for more detail.

NameNumberDescription
STATUS_UNSPECIFIED 0

Default value, always invalid

STATUS_ACTIVE 1

Used for active unfilled or partially filled orders

STATUS_EXPIRED 2

Used for expired GTT orders

STATUS_CANCELLED 3

Used for orders cancelled by the party that created the order

STATUS_STOPPED 4

Used for unfilled FOK or IOC orders, and for orders that were stopped by the network

STATUS_FILLED 5

Used for closed fully filled orders

STATUS_REJECTED 6

Used for orders when not enough collateral was available to fill the margin requirements

STATUS_PARTIALLY_FILLED 7

Used for closed partially filled IOC orders

STATUS_PARKED 8

Order has been removed from the order book and has been parked, this applies to pegged orders only

Order.TimeInForce

Time In Force for an order

See [What order types are available to trade on Vega?](https://docs.testnet.vega.xyz/docs/trading-questions/#what-order-types-are-available-to-trade-on-vega) for more detail

NameNumberDescription
TIME_IN_FORCE_UNSPECIFIED 0

Default value for TimeInForce, can be valid for an amend

TIME_IN_FORCE_GTC 1

Good until cancelled

TIME_IN_FORCE_GTT 2

Good until specified time

TIME_IN_FORCE_IOC 3

Immediate or cancel

TIME_IN_FORCE_FOK 4

Fill or kill

TIME_IN_FORCE_GFA 5

Good for auction

TIME_IN_FORCE_GFN 6

Good for normal

Order.Type

Type values for an order

NameNumberDescription
TYPE_UNSPECIFIED 0

Default value, always invalid

TYPE_LIMIT 1

Used for Limit orders

TYPE_MARKET 2

Used for Market orders

TYPE_NETWORK 3

Used for orders where the initiating party is the network (with distressed parties)

OrderError

OrderError codes are returned in the `[Order](#vega.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_UNSPECIFIED 0

Default value, no error reported

ORDER_ERROR_INVALID_MARKET_ID 1

Order was submitted for a market that does not exist

ORDER_ERROR_INVALID_ORDER_ID 2

Order was submitted with an invalid identifier

ORDER_ERROR_OUT_OF_SEQUENCE 3

Order was amended with a sequence number that was not previous version + 1

ORDER_ERROR_INVALID_REMAINING_SIZE 4

Order was amended with an invalid remaining size (e.g. remaining greater than total size)

ORDER_ERROR_TIME_FAILURE 5

Node was unable to get Vega (blockchain) time

ORDER_ERROR_REMOVAL_FAILURE 6

Failed to remove an order from the book

ORDER_ERROR_INVALID_EXPIRATION_DATETIME 7

An order with `TimeInForce.TIME_IN_FORCE_GTT` was submitted or amended with an expiration that was badly formatted or otherwise invalid

ORDER_ERROR_INVALID_ORDER_REFERENCE 8

Order was submitted or amended with an invalid reference field

ORDER_ERROR_EDIT_NOT_ALLOWED 9

Order amend was submitted for an order field that cannot not be amended (e.g. order identifier)

ORDER_ERROR_AMEND_FAILURE 10

Amend failure because amend details do not match original order

ORDER_ERROR_NOT_FOUND 11

Order not found in an order book or store

ORDER_ERROR_INVALID_PARTY_ID 12

Order was submitted with an invalid or missing party identifier

ORDER_ERROR_MARKET_CLOSED 13

Order was submitted for a market that has closed

ORDER_ERROR_MARGIN_CHECK_FAILED 14

Order was submitted, but the party did not have enough collateral to cover the order

ORDER_ERROR_MISSING_GENERAL_ACCOUNT 15

Order was submitted, but the party did not have an account for this asset

ORDER_ERROR_INTERNAL_ERROR 16

Unspecified internal error

ORDER_ERROR_INVALID_SIZE 17

Order was submitted with an invalid or missing size (e.g. 0)

ORDER_ERROR_INVALID_PERSISTENCE 18

Order was submitted with an invalid persistence for its type

ORDER_ERROR_INVALID_TYPE 19

Order was submitted with an invalid type field

ORDER_ERROR_SELF_TRADING 20

Order was stopped as it would have traded with another order submitted from the same party

ORDER_ERROR_INSUFFICIENT_FUNDS_TO_PAY_FEES 21

Order was submitted, but the party did not have enough collateral to cover the fees for the order

ORDER_ERROR_INCORRECT_MARKET_TYPE 22

Order was submitted with an incorrect or invalid market type

ORDER_ERROR_INVALID_TIME_IN_FORCE 23

Order was submitted with invalid time in force

ORDER_ERROR_GFN_ORDER_DURING_AN_AUCTION 24

A GFN order has got to the market when it is in auction mode

ORDER_ERROR_GFA_ORDER_DURING_CONTINUOUS_TRADING 25

A GFA order has got to the market when it is in continuous trading mode

ORDER_ERROR_CANNOT_AMEND_TO_GTT_WITHOUT_EXPIRYAT 26

Attempt to amend order to GTT without ExpiryAt

ORDER_ERROR_EXPIRYAT_BEFORE_CREATEDAT 27

Attempt to amend ExpiryAt to a value before CreatedAt

ORDER_ERROR_CANNOT_HAVE_GTC_AND_EXPIRYAT 28

Attempt to amend to GTC without an ExpiryAt value

ORDER_ERROR_CANNOT_AMEND_TO_FOK_OR_IOC 29

Amending to FOK or IOC is invalid

ORDER_ERROR_CANNOT_AMEND_TO_GFA_OR_GFN 30

Amending to GFA or GFN is invalid

ORDER_ERROR_CANNOT_AMEND_FROM_GFA_OR_GFN 31

Amending from GFA or GFN is invalid

ORDER_ERROR_CANNOT_SEND_IOC_ORDER_DURING_AUCTION 32

IOC orders are not allowed during auction

ORDER_ERROR_CANNOT_SEND_FOK_ORDER_DURING_AUCTION 33

FOK orders are not allowed during auction

ORDER_ERROR_MUST_BE_LIMIT_ORDER 34

Pegged orders must be LIMIT orders

ORDER_ERROR_MUST_BE_GTT_OR_GTC 35

Pegged orders can only have TIF GTC or GTT

ORDER_ERROR_WITHOUT_REFERENCE_PRICE 36

Pegged order must have a reference price

ORDER_ERROR_BUY_CANNOT_REFERENCE_BEST_ASK_PRICE 37

Buy pegged order cannot reference best ask price

ORDER_ERROR_OFFSET_MUST_BE_LESS_OR_EQUAL_TO_ZERO 38

Pegged order offset must be <= 0

ORDER_ERROR_OFFSET_MUST_BE_LESS_THAN_ZERO 39

Pegged order offset must be < 0

ORDER_ERROR_OFFSET_MUST_BE_GREATER_OR_EQUAL_TO_ZERO 40

Pegged order offset must be >= 0

ORDER_ERROR_SELL_CANNOT_REFERENCE_BEST_BID_PRICE 41

Sell pegged order cannot reference best bid price

ORDER_ERROR_OFFSET_MUST_BE_GREATER_THAN_ZERO 42

Pegged order offset must be > zero

ORDER_ERROR_INSUFFICIENT_ASSET_BALANCE 43

The party 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_ORDER 44

Cannot amend a non pegged orders details

ORDER_ERROR_UNABLE_TO_REPRICE_PEGGED_ORDER 45

We are unable to re-price a pegged order because a market price is unavailable

ORDER_ERROR_UNABLE_TO_AMEND_PRICE_ON_PEGGED_ORDER 46

It is not possible to amend the price of an existing pegged order

ORDER_ERROR_NON_PERSISTENT_ORDER_OUT_OF_PRICE_BOUNDS 47

An FOK, IOC, or GFN order was rejected because it resulted in trades outside the price bounds

PeggedReference

A 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_UNSPECIFIED 0

Default value for PeggedReference, no reference given

PEGGED_REFERENCE_MID 1

Mid price reference

PEGGED_REFERENCE_BEST_BID 2

Best bid price reference

PEGGED_REFERENCE_BEST_ASK 3

Best ask price reference

Side

A side relates to the direction of an order, to Buy, or Sell

NameNumberDescription
SIDE_UNSPECIFIED 0

Default value, always invalid

SIDE_BUY 1

Buy order

SIDE_SELL 2

Sell order

Trade.Type

Type values for a trade

NameNumberDescription
TYPE_UNSPECIFIED 0

Default value, always invalid

TYPE_DEFAULT 1

Normal trading between two parties

TYPE_NETWORK_CLOSE_OUT_GOOD 2

Trading 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_BAD 3

Trading 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_UNSPECIFIED 0

Default value, always invalid

TRANSFER_TYPE_LOSS 1

Loss

TRANSFER_TYPE_WIN 2

Win

TRANSFER_TYPE_CLOSE 3

Close

TRANSFER_TYPE_MTM_LOSS 4

Mark to market loss

TRANSFER_TYPE_MTM_WIN 5

Mark to market win

TRANSFER_TYPE_MARGIN_LOW 6

Margin too low

TRANSFER_TYPE_MARGIN_HIGH 7

Margin too high

TRANSFER_TYPE_MARGIN_CONFISCATED 8

Margin was confiscated

TRANSFER_TYPE_MAKER_FEE_PAY 9

Pay maker fee

TRANSFER_TYPE_MAKER_FEE_RECEIVE 10

Receive maker fee

TRANSFER_TYPE_INFRASTRUCTURE_FEE_PAY 11

Pay infrastructure fee

TRANSFER_TYPE_INFRASTRUCTURE_FEE_DISTRIBUTE 12

Receive infrastructure fee

TRANSFER_TYPE_LIQUIDITY_FEE_PAY 13

Pay liquidity fee

TRANSFER_TYPE_LIQUIDITY_FEE_DISTRIBUTE 14

Receive liquidity fee

TRANSFER_TYPE_BOND_LOW 15

Bond too low

TRANSFER_TYPE_BOND_HIGH 16

Bond too high

TRANSFER_TYPE_WITHDRAW_LOCK 17

Lock amount for withdraw

TRANSFER_TYPE_WITHDRAW 18

Actual withdraw from system

TRANSFER_TYPE_DEPOSIT 19

Deposit funds

TRANSFER_TYPE_BOND_SLASHING 20

Bond slashing

TRANSFER_TYPE_STAKE_REWARD 21

Stake reward

Withdrawal.Status

The status of the withdrawal

NameNumberDescription
STATUS_UNSPECIFIED 0

Default value, always invalid

STATUS_OPEN 1

The withdrawal is open and being processed by the network

STATUS_CANCELLED 2

The withdrawal have been cancelled

STATUS_FINALIZED 3

The withdrawal 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

vega/governance.proto

Top

FutureProduct

Future product configuration

FieldTypeLabelDescription
maturity string

Future product maturity (ISO8601/RFC3339 timestamp)

settlement_asset string

Product settlement asset identifier

quote_name string

Product quote name

oracle_spec_for_settlement_price oracles.v1.OracleSpecConfiguration

The oracle spec describing the oracle data of settlement price

oracle_spec_for_trading_termination oracles.v1.OracleSpecConfiguration

The oracle spec describing the oracle data of trading termination

oracle_spec_binding OracleSpecToFutureBinding

The binding between the oracle spec and the settlement price

Validated Fields

Field Validations
maturity
  • string_not_empty: true
settlement_asset
  • string_not_empty: true
quote_name
  • string_not_empty: true

GovernanceData

Governance data

FieldTypeLabelDescription
proposal Proposal

The governance proposal

yes Vote repeated

All "yes" votes in favour of the proposal above

no Vote repeated

All "no" votes against the proposal above

yes_party GovernanceData.YesPartyEntry repeated

All latest YES votes by party (guaranteed to be unique), where key (string) is the party ID (public key) and value (Vote) is the vote cast by the given party

no_party GovernanceData.NoPartyEntry repeated

All latest NO votes by party (guaranteed to be unique), where key (string) is the party ID (public key) and value (Vote) is the vote cast by the given party

GovernanceData.NoPartyEntry

FieldTypeLabelDescription
key string

value Vote

GovernanceData.YesPartyEntry

FieldTypeLabelDescription
key string

value Vote

InstrumentConfiguration

Instrument configuration

FieldTypeLabelDescription
name string

Instrument name

code string

Instrument code

future FutureProduct

Future

Validated Fields

Field Validations
name
  • string_not_empty: true
code
  • string_not_empty: true

NewAsset

New asset on Vega

FieldTypeLabelDescription
changes AssetDetails

The configuration of the new asset

Validated Fields

Field Validations
changes
  • msg_exists: true

NewMarket

New market on Vega

FieldTypeLabelDescription
changes NewMarketConfiguration

The configuration of the new market

liquidity_commitment NewMarketCommitment

The commitment from the party creating the NewMarket proposal

Validated Fields

Field Validations
changes
  • msg_exists: true

NewMarketCommitment

A commitment of liquidity to be made by the party which proposes a market

FieldTypeLabelDescription
commitment_amount string

Specified as a unitless number that represents the amount of settlement asset of the market

fee string

Nominated liquidity fee factor, which is an input to the calculation of taker fees on the market, as per seeting fees and rewarding liquidity providers

sells LiquidityOrder repeated

A set of liquidity sell orders to meet the liquidity provision obligation

buys LiquidityOrder repeated

A set of liquidity buy orders to meet the liquidity provision obligation

reference string

A reference to be associated to all orders created from this commitment

NewMarketConfiguration

Configuration for a new market on Vega

FieldTypeLabelDescription
instrument InstrumentConfiguration

New market instrument configuration

decimal_places uint64

Decimal places used for the new market

metadata string repeated

Optional new market meta data, tags

price_monitoring_parameters PriceMonitoringParameters

Price monitoring parameters

liquidity_monitoring_parameters LiquidityMonitoringParameters

Liquidity monitoring parameters

simple SimpleModelParams

Simple risk model parameters, valid only if MODEL_SIMPLE is selected

log_normal LogNormalRiskModel

Log normal risk model parameters, valid only if MODEL_LOG_NORMAL is selected

continuous ContinuousTrading

Continuous trading

discrete DiscreteTrading

Discrete trading

Validated Fields

Field Validations
instrument
  • msg_exists: true
decimal_places
  • int_lt: 150

Proposal

Governance proposal

FieldTypeLabelDescription
id string

Unique proposal identifier

reference string

Proposal reference

party_id string

Party identifier of the author (the party submitting the proposal)

state Proposal.State

Proposal state - See (Proposal.State)[#vega.Proposal.State] definition

timestamp int64

Proposal timestamp for date and time (in nanoseconds) when proposal was submitted to the network

terms ProposalTerms

Proposal configuration and the actual change that is meant to be executed when proposal is enacted

reason ProposalError

A reason for the current state of the proposal, this may be set in case of REJECTED and FAILED statuses

error_details string

The detailed error associated to the reason.

Validated Fields

Field Validations
party_id
  • string_not_empty: true
state
terms
  • msg_exists: true

ProposalTerms

Terms for a governance proposal on Vega

FieldTypeLabelDescription
closing_timestamp int64

Timestamp (Unix time in seconds) when voting closes for this proposal, constrained by `minCloseInSeconds` and `maxCloseInSeconds` network parameters

enactment_timestamp int64

Timestamp (Unix time in seconds) when proposal gets enacted (if passed), constrained by `minEnactInSeconds` and `maxEnactInSeconds` network parameters

validation_timestamp int64

Validation timestamp (Unix time in seconds)

update_market UpdateMarket

Proposal change for modifying an existing market on Vega

new_market NewMarket

Proposal change for creating new market on Vega

update_network_parameter UpdateNetworkParameter

Proposal change for updating Vega network parameters

new_asset NewAsset

Proposal change for creating new assets on Vega

Validated Fields

Field Validations
closing_timestamp
  • int_gt: 0
enactment_timestamp
  • int_gt: 0

UpdateMarket

Update an existing market on Vega

UpdateNetworkParameter

Update network configuration on Vega

FieldTypeLabelDescription
changes NetworkParameter

The network parameter to update

Validated Fields

Field Validations
changes
  • msg_exists: true

Vote

Governance vote

FieldTypeLabelDescription
party_id string

Voter's party identifier

value Vote.Value

Actual vote

proposal_id string

Identifier of the proposal being voted on

timestamp int64

Vote timestamp for date and time (in nanoseconds) when vote was submitted to the network

total_governance_token_balance string

Total number of governance token for the party that casted the vote

total_governance_token_weight string

The weight of this vote based on the total of governance token

Validated Fields

Field Validations
party_id
  • string_not_empty: true
value
proposal_id
  • string_not_empty: true

Proposal.State

Proposal state transition:

Open ->

- Passed -> Enacted.

- Passed -> Failed.

- Declined

Rejected

Proposal can enter Failed state from any other state

NameNumberDescription
STATE_UNSPECIFIED 0

Default value, always invalid

STATE_FAILED 1

Proposal enactment has failed - even though proposal has passed, its execution could not be performed

STATE_OPEN 2

Proposal is open for voting

STATE_PASSED 3

Proposal has gained enough support to be executed

STATE_REJECTED 4

Proposal wasn't accepted (proposal terms failed validation due to wrong configuration or failing to meet network requirements)

STATE_DECLINED 5

Proposal didn't get enough votes (either failing to gain required participation or majority level)

STATE_ENACTED 6

Proposal enacted

STATE_WAITING_FOR_NODE_VOTE 7

Waiting for node validation of the proposal

ProposalError

A list of possible errors that can cause a proposal to be in state rejected or failed

NameNumberDescription
PROPOSAL_ERROR_UNSPECIFIED 0

Default value

PROPOSAL_ERROR_CLOSE_TIME_TOO_SOON 1

The specified close time is too early base on network parameters

PROPOSAL_ERROR_CLOSE_TIME_TOO_LATE 2

The specified close time is too late based on network parameters

PROPOSAL_ERROR_ENACT_TIME_TOO_SOON 3

The specified enact time is too early based on network parameters

PROPOSAL_ERROR_ENACT_TIME_TOO_LATE 4

The specified enact time is too late based on network parameters

PROPOSAL_ERROR_INSUFFICIENT_TOKENS 5

The proposer for this proposal as insufficient tokens

PROPOSAL_ERROR_INVALID_INSTRUMENT_SECURITY 6

The instrument quote name and base name were the same

PROPOSAL_ERROR_NO_PRODUCT 7

The proposal has no product

PROPOSAL_ERROR_UNSUPPORTED_PRODUCT 8

The specified product is not supported

PROPOSAL_ERROR_INVALID_FUTURE_PRODUCT_TIMESTAMP 9

Invalid future maturity timestamp (expect RFC3339)

PROPOSAL_ERROR_PRODUCT_MATURITY_IS_PASSED 10

The product maturity is past

PROPOSAL_ERROR_NO_TRADING_MODE 11

The proposal has no trading mode

PROPOSAL_ERROR_UNSUPPORTED_TRADING_MODE 12

The proposal has an unsupported trading mode

PROPOSAL_ERROR_NODE_VALIDATION_FAILED 13

The proposal failed node validation

PROPOSAL_ERROR_MISSING_BUILTIN_ASSET_FIELD 14

A field is missing in a builtin asset source

PROPOSAL_ERROR_MISSING_ERC20_CONTRACT_ADDRESS 15

The contract address is missing in the ERC20 asset source

PROPOSAL_ERROR_INVALID_ASSET 16

The asset identifier is invalid or does not exist on the Vega network

PROPOSAL_ERROR_INCOMPATIBLE_TIMESTAMPS 17

Proposal terms timestamps are not compatible (Validation < Closing < Enactment)

PROPOSAL_ERROR_NO_RISK_PARAMETERS 18

No risk parameters were specified

PROPOSAL_ERROR_NETWORK_PARAMETER_INVALID_KEY 19

Invalid key in update network parameter proposal

PROPOSAL_ERROR_NETWORK_PARAMETER_INVALID_VALUE 20

Invalid valid in update network parameter proposal

PROPOSAL_ERROR_NETWORK_PARAMETER_VALIDATION_FAILED 21

Validation failed for network parameter proposal

PROPOSAL_ERROR_OPENING_AUCTION_DURATION_TOO_SMALL 22

Opening auction duration is less than the network minimum opening auction time

PROPOSAL_ERROR_OPENING_AUCTION_DURATION_TOO_LARGE 23

Opening auction duration is more than the network minimum opening auction time

PROPOSAL_ERROR_MARKET_MISSING_LIQUIDITY_COMMITMENT 24

Market proposal is missing a liquidity commitment

PROPOSAL_ERROR_COULD_NOT_INSTANTIATE_MARKET 25

Market proposal market could not be instantiate in execution

PROPOSAL_ERROR_INVALID_FUTURE_PRODUCT 26

Market proposal market contained invalid product definition

PROPOSAL_ERROR_MISSING_COMMITMENT_AMOUNT 27

Market proposal is missing commitment amount

PROPOSAL_ERROR_INVALID_FEE_AMOUNT 28

Market proposal have invalid fee

PROPOSAL_ERROR_INVALID_SHAPE 29

Market proposal have invalid shape

PROPOSAL_ERROR_INVALID_RISK_PARAMETER 30

Market proposal invalid risk parameter

PROPOSAL_ERROR_MAJORITY_THRESHOLD_NOT_REACHED 31

Proposal was declined because vote didn't reach the majority thershold required

PROPOSAL_ERROR_PARTICIPATION_THRESHOLD_NOT_REACHED 32

Proposal declined because the participation threshold was not reached

PROPOSAL_ERROR_INVALID_ASSET_DETAILS 33

Asset proposal invalid asset details

Vote.Value

Vote value

NameNumberDescription
VALUE_UNSPECIFIED 0

Default value, always invalid

VALUE_NO 1

A vote against the proposal

VALUE_YES 2

A vote in favour of the proposal

vega/oracles/v1/data.proto

Top

OracleData

OracleData describes an oracle data that has been broadcast.

FieldTypeLabelDescription
pub_keys string repeated

pubKeys is the list of authorized public keys that signed the data for this oracle. All the public keys in the oracle data should be contained in these public keys.

data Property repeated

data holds all the properties of the oracle data

matched_spec_ids string repeated

matched_specs_ids lists all the oracle specs that matched this oracle data.

broadcast_at int64

broadcast_at is the time at which the data was broadcast for the first time.

Property

Property describes one property of an oracle spec with a key with its value.

FieldTypeLabelDescription
name string

name is the name of the property.

value string

value is the value of the property.

vega/commands/v1/commands.proto

Top

DelegateSubmission

A command to submit an instruction to delegate some stake to a node

FieldTypeLabelDescription
node_id string

The ID for the node to delegate to

amount string

The amount of stake to delegate

Validated Fields

Field Validations
node_id
  • string_not_empty: true

LiquidityProvisionSubmission

A liquidity provision submitted for a given market

FieldTypeLabelDescription
market_id string

Market identifier for the order, required field

commitment_amount string

Specified as a unitless number that represents the amount of settlement asset of the market

fee string

Nominated liquidity fee factor, which is an input to the calculation of taker fees on the market, as per seeting fees and rewarding liquidity providers

sells vega.LiquidityOrder repeated

A set of liquidity sell orders to meet the liquidity provision obligation

buys vega.LiquidityOrder repeated

A set of liquidity buy orders to meet the liquidity provision obligation

reference string

A reference to be added to every order created out of this liquidityProvisionSubmission

Validated Fields

Field Validations
market_id
  • string_not_empty: true

OrderAmendment

An order amendment is a request to amend or update an existing order on Vega

FieldTypeLabelDescription
order_id string

Order identifier, this is required to find the order and will not be updated, required field

market_id string

Market identifier, this is required to find the order and will not be updated

price vega.Price

Amend the price for the order, if the Price value is set, otherwise price will remain unchanged - See [`Price`](#vega.Price)

size_delta int64

Amend the size for the order by the delta specified: - To reduce the size from the current value set a negative integer value - To increase the size from the current value, set a positive integer value - To leave the size unchanged set a value of zero

expires_at vega.Timestamp

Amend the expiry time for the order, if the Timestamp value is set, otherwise expiry time will remain unchanged - See [`VegaTimeResponse`](#api.VegaTimeResponse).`timestamp`

time_in_force vega.Order.TimeInForce

Amend the time in force for the order, set to TIME_IN_FORCE_UNSPECIFIED to remain unchanged - See [`TimeInForce`](#api.VegaTimeResponse).`timestamp`

pegged_offset google.protobuf.Int64Value

Amend the pegged order offset for the order

pegged_reference vega.PeggedReference

Amend the pegged order reference for the order - See [`PeggedReference`](#vega.PeggedReference)

Validated Fields

Field Validations
order_id
  • string_not_empty: true

OrderCancellation

An order cancellation is a request to cancel an existing order on Vega

FieldTypeLabelDescription
order_id string

Unique identifier for the order (set by the system after consensus), required field

market_id string

Market identifier for the order, required field

OrderSubmission

An order submission is a request to submit or create a new order on Vega

FieldTypeLabelDescription
market_id string

Market identifier for the order, required field

price string

Price 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, , required field for limit orders, however it is not required for market orders

size uint64

Size for the order, for example, in a futures market the size equals the number of contracts, cannot be negative

side vega.Side

Side for the order, e.g. SIDE_BUY or SIDE_SELL, required field - See [`Side`](#vega.Side)

time_in_force vega.Order.TimeInForce

Time in force indicates how long an order will remain active before it is executed or expires, required field - See [`Order.TimeInForce`](#vega.Order.TimeInForce)

expires_at int64

Timestamp for when the order will expire, in nanoseconds since the epoch, required field only for [`Order.TimeInForce`](#vega.Order.TimeInForce)`.TIME_IN_FORCE_GTT` - See [`VegaTimeResponse`](#api.VegaTimeResponse).`timestamp`

type vega.Order.Type

Type for the order, required field - See [`Order.Type`](#vega.Order.Type)

reference string

Reference 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 identifier for the order submission

pegged_order vega.PeggedOrder

Used to specify the details for a pegged order - See [`PeggedOrder`](#vega.PeggedOrder)

Validated Fields

Field Validations
market_id
  • string_not_empty: true
size
  • int_gt: 0

ProposalSubmission

A command to submit a new proposal for the

vega network governance

FieldTypeLabelDescription
reference string

Proposal reference

terms vega.ProposalTerms

Proposal configuration and the actual change that is meant to be executed when proposal is enacted

Validated Fields

Field Validations
terms
  • msg_exists: true

RestoreSnapshot

A command that loads the state from a given checkpoint

FieldTypeLabelDescription
data bytes

UndelegateSubmission

FieldTypeLabelDescription
node_id string

amount string

optional, if not specified = ALL

method UndelegateSubmission.Method

Validated Fields

Field Validations
node_id
  • string_not_empty: true

VoteSubmission

A command to submit a new vote for a governance

proposal.

FieldTypeLabelDescription
proposal_id string

The ID of the proposal to vote for.

value vega.Vote.Value

The actual value of the vote

Validated Fields

Field Validations
proposal_id
  • string_not_empty: true

WithdrawSubmission

Represents the submission request to withdraw funds for a party on Vega

FieldTypeLabelDescription
amount string

The amount to be withdrawn

asset string

The asset we want to withdraw

ext vega.WithdrawExt

Foreign chain specifics

UndelegateSubmission.Method

NameNumberDescription
METHOD_UNSPECIFIED 0

METHOD_NOW 1

METHOD_AT_END_OF_EPOCH 2

METHOD_IN_ANGER 3

vega/chain_events.proto

Top

AddValidator

A message to notify when a new validator is being added to the Vega network

FieldTypeLabelDescription
id Identifier

The identifier of the validator

BTCDeposit

A Bitcoin deposit into Vega

FieldTypeLabelDescription
vega_asset_id string

The Vega network internal identifier of the asset

source_btc_address string

The BTC wallet initiating the deposit

target_party_id string

The Vega party identifier (pub-key) which is the target of the deposit

BTCEvent

An event from the Bitcoin network

FieldTypeLabelDescription
index uint64

The index of the transaction

block uint64

The block in which the transaction happened

deposit BTCDeposit

Deposit BTC asset

withdrawal BTCWithdrawal

Withdraw BTC asset

BTCWithdrawal

A Bitcoin withdrawal from Vega

FieldTypeLabelDescription
vega_asset_id string

The vega network internal identifier of the asset

source_party_id string

The party identifier (pub-key) initiating the withdrawal

target_btc_address string

Target Bitcoin wallet address

reference_nonce string

The nonce reference of the transaction

BitcoinAddress

Used as a wrapper for a Bitcoin address (wallet)

FieldTypeLabelDescription
address string

A Bitcoin address

BuiltinAssetDeposit

A deposit for a Vega built-in asset

FieldTypeLabelDescription
vega_asset_id string

A Vega network internal asset identifier

party_id string

A Vega party identifier (pub-key)

amount string

The amount to be deposited

BuiltinAssetEvent

An event related to a Vega built-in asset

FieldTypeLabelDescription
deposit BuiltinAssetDeposit

Built-in asset deposit

withdrawal BuiltinAssetWithdrawal

Built-in asset withdrawal

BuiltinAssetWithdrawal

A withdrawal for a Vega built-in asset

FieldTypeLabelDescription
vega_asset_id string

A Vega network internal asset identifier

party_id string

A Vega network party identifier (pub-key)

amount string

The amount to be withdrawn

ERC20AssetDelist

An asset deny-listing for an ERC20 token

FieldTypeLabelDescription
vega_asset_id string

The Vega network internal identifier of the asset

ERC20AssetList

An asset allow-listing for an ERC20 token

FieldTypeLabelDescription
vega_asset_id string

The Vega network internal identifier of the asset

ERC20Deposit

An asset deposit for an ERC20 token

FieldTypeLabelDescription
vega_asset_id string

The vega network internal identifier of the asset

source_ethereum_address string

The Ethereum wallet that initiated the deposit

target_party_id string

The Vega party identifier (pub-key) which is the target of the deposit

amount string

The amount to be deposited

ERC20Event

An event related to an ERC20 token

FieldTypeLabelDescription
index uint64

Index of the transaction

block uint64

The block in which the transaction was added

asset_list ERC20AssetList

List an ERC20 asset

asset_delist ERC20AssetDelist

De-list an ERC20 asset

deposit ERC20Deposit

Deposit ERC20 asset

withdrawal ERC20Withdrawal

Withdraw ERC20 asset

ERC20Withdrawal

An asset withdrawal for an ERC20 token

FieldTypeLabelDescription
vega_asset_id string

The Vega network internal identifier of the asset

target_ethereum_address string

The target Ethereum wallet address

reference_nonce string

The reference nonce used for the transaction

EthereumAddress

Used as a wrapper for an Ethereum address (wallet/contract)

FieldTypeLabelDescription
address string

An Ethereum address

Identifier

Used as a wrapper type on any possible network address supported by Vega

FieldTypeLabelDescription
ethereum_address EthereumAddress

Ethereum network

bitcoin_address BitcoinAddress

Bitcoin network

RemoveValidator

A message to notify when a validator is being removed from the Vega network

FieldTypeLabelDescription
id Identifier

The identifier of the validator

StakeDeposited

FieldTypeLabelDescription
ethereum_address string

Ethereum Address of the user depositing stake (hex encode with 0x prefix)

vega_public_key string

The public of the party receiving the stake deposit (hex encode)

amount string

The amount deposited (base 10)

block_time int64

The time at which the block was produced will be used to inform the core at what time the stake started to be available.

StakeRemoved

FieldTypeLabelDescription
ethereum_address string

Ethereum address of the user removing stake (hex encode with 0x prefix)

vega_public_key string

The public key of the party from which to remove stake (hex encode)

amount string

The amount removed (base 10)

block_time int64

The time at which the block was produced will be used to inform the core at what time the stake was made unavailable.

StakingEvent

FieldTypeLabelDescription
index uint64

Index of the transaction

block uint64

The block in which the transaction was added

stake_deposited StakeDeposited

stake_removed StakeRemoved

ValidatorEvent

An event related to validator management with foreign networks

FieldTypeLabelDescription
source_id string

The source identifier of the event

add AddValidator

Add a new validator

rm RemoveValidator

Remove an existing validator

vega/commands/v1/validator_commands.proto

Top

ChainEvent

An event forwarded to the Vega network to provide information on events happening on other networks

FieldTypeLabelDescription
tx_id string

The identifier of the transaction in which the events happened, usually a hash

nonce uint64

Arbitrary one-time integer used to prevent replay attacks

builtin vega.BuiltinAssetEvent

Built-in asset event

erc20 vega.ERC20Event

Ethereum ERC20 event

btc vega.BTCEvent

Bitcoin BTC event

validator vega.ValidatorEvent

Validator event

staking_event vega.StakingEvent

Ethereum Staking event

NodeRegistration

Used to Register a node as a validator during network start-up

FieldTypeLabelDescription
vega_pub_key string

Vega public key, required field

ethereum_address string

Ethereum public key, required field

chain_pub_key string

Public key for the blockchain, required field

info_url string

URL with more info on the node

country string

Country code (ISO 3166-1 alpha-2) for the location of the node

id string

ID of the validator, (public master key)

name string

Name of the validator

avatar_url string

AvatarURL of the validator

Validated Fields

Field Validations
vega_pub_key
  • string_not_empty: true
ethereum_address
  • string_not_empty: true
chain_pub_key
  • string_not_empty: true
info_url
  • string_not_empty: true
country
  • string_not_empty: true

NodeSignature

Represents a signature from a validator, to be used by a foreign chain in order to recognise a decision taken by the Vega network

FieldTypeLabelDescription
id string

The identifier of the resource being signed

sig bytes

The signature

kind NodeSignatureKind

The kind of resource being signed

NodeVote

Used when a node votes for validating a given resource exists or is valid,

for example, an ERC20 deposit is valid and exists on ethereum

FieldTypeLabelDescription
pub_key bytes

Public key, required field

reference string

Reference, required field

Validated Fields

Field Validations
pub_key
  • string_not_empty: true
reference
  • string_not_empty: true

NodeSignatureKind

The kind of the signature created by a node, for example, allow-listing a new asset, withdrawal etc

NameNumberDescription
NODE_SIGNATURE_KIND_UNSPECIFIED 0

Represents an unspecified or missing value from the input

NODE_SIGNATURE_KIND_ASSET_NEW 1

Represents a signature for a new asset allow-listing

NODE_SIGNATURE_KIND_ASSET_WITHDRAWAL 2

Represents a signature for an asset withdrawal

vega/events/v1/events.proto

Top

AuctionEvent

An auction event indicating a change in auction state, for example starting or ending an auction

FieldTypeLabelDescription
market_id string

Market identifier for the event

opening_auction bool

True if the event indicates an auction opening and False otherwise

leave bool

True if the event indicates leaving auction mode and False otherwise

start int64

Timestamp containing the start time for an auction

end int64

Timestamp containing the end time for an auction

trigger vega.AuctionTrigger

the reason this market is/was in auction

extension_trigger vega.AuctionTrigger

If an auction was ongoing, but was extended for whatever reason, this field will be set to the trigger type indicating which component extended the auction

BusEvent

A bus event is a container for event bus events emitted by Vega

FieldTypeLabelDescription
id string

A unique event identifier for the message

block string

The batch (or block) of transactions that the events relate to

type BusEventType

The type of bus event (one of the list below)

time_update TimeUpdate

Time update events - See [TimeUpdate](#vega.TimeUpdate)

transfer_responses TransferResponses

Transfer responses update events - See [TransferResponses](#vega.TransferResponses)

position_resolution PositionResolution

Position resolution events - See [PositionResolution](#vega.PositionResolution)

order vega.Order

Order events

account vega.Account

Account events

party vega.Party

Party events

trade vega.Trade

Trade events

margin_levels vega.MarginLevels

Margin level update events

proposal vega.Proposal

Proposal events (for governance)

vote vega.Vote

Vote events (for governance)

market_data vega.MarketData

Market data events

node_signature vega.commands.v1.NodeSignature

Node signature events

loss_socialization LossSocialization

Loss socialization events - See [LossSocialization](#vega.LossSocialization)

settle_position SettlePosition

Position settlement events - See [SettlePosition](#vega.SettlePosition)

settle_distressed SettleDistressed

Position distressed events - See [SettleDistressed](#vega.SettleDistressed)

market_created vega.Market

Market created events

asset vega.Asset

Asset events

market_tick MarketTick

Market tick events - See [MarketTick](#vega.MarketTick)

withdrawal vega.Withdrawal

Withdrawal events

deposit vega.Deposit

Deposit events

auction AuctionEvent

Auction events - See [AuctionEvent](#vega.AuctionEvent)

risk_factor vega.RiskFactor

Risk factor events

network_parameter vega.NetworkParameter

Network parameter events

liquidity_provision vega.LiquidityProvision

LiquidityProvision events

market_updated vega.Market

Market created events

oracle_spec oracles.v1.OracleSpec

OracleSpec events

oracle_data oracles.v1.OracleData

OracleData events

delegation_balance DelegationBalanceEvent

Delegation balance events

validator_score ValidatorScoreEvent

Validator score calculated

epoch_event EpochEvent

Epoch update events - See [Epoch](#vega.Epoch)

validator_update ValidatorUpdate

Validator update events

stake_linking StakeLinking

Staking event

reward_payout RewardPayoutEvent

Reward payout event

checkpoint CheckpointEvent

Checkpoint was created

market MarketEvent

Market tick events - See [MarketEvent](#vega.MarketEvent)

tx_err_event TxErrorEvent

Transaction error events, not included in the ALL event type

version uint32

Version of bus event

CheckpointEvent

FieldTypeLabelDescription
hash string

block_hash string

block_height uint64

DelegationBalanceEvent

DelegationBalanceEvent - updates on the delegation balance of a party to a node in the current epoch in effect

FieldTypeLabelDescription
party string

node_id string

amount string

epoch_seq string

EpochEvent

Epoch details

FieldTypeLabelDescription
seq uint64

Sequence number that increases by one each epoch

action vega.EpochAction

Action tells us what action is taking place

start_time int64

What time did this epoch start

expire_time int64

What time should this epoch end

end_time int64

What time did it actually end

LossSocialization

A loss socialization event contains details on the amount of wins unable to be distributed

FieldTypeLabelDescription
market_id string

Market identifier for the event

party_id string

Party identifier (public key) for the event

amount string

Amount distributed

MarketEvent

MarketEvent - the common denominator for all market events

interface has a method to return a string for logging

FieldTypeLabelDescription
market_id string

Market identifier for the event

payload string

Payload is a unique information string

MarketTick

A market ticket event contains the time value for when a particular market was last processed on Vega

FieldTypeLabelDescription
id string

Market identifier for the event

time int64

Timestamp containing latest update from Vega blockchain aka Vega-time

PositionResolution

A position resolution event contains information on distressed trades

FieldTypeLabelDescription
market_id string

Market identifier for the event

distressed int64

Number of distressed traders

closed int64

Number of close outs

mark_price string

Mark price as a string representing a scaled price

RewardPayoutEvent

FieldTypeLabelDescription
party string

epoch_seq string

asset string

amount string

percent_of_total_reward string

timestamp int64

SettleDistressed

A settle distressed event contains information on distressed trading parties who are closed out

FieldTypeLabelDescription
market_id string

Market identifier for the event

party_id string

Party identifier (public key) for the event

margin string

Margin value as an integer, for example `123456` is a correctly formatted price of `1.23456` assuming market configured to 5 decimal places

price string

Price as an integer, for example `123456` is a correctly formatted price of `1.23456` assuming market configured to 5 decimal places

SettlePosition

A settle position event contains position settlement information for a party

FieldTypeLabelDescription
market_id string

Market identifier for the event

party_id string

Party identifier (public key) for the event

price string

Price of settlement as a string

trade_settlements TradeSettlement repeated

A collection of 1 or more trade settlements

StakeLinking

StakeLinking - an event notifying of stake being deposited or removed for a given party

These events are emitted for every Staking deposit or removed accepted by the network

FieldTypeLabelDescription
id string

The internal ID for this staking event

type StakeLinking.Type

The type of event

ts int64

The timestamps at which the event was emitted by ethereum

party string

The party to whom the event is directed at.

amount string

The amount of stake deposited or removed

status StakeLinking.Status

The status of the event

finalized_at int64

The time at which the vega network finalized the state of the event

tx_hash string

The hash of the transaction from which the events happen

TimeUpdate

A time update event contains the latest time update from Vega blockchain

FieldTypeLabelDescription
timestamp int64

Timestamp containing latest update from Vega blockchain aka Vega-time

TradeSettlement

A trade settlement is part of the settle position event

FieldTypeLabelDescription
size int64

Size of trade settlement

price string

Price of settlement as string

TransferResponses

A transfer responses event contains a collection of transfer information

FieldTypeLabelDescription
responses vega.TransferResponse repeated

One or more entries containing internal transfer information

TxErrorEvent

FieldTypeLabelDescription
party_id string

Unique party identifier for the related party

err_msg string

An error message describing what went wrong

order_submission vega.commands.v1.OrderSubmission

order_amendment vega.commands.v1.OrderAmendment

order_cancellation vega.commands.v1.OrderCancellation

proposal vega.commands.v1.ProposalSubmission

vote_submission vega.commands.v1.VoteSubmission

liquidity_provision_submission vega.commands.v1.LiquidityProvisionSubmission

withdraw_submission vega.commands.v1.WithdrawSubmission

delegate_submission vega.commands.v1.DelegateSubmission

undelegate_submission vega.commands.v1.UndelegateSubmission

restore_snapshot vega.commands.v1.RestoreSnapshot

ValidatorScoreEvent

ValidatorScoreEvent is the score a validator gets for a given epoch

FieldTypeLabelDescription
node_id string

epoch_seq string

validator_score string

normalised_score string

ValidatorUpdate

A validator update event contains information about validator node

FieldTypeLabelDescription
node_id string

Node id of the node

vega_pub_key string

Vega public key of validator node

ethereum_address string

Ethereum public key of validator node

tm_pub_key string

Public key of Tendermint

info_url string

URL with more info on the node

country string

Country code (ISO 3166-1 alpha-2) for the location of the node

name string

Name of the validator

avatar_url string

AvatarURL of the validator

BusEventType

An (event) bus event type is used to specify a type of event

It has 2 styles of event:

Single values (e.g. BUS_EVENT_TYPE_ORDER) where they represent one data item

Group values (e.g. BUS_EVENT_TYPE_AUCTION) where they represent a group of data items

NameNumberDescription
BUS_EVENT_TYPE_UNSPECIFIED 0

Default value, always invalid

BUS_EVENT_TYPE_ALL 1

Events of ALL event types, used when filtering stream from event bus

BUS_EVENT_TYPE_TIME_UPDATE 2

Event for blockchain time updates

BUS_EVENT_TYPE_TRANSFER_RESPONSES 3

Event for when a transfer happens internally, contains the transfer information

BUS_EVENT_TYPE_POSITION_RESOLUTION 4

Event indicating position resolution has occurred

BUS_EVENT_TYPE_ORDER 5

Event for order updates, both new and existing orders

BUS_EVENT_TYPE_ACCOUNT 6

Event for account updates

BUS_EVENT_TYPE_PARTY 7

Event for party updates

BUS_EVENT_TYPE_TRADE 8

Event indicating a new trade has occurred

BUS_EVENT_TYPE_MARGIN_LEVELS 9

Event indicating margin levels have changed for a party

BUS_EVENT_TYPE_PROPOSAL 10

Event for proposal updates (for governance)

BUS_EVENT_TYPE_VOTE 11

Event indicating a new vote has occurred (for governance)

BUS_EVENT_TYPE_MARKET_DATA 12

Event for market data updates

BUS_EVENT_TYPE_NODE_SIGNATURE 13

Event for a new signature for a Vega node

BUS_EVENT_TYPE_LOSS_SOCIALIZATION 14

Event indicating loss socialisation occurred for a party

BUS_EVENT_TYPE_SETTLE_POSITION 15

Event for when a position is being settled

BUS_EVENT_TYPE_SETTLE_DISTRESSED 16

Event for when a position is distressed

BUS_EVENT_TYPE_MARKET_CREATED 17

Event indicating a new market was created

BUS_EVENT_TYPE_ASSET 18

Event for when an asset is added to Vega

BUS_EVENT_TYPE_MARKET_TICK 19

Event indicating a market tick event

BUS_EVENT_TYPE_WITHDRAWAL 20

Event for when a withdrawal occurs

BUS_EVENT_TYPE_DEPOSIT 21

Event for when a deposit occurs

BUS_EVENT_TYPE_AUCTION 22

Event indicating a change in auction state, for example starting or ending an auction

BUS_EVENT_TYPE_RISK_FACTOR 23

Event indicating a risk factor has been updated

BUS_EVENT_TYPE_NETWORK_PARAMETER 24

Event indicating a network parameter has been added or updated

BUS_EVENT_TYPE_LIQUIDITY_PROVISION 25

Event indicating a liquidity provision has been created or updated

BUS_EVENT_TYPE_MARKET_UPDATED 26

Event indicating a new market was created

BUS_EVENT_TYPE_ORACLE_SPEC 27

Event indicating an oracle spec has been created or updated

BUS_EVENT_TYPE_ORACLE_DATA 28

Event indicating that an oracle data has been broadcast

BUS_EVENT_TYPE_DELEGATION_BALANCE 29

Event indicating that an delegation balance of a party to a node for current epoch has changed

BUS_EVENT_TYPE_VALIDATOR_SCORE 30

Event indicating the validator score for the given epoch

BUS_EVENT_TYPE_EPOCH_UPDATE 31

Event indicating the start or end of an epoch

BUS_EVENT_TYPE_VALIDATOR_UPDATE 32

Event indicating that validator node has been updated

BUS_EVENT_TYPE_STAKE_LINKING 33

Event indicating a new staking event have been processed by the network

BUS_EVENT_TYPE_REWARD_PAYOUT_EVENT 34

Event indicating the payout of a reward has been initiated

BUS_EVENT_TYPE_CHECKPOINT 35

Event indicating a new checkpoint was created

BUS_EVENT_TYPE_MARKET 101

Event indicating a market related event, for example when a market opens

BUS_EVENT_TYPE_TX_ERROR 201

Event used to report failed transactions back to a user, this is excluded from the ALL type

StakeLinking.Status

NameNumberDescription
STATUS_UNSPECIFIED 0

Default value

STATUS_PENDING 1

Indicate an event waiting for confirmation from the vega network

STATUS_ACCEPTED 2

Indicate of an event accepted by the vega network

STATUS_REJECTED 3

Indaicate of an event rejected by the vega network

StakeLinking.Type

NameNumberDescription
TYPE_UNSPECIFIED 0

Default value

TYPE_LINK 1

Indicate of a stake deposit instruction

TYPE_UNLINK 2

Indicate of a stake remove instruction

vega/commands/v1/oracles.proto

Top

OracleDataSubmission

Command to submit new Oracle data from third party providers

FieldTypeLabelDescription
source OracleDataSubmission.OracleSource

The source from which the data is coming from

payload bytes

The data provided by the third party provider

OracleDataSubmission.OracleSource

The supported Oracle sources

NameNumberDescription
ORACLE_SOURCE_UNSPECIFIED 0

The default value

ORACLE_SOURCE_OPEN_ORACLE 1

Support for Open Oracle standard

ORACLE_SOURCE_JSON 2

Support for custom JSON data

vega/commands/v1/transaction.proto

Top

InputData

FieldTypeLabelDescription
nonce uint64

A random number used to provided uniqueness and prevents against replay attack.

block_height uint64

The block height associated to the transaction. This should always be current height of the node at the time of sending the Tx. BlockHeight is used as a mechanism for replay protection.

order_submission OrderSubmission

User commands

order_cancellation OrderCancellation

order_amendment OrderAmendment

withdraw_submission WithdrawSubmission

proposal_submission ProposalSubmission

vote_submission VoteSubmission

liquidity_provision_submission LiquidityProvisionSubmission

delegate_submission DelegateSubmission

undelegate_submission UndelegateSubmission

node_registration NodeRegistration

Validator commands

node_vote NodeVote

node_signature NodeSignature

chain_event ChainEvent

oracle_data_submission OracleDataSubmission

Oracles

restore_snapshot_submission RestoreSnapshot

Checkpoints

Signature

A signature to be authenticate a transaction and to be verified by the vega

network.

FieldTypeLabelDescription
value string

The bytes of the signature (hex-encoded).

algo string

The algorithm used to create the signature.

version uint32

The version of the signature used to create the signature.

Transaction

Represents a transaction to be sent to Vega.

FieldTypeLabelDescription
input_data bytes

One of the set of Vega commands (proto marshalled).

signature Signature

The signature of the inputData.

address string

The address of the sender (hex-encoded). Not supported yet.

pub_key string

The public key of the sender (hex-encoded).

version uint32

A version of the transaction, to be used in the future in case we want to implement changes to the Transaction format.

data-node/api/v1/trading_data.proto

Top

AccountsSubscribeRequest

Request to subscribe to a stream of (Accounts)[#vega.Account]

FieldTypeLabelDescription
market_id string

Market identifier

party_id string

Party identifier

asset string

Asset identifier

type vega.AccountType

Account type to subscribe to, required field

AccountsSubscribeResponse

FieldTypeLabelDescription
account vega.Account

AssetByIDRequest

Request for an asset given an asset identifier

FieldTypeLabelDescription
id string

Asset identifier, required field

Validated Fields

Field Validations
id
  • string_not_empty: true

AssetByIDResponse

Response for an asset given an asset identifier

FieldTypeLabelDescription
asset vega.Asset

An asset record, if found

AssetsRequest

Request for a list of all assets enabled on Vega

AssetsResponse

Response for a list of all assets enabled on Vega

FieldTypeLabelDescription
assets vega.Asset repeated

A list of 0 or more assets

CandlesRequest

Request for a list of candles for a market at an interval

FieldTypeLabelDescription
market_id string

Market identifier, required field.

since_timestamp int64

Timestamp to retrieve candles since, in nanoseconds since the epoch, required field - See [`VegaTimeResponse`](#api.VegaTimeResponse).`timestamp`

interval vega.Interval

Time interval for the candles, required field

Validated Fields

Field Validations
market_id
  • string_not_empty: true
since_timestamp
  • int_gt: 0

CandlesResponse

Response for a list of candles for a market at an interval

FieldTypeLabelDescription
candles vega.Candle repeated

A list of 0 or more candles

CandlesSubscribeRequest

Request to subscribe to a stream of (Candles)[#vega.Candle]

FieldTypeLabelDescription
market_id string

Market identifier, required field

interval vega.Interval

Time interval for the candles, required field.

Validated Fields

Field Validations
market_id
  • string_not_empty: true

CandlesSubscribeResponse

FieldTypeLabelDescription
candle vega.Candle

Checkpoint

The actual data regarding a checkpoint

FieldTypeLabelDescription
hash string

block_hash string

at_block uint64

CheckpointsRequest

Request to get all checkpoints. Currently no fields, probably will be expanded to allow filtering data

CheckpointsResponse

Response message containing all checkpoints requested

FieldTypeLabelDescription
checkpoints Checkpoint repeated

DelegationsRequest

both fields optional but 1 of them required at least

party = all delegation for a party

node_id = all delegation for a node

party_id + node_id = all delegation for a node for a given party

FieldTypeLabelDescription
party string

node_id string

epoch_seq string

DelegationsResponse

FieldTypeLabelDescription
delegations vega.Delegation repeated

DepositRequest

A request to get a specific deposit by identifier

FieldTypeLabelDescription
id string

The identifier of the deposit

Validated Fields

Field Validations
id
  • string_not_empty: true

DepositResponse

A response for a deposit

FieldTypeLabelDescription
deposit vega.Deposit

The deposit matching the identifier from the request

DepositsRequest

A request to get a list of deposit from a given party

FieldTypeLabelDescription
party_id string

The party to get the deposits for

Validated Fields

Field Validations
party_id
  • string_not_empty: true

DepositsResponse

The response for a list of deposits

FieldTypeLabelDescription
deposits vega.Deposit repeated

The list of deposits for the specified party

ERC20WithdrawalApprovalRequest

The request to get all information required to bundle the call to finalise the withdrawal on the erc20 bridge

FieldTypeLabelDescription
withdrawal_id string

The identifier of the withdrawal

Validated Fields

Field Validations
withdrawal_id
  • string_not_empty: true

ERC20WithdrawalApprovalResponse

The response with all information required to bundle the call to finalise the withdrawal on the erc20 bridge

function withdraw_asset(address asset_source, uint256 asset_id, uint256 amount, uint256 expiry, uint256 nonce, bytes memory signatures)

FieldTypeLabelDescription
asset_source string

The address of asset on ethereum

amount string

The amount to be withdrawn

expiry int64

The expiry / until what time the request is valid

nonce string

The nonce, which is actually the internal reference for the withdrawal

signatures string

The signatures bundle as hex encoded data, forward by 0x e.g: 0x + sig1 + sig2 + ... + sixN

target_address string

The ethereum address to withdraw the funds to, 0x prefixed

EstimateFeeRequest

Request to fetch the estimated fee if an order were to trade immediately

FieldTypeLabelDescription
order vega.Order

Order to estimate fees for the following fields in the order are required: MarketID (used to specify the fee factors) Price (the price at which the order could trade) Size (the size at which the order could eventually trade)

EstimateFeeResponse

Response to a EstimateFeeRequest, containing the estimated fees for a given order

FieldTypeLabelDescription
fee vega.Fee

Summary of the estimated fees for this order if it were to trade now

EstimateMarginRequest

Request to fetch the estimated MarginLevels if an order were to trade immediately

FieldTypeLabelDescription
order vega.Order

Order to estimate fees for

EstimateMarginResponse

Response to a EstimateMarginRequest, containing the estimated marginLevels for a given order

FieldTypeLabelDescription
margin_levels vega.MarginLevels

Summary of the estimated margins for this order if it were to trade now

FeeInfrastructureAccountsRequest

Request for a list of infrastructure fee accounts

FieldTypeLabelDescription
asset string

Asset identifier, required field - Set to an empty string to return all accounts - Set to an asset ID to return a single infrastructure fee account for a given asset

FeeInfrastructureAccountsResponse

Response for a list of infrastructure fee accounts

FieldTypeLabelDescription
accounts vega.Account repeated

A list of 0 or more infrastructure fee accounts

GetEpochRequest

FieldTypeLabelDescription
id uint64

Optional - if id omitted it gets the current epoch

GetEpochResponse

FieldTypeLabelDescription
epoch vega.Epoch

GetNetworkParametersProposalsRequest

Request for a list of network parameter proposals

FieldTypeLabelDescription
select_in_state OptionalProposalState

Optional proposal state

GetNetworkParametersProposalsResponse

Response for a list of network parameter proposals

FieldTypeLabelDescription
data vega.GovernanceData repeated

A list of 0 or more governance data

GetNewAssetProposalsRequest

Request for a list of new asset proposals

FieldTypeLabelDescription
select_in_state OptionalProposalState

Optional proposal state

GetNewAssetProposalsResponse

Response for a list of new asset proposals

FieldTypeLabelDescription
data vega.GovernanceData repeated

A list of 0 or more governance data

GetNewMarketProposalsRequest

Request for a list of new market proposals

FieldTypeLabelDescription
select_in_state OptionalProposalState

Optional proposal state

GetNewMarketProposalsResponse

Response for a list of new market proposals

FieldTypeLabelDescription
data vega.GovernanceData repeated

A list of 0 or more governance data

GetNodeByIDRequest

Request to list all nodes

FieldTypeLabelDescription
id string

Required id of node

GetNodeByIDResponse

Response with all nodes

FieldTypeLabelDescription
node vega.Node

GetNodeDataRequest

Request for current Node data

GetNodeDataResponse

Response with node data

FieldTypeLabelDescription
node_data vega.NodeData

GetNodeSignaturesAggregateRequest

Request to specify the identifier of the resource we want to retrieve aggregated signatures for

FieldTypeLabelDescription
id string

Resource identifier, required field

Validated Fields

Field Validations
id
  • string_not_empty: true

GetNodeSignaturesAggregateResponse

Response to specify the identifier of the resource we want to retrieve aggregated signatures for

FieldTypeLabelDescription
signatures vega.commands.v1.NodeSignature repeated

A list of 0 or more signatures

GetNodesRequest

Request to list all nodes

GetNodesResponse

Response with all nodes

FieldTypeLabelDescription
nodes vega.Node repeated

GetProposalByIDRequest

Request for a governance proposal given a proposal identifier

FieldTypeLabelDescription
proposal_id string

Proposal identifier, required field

Validated Fields

Field Validations
proposal_id
  • string_not_empty: true

GetProposalByIDResponse

Response for a governance proposal given a proposal identifier

FieldTypeLabelDescription
data vega.GovernanceData

Governance data, if found

GetProposalByReferenceRequest

Request for a governance proposal given a proposal reference

FieldTypeLabelDescription
reference string

Proposal reference. Required field

Validated Fields

Field Validations
reference
  • string_not_empty: true

GetProposalByReferenceResponse

Response for a governance proposal given a proposal reference

FieldTypeLabelDescription
data vega.GovernanceData

Governance data, if found

GetProposalsByPartyRequest

Request for a list of proposals for a party

FieldTypeLabelDescription
party_id string

Party identifier, required field

select_in_state OptionalProposalState

Optional proposal state

Validated Fields

Field Validations
party_id
  • string_not_empty: true

GetProposalsByPartyResponse

Response for a list of proposals for a party

FieldTypeLabelDescription
data vega.GovernanceData repeated

A list of 0 or more governance data

GetProposalsRequest

Request for a list of proposals

FieldTypeLabelDescription
select_in_state OptionalProposalState

Optional proposal state

GetProposalsResponse

Response for a list of proposals

FieldTypeLabelDescription
data vega.GovernanceData repeated

A list of 0 or more governance data

GetRewardDetailsRequest

A request to get reward details for a party

FieldTypeLabelDescription
party_id string

Validated Fields

Field Validations
party_id
  • string_not_empty: true

GetRewardDetailsResponse

The return message with reward details in for a single party

FieldTypeLabelDescription
reward_details vega.RewardPerAssetDetail repeated

GetUpdateMarketProposalsRequest

Request for a list of update market proposals

FieldTypeLabelDescription
market_id string

Market identifier, required field

select_in_state OptionalProposalState

Proposal state

Validated Fields

Field Validations
market_id
  • string_not_empty: true

GetUpdateMarketProposalsResponse

Response for a list of update market proposals

FieldTypeLabelDescription
data vega.GovernanceData repeated

A list of 0 or more governance data

GetVegaTimeRequest

Request for the current time of the vega network

GetVegaTimeResponse

Response for the current consensus coordinated time on the Vega network, referred to as "VegaTime"

FieldTypeLabelDescription
timestamp int64

Timestamp representation of current VegaTime as represented in Nanoseconds since the epoch, for example `1580473859111222333` corresponds to `2020-01-31T12:30:59.111222333Z`

GetVotesByPartyRequest

Request for a list of votes for a party

FieldTypeLabelDescription
party_id string

Party identifier, required field

Validated Fields

Field Validations
party_id
  • string_not_empty: true

GetVotesByPartyResponse

Response for a list of votes for a party

FieldTypeLabelDescription
votes vega.Vote repeated

A list of 0 or more votes

GlobalRewardPoolAccountsRequest

Request for a list of global reward pool accounts

FieldTypeLabelDescription
asset string

Asset identifier, required field - Set to an empty string to return all accounts - Set to an asset ID to return a single global reward pool account for a given asset

GlobalRewardPoolAccountsResponse

Response for a list of global reward pool accounts

FieldTypeLabelDescription
accounts vega.Account repeated

A list of 0 or more global reward pool accounts

LastTradeRequest

Request for the latest trade that occurred on Vega for a given market

FieldTypeLabelDescription
market_id string

Market identifier, required field

Validated Fields

Field Validations
market_id
  • string_not_empty: true

LastTradeResponse

Response for the latest trade that occurred on Vega for a given market

FieldTypeLabelDescription
trade vega.Trade

A trade, if found

LiquidityProvisionsRequest

A message requesting for the list of liquidity provision orders for markets

One of the two filters is required (or both)

FieldTypeLabelDescription
market string

The target market for the liquidity provision orders

party string

The party which submitted the liquidity provision orders

LiquidityProvisionsResponse

A response containing all of the Vega liquidity provision orders

FieldTypeLabelDescription
liquidity_provisions vega.LiquidityProvision repeated

MarginLevelsRequest

Request for margin levels for a party

FieldTypeLabelDescription
party_id string

Party identifier, required field

market_id string

Market identifier

Validated Fields

Field Validations
party_id
  • string_not_empty: true

MarginLevelsResponse

Response for margin levels for a party

FieldTypeLabelDescription
margin_levels vega.MarginLevels repeated

A list of 0 or more margin levels

MarginLevelsSubscribeRequest

Request to subscribe to a stream of MarginLevels data matching the given party identifier

Optionally, the list can be additionally filtered by market

FieldTypeLabelDescription
party_id string

Party identifier, required field

market_id string

Market identifier

Validated Fields

Field Validations
party_id
  • string_not_empty: true

MarginLevelsSubscribeResponse

FieldTypeLabelDescription
margin_levels vega.MarginLevels

MarketAccountsRequest

Request for a list of accounts for a market

FieldTypeLabelDescription
market_id string

Market identifier

asset string

Asset identifier

MarketAccountsResponse

Response for a list of accounts for a market

FieldTypeLabelDescription
accounts vega.Account repeated

A list of 0 or more accounts

MarketByIDRequest

Request for a market given a market identifier

FieldTypeLabelDescription
market_id string

Market identifier, required field

Validated Fields

Field Validations
market_id
  • string_not_empty: true

MarketByIDResponse

Response for a market given a market identifier

FieldTypeLabelDescription
market vega.Market

A market, if found

MarketDataByIDRequest

Request for market data for a market

FieldTypeLabelDescription
market_id string

Market identifier

Validated Fields

Field Validations
market_id
  • string_not_empty: true

MarketDataByIDResponse

Response for market data for a market

FieldTypeLabelDescription
market_data vega.MarketData

Market data, if found

MarketDepthRequest

Request for the market depth/order book price levels on a market

Optionally, a maximum depth can be set to limit the number of levels returned

FieldTypeLabelDescription
market_id string

Market identifier, required field

max_depth uint64

Max depth limits the number of levels returned. Default is 0, which returns all levels

Validated Fields

Field Validations
market_id
  • string_not_empty: true

MarketDepthResponse

Response for the market depth/order book price levels on a market

FieldTypeLabelDescription
market_id string

Market identifier

buy vega.PriceLevel repeated

Zero or more price levels for the buy side of the market depth data

sell vega.PriceLevel repeated

Zero or more price levels for the sell side of the market depth data

last_trade vega.Trade

Last trade recorded on Vega at the time of retrieving the `MarketDepthResponse`

sequence_number uint64

Sequence number incremented after each update

MarketDepthSubscribeRequest

Request to subscribe to a stream of (MarketDepth)[#vega.MarketDepth] data

FieldTypeLabelDescription
market_id string

Market identifier, required field.

Validated Fields

Field Validations
market_id
  • string_not_empty: true

MarketDepthSubscribeResponse

FieldTypeLabelDescription
market_depth vega.MarketDepth

MarketDepthUpdatesSubscribeRequest

Request to subscribe to a stream of (MarketDepth Update)[#vega.MarketDepthUpdate] data

FieldTypeLabelDescription
market_id string

Market identifier, required field

Validated Fields

Field Validations
market_id
  • string_not_empty: true

MarketDepthUpdatesSubscribeResponse

FieldTypeLabelDescription
update vega.MarketDepthUpdate

MarketsDataRequest

Request for market data

MarketsDataResponse

Response for market data

FieldTypeLabelDescription
markets_data vega.MarketData repeated

A list of 0 or more market data

MarketsDataSubscribeRequest

Request to subscribe to a stream of MarketsData

Optionally, the list can be additionally filtered by market

FieldTypeLabelDescription
market_id string

Market identifier

MarketsDataSubscribeResponse

FieldTypeLabelDescription
market_data vega.MarketData

MarketsRequest

Request for a list of markets on Vega

MarketsResponse

Response for a list of markets on Vega

FieldTypeLabelDescription
markets vega.Market repeated

A list of 0 or more markets

NetworkParametersRequest

A message requesting for the list of all network parameters

NetworkParametersResponse

A response containing all of the vega network parameters

FieldTypeLabelDescription
network_parameters vega.NetworkParameter repeated

ObserveEventBusRequest

Request to subscribe to a stream of one or more event types from the Vega event bus

FieldTypeLabelDescription
type vega.events.v1.BusEventType repeated

One or more types of event, required field

market_id string

Market identifier, optional field

party_id string

Party identifier, optional field

batch_size int64

Batch size, optional field - If not specified, any events received will be sent immediately. If the client is not ready for the next data-set, data may be dropped a number of times, and eventually the stream is closed. if specified, the first batch will be sent when ready. To receive the next set of events, the client must write an `ObserveEventBatch` message on the stream to flush the buffer. If no message is received in 5 seconds, the stream is closed. Default: 0, send any and all events when they are available.

ObserveEventBusResponse

Response to a subscribed stream of events from the Vega event bus

FieldTypeLabelDescription
events vega.events.v1.BusEvent repeated

One or more events

ObserveGovernanceRequest

Request to obsever all event related to governance

ObserveGovernanceResponse

All events related to governance

FieldTypeLabelDescription
data vega.GovernanceData

ObservePartyProposalsRequest

Request to subscribe to a stream of governance proposals for a party

FieldTypeLabelDescription
party_id string

Party identifier, required field

Validated Fields

Field Validations
party_id
  • string_not_empty: true

ObservePartyProposalsResponse

FieldTypeLabelDescription
data vega.GovernanceData

ObservePartyVotesRequest

Request to subscribe to a stream of governance votes for a party

FieldTypeLabelDescription
party_id string

Party identifier, required field

Validated Fields

Field Validations
party_id
  • string_not_empty: true

ObservePartyVotesResponse

FieldTypeLabelDescription
vote vega.Vote

ObserveProposalVotesRequest

Request to subscribe to a stream of governance votes for a proposal

FieldTypeLabelDescription
proposal_id string

Proposal identifier, required field

Validated Fields

Field Validations
proposal_id
  • string_not_empty: true

ObserveProposalVotesResponse

FieldTypeLabelDescription
vote vega.Vote

OptionalProposalState

Optional proposal state

FieldTypeLabelDescription
value vega.Proposal.State

Proposal state value

OracleDataBySpecRequest

A request to all oracle data broadcast to a given spec

FieldTypeLabelDescription
id string

The id to get the oracle spec for

Validated Fields

Field Validations
id
  • string_not_empty: true

OracleDataBySpecResponse

The response for a list of all oracle data broadcast to a given spec

FieldTypeLabelDescription
oracle_data oracles.v1.OracleData repeated

The list of oracle data broadcast to a given spec

OracleSpecRequest

A request to get a specific oracle spec by identifier

FieldTypeLabelDescription
id string

The id to get the oracle spec for

Validated Fields

Field Validations
id
  • string_not_empty: true

OracleSpecResponse

A response for a oracle spec

FieldTypeLabelDescription
oracle_spec oracles.v1.OracleSpec

The withdrawal matching the identifier from the request

OracleSpecsRequest

A request to get a specific oracle spec by identifier

OracleSpecsResponse

The response for a list of withdrawals

FieldTypeLabelDescription
oracle_specs oracles.v1.OracleSpec repeated

The list of oracle specs

OrderByIDRequest

Request for an order with the specified order identifier

Optionally, return a specific version of the order with the `version` field

FieldTypeLabelDescription
order_id string

Order identifier, required field

version uint64

Version of the order: - Set `version` to 0 for most recent version of the order - Set `1` for original version of the order - Set `2` for first amendment, `3` for second amendment, etc

Validated Fields

Field Validations
order_id
  • msg_exists: true

OrderByIDResponse

FieldTypeLabelDescription
order vega.Order

OrderByMarketAndIDRequest

Request for an order on a market given an order identifier

FieldTypeLabelDescription
market_id string

Market identifier, required field

order_id string

Order identifier, required field

Validated Fields

Field Validations
market_id
  • string_not_empty: true
order_id
  • string_not_empty: true

OrderByMarketAndIDResponse

Response for an order on a market given an order identifier

FieldTypeLabelDescription
order vega.Order

An order, if found

OrderByReferenceRequest

Request for an order given an order reference

FieldTypeLabelDescription
reference string

Unique reference, required field

Validated Fields

Field Validations
reference
  • string_not_empty: true

OrderByReferenceResponse

Response for an order given an order reference

FieldTypeLabelDescription
order vega.Order

An order, if found

OrderVersionsByIDRequest

Request for a list of all versions of an order given the specified order identifier

FieldTypeLabelDescription
order_id string

Order identifier, required field

pagination Pagination

Pagination controls

Validated Fields

Field Validations
order_id
  • msg_exists: true

OrderVersionsByIDResponse

Response to a request for a list of all versions of an order

FieldTypeLabelDescription
orders vega.Order repeated

A list of 0 or more orders (list will contain the same order but with different versions, if it has been amended)

OrdersByMarketRequest

Request for a list of orders for a market

FieldTypeLabelDescription
market_id string

Market identifier, required field

pagination Pagination

Optional pagination controls

Validated Fields

Field Validations
market_id
  • string_not_empty: true

OrdersByMarketResponse

Response for a list of orders for a market

FieldTypeLabelDescription
orders vega.Order repeated

A list of 0 or more orders

OrdersByPartyRequest

Request for a list of orders for a party

FieldTypeLabelDescription
party_id string

Party identifier, required field

pagination Pagination

Pagination controls

Validated Fields

Field Validations
party_id
  • string_not_empty: true

OrdersByPartyResponse

Response for a list of orders for a party

FieldTypeLabelDescription
orders vega.Order repeated

A list of 0 or more orders

OrdersSubscribeRequest

Request to subscribe to a stream of (Orders)[#vega.Order]

FieldTypeLabelDescription
market_id string

Market identifier

party_id string

Party identifier

OrdersSubscribeResponse

A stream of orders

FieldTypeLabelDescription
orders vega.Order repeated

A list of 0 or more orders

Pagination

Pagination controls

FieldTypeLabelDescription
skip uint64

Skip the number of records specified, default is 0

limit uint64

Limit the number of returned records to the value specified, default is 50

descending bool

Descending reverses the order of the records returned, default is true, if false the results will be returned in ascending order

PartiesRequest

Request for a list of all parties

PartiesResponse

Response to a request for a list of parties

FieldTypeLabelDescription
parties vega.Party repeated

A list of 0 or more parties

PartyAccountsRequest

Request for a list of accounts for a party

FieldTypeLabelDescription
party_id string

Party identifier

market_id string

Market identifier

type vega.AccountType

Account type, required field

asset string

Asset identifier

PartyAccountsResponse

Response for a list of accounts for a party

FieldTypeLabelDescription
accounts vega.Account repeated

A list of 0 or more accounts

PartyByIDRequest

Request for a party given a party identifier

FieldTypeLabelDescription
party_id string

Party identifier, required field

Validated Fields

Field Validations
party_id
  • string_not_empty: true

PartyByIDResponse

Response for a party given a party identifier

FieldTypeLabelDescription
party vega.Party

A party, if found

PartyStakeRequest

FieldTypeLabelDescription
party string

PartyStakeResponse

FieldTypeLabelDescription
current_stake_available string

stake_linkings vega.events.v1.StakeLinking repeated

PositionsByPartyRequest

Request for a list of positions for a party

Optionally, if a market identifier is set, the results will be filtered for that market only

FieldTypeLabelDescription
party_id string

Party identifier, required field

market_id string

Market identifier

Validated Fields

Field Validations
party_id
  • string_not_empty: true

PositionsByPartyResponse

Response for a list of positions for a party

FieldTypeLabelDescription
positions vega.Position repeated

A list of 0 or more positions

PositionsSubscribeRequest

Request to subscribe to a stream of (Positions)[#vega.Position]

FieldTypeLabelDescription
party_id string

Party identifier, optional field

market_id string

Market identifier, optional field

PositionsSubscribeResponse

FieldTypeLabelDescription
position vega.Position

TradesByMarketRequest

Request for a list of trades on a market

FieldTypeLabelDescription
market_id string

Market identifier, required field

pagination Pagination

Pagination controls

Validated Fields

Field Validations
market_id
  • string_not_empty: true

TradesByMarketResponse

Response for a list of trades on a market

FieldTypeLabelDescription
trades vega.Trade repeated

A list of 0 or more trades

TradesByOrderRequest

Request for a list of trades related to an order

FieldTypeLabelDescription
order_id string

Order identifier, required field

TradesByOrderResponse

Response for a list of trades related to an order

FieldTypeLabelDescription
trades vega.Trade repeated

A list of 0 or more trades

TradesByPartyRequest

Request for a list of trades relating to the given party

Optionally, the list can be additionally filtered for trades by market

FieldTypeLabelDescription
party_id string

Party identifier. Required field

market_id string

Market identifier

pagination Pagination

Pagination controls

TradesByPartyResponse

Response for a list of trades relating to a party

FieldTypeLabelDescription
trades vega.Trade repeated

A list of 0 or more trades

TradesSubscribeRequest

Request to subscribe to a stream of (Trades)[#vega.Trade]

FieldTypeLabelDescription
market_id string

Market identifier

party_id string

Party identifier

TradesSubscribeResponse

A stream of trades

FieldTypeLabelDescription
trades vega.Trade repeated

A list of 0 or more trades

TransferResponsesSubscribeRequest

TransferResponsesSubscribeResponse

FieldTypeLabelDescription
response vega.TransferResponse

WithdrawalRequest

A request to get a specific withdrawal by identifier

FieldTypeLabelDescription
id string

The identifier of the withdrawal

Validated Fields

Field Validations
id
  • string_not_empty: true

WithdrawalResponse

A response for a withdrawal

FieldTypeLabelDescription
withdrawal vega.Withdrawal

The withdrawal matching the identifier from the request

WithdrawalsRequest

A request to get a list of withdrawal from a given party

FieldTypeLabelDescription
party_id string

The party to get the withdrawals for

Validated Fields

Field Validations
party_id
  • string_not_empty: true

WithdrawalsResponse

The response for a list of withdrawals

FieldTypeLabelDescription
withdrawals vega.Withdrawal repeated

The list of withdrawals for the specified party

TradingDataService

Method NameRequest TypeResponse TypeDescription
MarketAccounts MarketAccountsRequest MarketAccountsResponse

Get a list of Accounts by Market

PartyAccounts PartyAccountsRequest PartyAccountsResponse

Get a list of Accounts by Party

FeeInfrastructureAccounts FeeInfrastructureAccountsRequest FeeInfrastructureAccountsResponse

Get a list of accounts holding infrastructure fees. Can be filtered by asset, there will be 1 infrastructure fee account per asset in the network.

GlobalRewardPoolAccounts GlobalRewardPoolAccountsRequest GlobalRewardPoolAccountsResponse

Get a list of accounts holding rewards pools Can be filtered by asset, there will be 1 reward pool account per asset in the network.

Candles CandlesRequest CandlesResponse

Get a list of Candles by Market

MarketDataByID MarketDataByIDRequest MarketDataByIDResponse

Get Market Data by Market ID

MarketsData MarketsDataRequest MarketsDataResponse

Get a list of Market Data

MarketByID MarketByIDRequest MarketByIDResponse

Get a Market by ID

MarketDepth MarketDepthRequest MarketDepthResponse

Get Market Depth

Markets MarketsRequest MarketsResponse

Get a list of Markets

OrderByMarketAndID OrderByMarketAndIDRequest OrderByMarketAndIDResponse

Get an Order by Market and Order ID

OrderByReference OrderByReferenceRequest OrderByReferenceResponse

Get an Order by Pending Order reference (UUID)

OrdersByMarket OrdersByMarketRequest OrdersByMarketResponse

Get a list of Orders by Market

OrdersByParty OrdersByPartyRequest OrdersByPartyResponse

Get a list of Orders by Party

OrderByID OrderByIDRequest OrderByIDResponse

Get a specific order by order ID

OrderVersionsByID OrderVersionsByIDRequest OrderVersionsByIDResponse

Get all versions of the order by its orderID

MarginLevels MarginLevelsRequest MarginLevelsResponse

Get Margin Levels by Party ID

Parties PartiesRequest PartiesResponse

Get a list of Parties

PartyByID PartyByIDRequest PartyByIDResponse

Get a Party by ID

PositionsByParty PositionsByPartyRequest PositionsByPartyResponse

Get a list of Positions by Party

LastTrade LastTradeRequest LastTradeResponse

Get latest Trade

TradesByMarket TradesByMarketRequest TradesByMarketResponse

Get a list of Trades by Market

TradesByOrder TradesByOrderRequest TradesByOrderResponse

Get a list of Trades by Order

TradesByParty TradesByPartyRequest TradesByPartyResponse

Get a list of Trades by Party

GetProposals GetProposalsRequest GetProposalsResponse

Get governance data (proposals and votes) for all proposals

GetProposalsByParty GetProposalsByPartyRequest GetProposalsByPartyResponse

Get governance data (proposals and votes) for proposals by party authoring them

GetVotesByParty GetVotesByPartyRequest GetVotesByPartyResponse

Get votes by party casting them

GetNewMarketProposals GetNewMarketProposalsRequest GetNewMarketProposalsResponse

Get governance data (proposals and votes) for proposals that aim creating new markets

GetUpdateMarketProposals GetUpdateMarketProposalsRequest GetUpdateMarketProposalsResponse

Get governance data (proposals and votes) for proposals that aim updating markets

GetNetworkParametersProposals GetNetworkParametersProposalsRequest GetNetworkParametersProposalsResponse

Get governance data (proposals and votes) for proposals that aim updating Vega network parameters

GetNewAssetProposals GetNewAssetProposalsRequest GetNewAssetProposalsResponse

Get governance data (proposals and votes) for proposals aiming to create new assets

GetProposalByID GetProposalByIDRequest GetProposalByIDResponse

Get governance data (proposals and votes) for a proposal located by ID

GetProposalByReference GetProposalByReferenceRequest GetProposalByReferenceResponse

Get governance data (proposals and votes) for a proposal located by reference

ObserveGovernance ObserveGovernanceRequest ObserveGovernanceResponse stream

Subscribe to a stream of all governance updates

ObservePartyProposals ObservePartyProposalsRequest ObservePartyProposalsResponse stream

Subscribe to a stream of proposal updates

ObservePartyVotes ObservePartyVotesRequest ObservePartyVotesResponse stream

Subscribe to a stream of votes cast by a specific party

ObserveProposalVotes ObserveProposalVotesRequest ObserveProposalVotesResponse stream

Subscribe to a stream of proposal votes

ObserveEventBus ObserveEventBusRequest stream ObserveEventBusResponse stream

Subscribe to a stream of events from the core

GetNodeData GetNodeDataRequest GetNodeDataResponse

Get data of current node

GetNodes GetNodesRequest GetNodesResponse

List all known network nodes

GetNodeByID GetNodeByIDRequest GetNodeByIDResponse

Get a specific node by ID

GetEpoch GetEpochRequest GetEpochResponse

Get data for a specific epoch, if id omitted it gets the current epoch

GetVegaTime GetVegaTimeRequest GetVegaTimeResponse

Get Time

AccountsSubscribe AccountsSubscribeRequest AccountsSubscribeResponse stream

Subscribe to a stream of Accounts

CandlesSubscribe CandlesSubscribeRequest CandlesSubscribeResponse stream

Subscribe to a stream of Candles

MarginLevelsSubscribe MarginLevelsSubscribeRequest MarginLevelsSubscribeResponse stream

Subscribe to a stream of Margin Levels

MarketDepthSubscribe MarketDepthSubscribeRequest MarketDepthSubscribeResponse stream

Subscribe to a stream of Market Depth

MarketDepthUpdatesSubscribe MarketDepthUpdatesSubscribeRequest MarketDepthUpdatesSubscribeResponse stream

Subscribe to a stream of Market Depth Price Level Updates

MarketsDataSubscribe MarketsDataSubscribeRequest MarketsDataSubscribeResponse stream

Subscribe to a stream of Markets Data

OrdersSubscribe OrdersSubscribeRequest OrdersSubscribeResponse stream

Subscribe to a stream of Orders

PositionsSubscribe PositionsSubscribeRequest PositionsSubscribeResponse stream

Subscribe to a stream of Positions

TradesSubscribe TradesSubscribeRequest TradesSubscribeResponse stream

Subscribe to a stream of Trades

TransferResponsesSubscribe TransferResponsesSubscribeRequest TransferResponsesSubscribeResponse stream

Subscribe to a stream of Transfer Responses

GetNodeSignaturesAggregate GetNodeSignaturesAggregateRequest GetNodeSignaturesAggregateResponse

Get an aggregate of signatures from all the nodes of the network

AssetByID AssetByIDRequest AssetByIDResponse

Get an asset by its identifier

Assets AssetsRequest AssetsResponse

Get a list of all assets on Vega

EstimateFee EstimateFeeRequest EstimateFeeResponse

Get an estimate for the fee to be paid for a given order

EstimateMargin EstimateMarginRequest EstimateMarginResponse

Get an estimate for the margin required for a new order

ERC20WithdrawalApproval ERC20WithdrawalApprovalRequest ERC20WithdrawalApprovalResponse

Get the bundle approval for an ERC20 withdrawal, these data are being used to bundle the call to the smart contract on the ethereum bridge

Withdrawal WithdrawalRequest WithdrawalResponse

Get a withdrawal by its identifier

Withdrawals WithdrawalsRequest WithdrawalsResponse

Get withdrawals for a party

Deposit DepositRequest DepositResponse

Get a deposit by its identifier

Deposits DepositsRequest DepositsResponse

Get deposits for a party

NetworkParameters NetworkParametersRequest NetworkParametersResponse

Get the network parameters

LiquidityProvisions LiquidityProvisionsRequest LiquidityProvisionsResponse

Get the liquidity provision orders

OracleSpec OracleSpecRequest OracleSpecResponse

Get an oracle spec by ID

OracleSpecs OracleSpecsRequest OracleSpecsResponse

Get the oracle specs

OracleDataBySpec OracleDataBySpecRequest OracleDataBySpecResponse

Get all oracle data

GetRewardDetails GetRewardDetailsRequest GetRewardDetailsResponse

Get Rewards data

Checkpoints CheckpointsRequest CheckpointsResponse

Delegations DelegationsRequest DelegationsResponse

Get delegation data

PartyStake PartyStakeRequest PartyStakeResponse

vega/api/v1/core.proto

Top

GetVegaTimeRequest

Request for the current time of the vega network

GetVegaTimeResponse

Response for the current consensus coordinated time on the Vega network, referred to as "VegaTime"

FieldTypeLabelDescription
timestamp int64

Timestamp representation of current VegaTime as represented in Nanoseconds since the epoch, for example `1580473859111222333` corresponds to `2020-01-31T12:30:59.111222333Z`

LastBlockHeightRequest

A request to get the height of the very last block processed

by tendermint

LastBlockHeightResponse

A response with the height of the last block processed by

tendermint

FieldTypeLabelDescription
height uint64

ObserveEventBusRequest

Request to subscribe to a stream of one or more event types from the Vega event bus

FieldTypeLabelDescription
type vega.events.v1.BusEventType repeated

One or more types of event, required field

market_id string

Market identifier, optional field

party_id string

Party identifier, optional field

batch_size int64

Batch size, optional field - If not specified, any events received will be sent immediately. If the client is not ready for the next data-set, data may be dropped a number of times, and eventually the stream is closed. if specified, the first batch will be sent when ready. To receive the next set of events, the client must write an `ObserveEventBatch` message on the stream to flush the buffer. If no message is received in 5 seconds, the stream is closed. Default: 0, send any and all events when they are available.

ObserveEventBusResponse

Response to a subscribed stream of events from the Vega event bus

FieldTypeLabelDescription
events vega.events.v1.BusEvent repeated

One or more events

PropagateChainEventRequest

Request for a new event sent by the blockchain queue to be propagated on Vega

FieldTypeLabelDescription
event bytes

Chain event

pub_key string

Public key

signature bytes

Signature

PropagateChainEventResponse

Response for a new event sent by the blockchain queue to be propagated on Vega

FieldTypeLabelDescription
success bool

Success will be true if the event was accepted by the node, **Important** - success does not mean that the event is confirmed by consensus

Statistics

Vega domain specific statistics as reported by the node the caller is connected to

FieldTypeLabelDescription
block_height uint64

Current block height as reported by the Vega blockchain

backlog_length uint64

Current backlog length (number of transactions) that are waiting to be included in a block

total_peers uint64

Total number of connected peers to this node

genesis_time string

Genesis block date and time formatted in ISO-8601 datetime format with nanosecond precision

current_time string

Current system date and time formatted in ISO-8601 datetime format with nanosecond precision

vega_time string

Current Vega date and time formatted in ISO-8601 datetime format with nanosecond precision

status vega.ChainStatus

Status of the connection to the Vega blockchain - See [`ChainStatus`](#vega.ChainStatus)

tx_per_block uint64

Transactions per block

average_tx_bytes uint64

Average transaction size in bytes

average_orders_per_block uint64

Average orders per block

trades_per_second uint64

Trades emitted per second

orders_per_second uint64

Orders processed per second

total_markets uint64

Total markets on this Vega network

total_amend_order uint64

Total number of order amendments since genesis (on all markets)

total_cancel_order uint64

Total number of order cancellations since genesis (on all markets)

total_create_order uint64

Total number of order submissions since genesis (on all markets)

total_orders uint64

Total number of orders processed since genesis (on all markets)

total_trades uint64

Total number of trades emitted since genesis (on all markets)

order_subscriptions uint32

Current number of stream subscribers to order data

trade_subscriptions uint32

Current number of stream subscribers to trade data

candle_subscriptions uint32

Current number of stream subscribers to candle-stick data

market_depth_subscriptions uint32

Current number of stream subscribers to market depth data

positions_subscriptions uint32

Current number of stream subscribers to positions data

account_subscriptions uint32

Current number of stream subscribers to account data

market_data_subscriptions uint32

Current number of stream subscribers to market data

app_version_hash string

The version hash of the Vega node software

app_version string

The version of the Vega node software

chain_version string

The version of the underlying Vega blockchain

block_duration uint64

Current block duration, in nanoseconds

uptime string

Total uptime for this node formatted in ISO-8601 datetime format with nanosecond precision

chain_id string

Unique identifier for the underlying Vega blockchain

market_depth_updates_subscriptions uint32

Current number of stream subscribers to market depth update data

StatisticsRequest

A a request for statistics about the Vega network

StatisticsResponse

FieldTypeLabelDescription
statistics Statistics

SubmitTransactionRequest

Request for submitting a transaction v2 on Vega

FieldTypeLabelDescription
tx vega.commands.v1.Transaction

A bundle of signed payload and signature, to form a transaction that will be submitted to the Vega blockchain

type SubmitTransactionRequest.Type

Type of transaction request, for example ASYNC, meaning the transaction will be submitted and not block on a response

SubmitTransactionResponse

Response for submitting a transaction v2 on Vega

FieldTypeLabelDescription
success bool

Success will be true if the transaction was accepted by the node, **Important** - success does not mean that the event is confirmed by consensus

SubmitTransactionRequest.Type

Blockchain transaction type

NameNumberDescription
TYPE_UNSPECIFIED 0

TYPE_ASYNC 1

The transaction will be submitted without waiting for response

TYPE_SYNC 2

The transaction will be submitted, and blocking until the tendermint mempool return a response

TYPE_COMMIT 3

The transaction will submitted, and blocking until the tendermint network will have committed it into a block

CoreService

Method NameRequest TypeResponse TypeDescription
SubmitTransaction SubmitTransactionRequest SubmitTransactionResponse

Submit a signed transaction

PropagateChainEvent PropagateChainEventRequest PropagateChainEventResponse

Propagate a chain event

Statistics StatisticsRequest StatisticsResponse

Get Statistics on Vega

LastBlockHeight LastBlockHeightRequest LastBlockHeightResponse

Get the height of the last tendermint block

GetVegaTime GetVegaTimeRequest GetVegaTimeResponse

Get Time

ObserveEventBus ObserveEventBusRequest stream ObserveEventBusResponse stream

Subscribe to a stream of events from the core

vega/api/v1/corestate.proto

Top

Account

FieldTypeLabelDescription
party string

market string

balance string

asset string

type string

ListAccountsRequest

FieldTypeLabelDescription
party string

market string

ListAccountsResponse

FieldTypeLabelDescription
accounts Account repeated

ListAssetsRequest

FieldTypeLabelDescription
asset string

optional ID

ListAssetsResponse

FieldTypeLabelDescription
assets vega.Asset repeated

ListDelegationsRequest

FieldTypeLabelDescription
party string

node string

epoch_seq string

ListDelegationsResponse

FieldTypeLabelDescription
delegations vega.Delegation repeated

ListMarketsDataRequest

FieldTypeLabelDescription
market string

ListMarketsDataResponse

FieldTypeLabelDescription
markets_data vega.MarketData repeated

ListMarketsRequest

FieldTypeLabelDescription
market string

ListMarketsResponse

FieldTypeLabelDescription
markets vega.Market repeated

ListNetworkParametersRequest

FieldTypeLabelDescription
network_parameter_key string

optional parameter key

ListNetworkParametersResponse

FieldTypeLabelDescription
network_parameters vega.NetworkParameter repeated

ListPartiesRequest

ListPartiesResponse

FieldTypeLabelDescription
parties vega.Party repeated

ListPartiesStakeRequest

FieldTypeLabelDescription
party string

ListPartiesStakeResponse

FieldTypeLabelDescription
parties_stake PartyStake repeated

ListProposalsRequest

FieldTypeLabelDescription
proposal string

optional ID

proposer string

optional party

ListProposalsResponse

FieldTypeLabelDescription
proposals vega.Proposal repeated

ListValidatorsRequest

ListValidatorsResponse

FieldTypeLabelDescription
validators vega.events.v1.ValidatorUpdate repeated

ListVotesRequest

FieldTypeLabelDescription
proposal string

party string

ListVotesResponse

FieldTypeLabelDescription
votes vega.Vote repeated

PartyStake

FieldTypeLabelDescription
party string

current_stake_available string

stake_linkings vega.events.v1.StakeLinking repeated

CoreStateService

Method NameRequest TypeResponse TypeDescription
ListAccounts ListAccountsRequest ListAccountsResponse

ListAssets ListAssetsRequest ListAssetsResponse

ListNetworkParameters ListNetworkParametersRequest ListNetworkParametersResponse

ListParties ListPartiesRequest ListPartiesResponse

ListValidators ListValidatorsRequest ListValidatorsResponse

ListMarkets ListMarketsRequest ListMarketsResponse

ListProposals ListProposalsRequest ListProposalsResponse

ListMarketsData ListMarketsDataRequest ListMarketsDataResponse

ListVotes ListVotesRequest ListVotesResponse

ListPartiesStake ListPartiesStakeRequest ListPartiesStakeResponse

ListDelegations ListDelegationsRequest ListDelegationsResponse

vega/checkpoint/v1/checkpoint.proto

Top

AssetBalance

AssetBalance represents the total balance of a given asset for a party

FieldTypeLabelDescription
party string

asset string

balance string

AssetEntry

AssetEntrty is a single (enabled) asset

FieldTypeLabelDescription
id string

asset_details vega.AssetDetails

Assets

Assets contains all the enabled assets as AssetEntries

FieldTypeLabelDescription
assets AssetEntry repeated

Block

Block message contains data related to block at which the checkpoint

was created (ie block height)

FieldTypeLabelDescription
height int64

Checkpoint

Checkpoint aggregates the various engine snapshots

FieldTypeLabelDescription
governance bytes

assets bytes

collateral bytes

network_parameters bytes

delegation bytes

epoch bytes

will just be an epoch event

block bytes

CheckpointState

CheckpointState is the entire checkpoint serialised (basically serialised the Checkpoint message + hash)

FieldTypeLabelDescription
hash bytes

state bytes

Collateral

Collateral contains the balances per party

FieldTypeLabelDescription
balances AssetBalance repeated

Delegate

Delegate contains all entries for a checkpoint

FieldTypeLabelDescription
active DelegateEntry repeated

pending DelegateEntry repeated

auto_delegation string repeated

DelegateEntry

Delegated amounts for party/node

undelegate and epoch seq are only relevant for pending entries

FieldTypeLabelDescription
party string

node string

amount string

undelegate bool

epoch_seq uint64

NetParams

NetParams contains all network parameters

FieldTypeLabelDescription
params vega.NetworkParameter repeated

Proposals

Proposals will contain all accepted proposals

FieldTypeLabelDescription
proposals vega.Proposal repeated

vega/snapshot/v1/snapshot.proto

Top

ActiveAssets

FieldTypeLabelDescription
assets vega.Asset repeated

AppState

FieldTypeLabelDescription
height uint64

block string

time int64

AssetAction

FieldTypeLabelDescription
id string

state uint32

asset string

block_number uint64

tx_index uint64

hash string

builtin_deposit vega.BuiltinAssetDeposit

erc20_deposit vega.ERC20Deposit

asset_list vega.ERC20AssetList

AuctionState

FieldTypeLabelDescription
mode vega.Market.TradingMode

default_mode vega.Market.TradingMode

trigger vega.AuctionTrigger

begin int64

end vega.AuctionDuration

start bool

stop bool

extension vega.AuctionTrigger

BankingAssetActions

FieldTypeLabelDescription
asset_action AssetAction repeated

BankingDeposits

FieldTypeLabelDescription
deposit Deposit repeated

BankingSeen

FieldTypeLabelDescription
refs TxRef repeated

BankingWithdrawals

FieldTypeLabelDescription
withdrawals Withdrawal repeated

BannedParty

FieldTypeLabelDescription
party string

until_epoch uint64

BlockRejectStats

FieldTypeLabelDescription
rejected uint64

total uint64

Checkpoint

FieldTypeLabelDescription
next_cp int64

Chunk

Chunk is simply an as-is chunk belonging to a snapshot

not sure how usable this type would be

FieldTypeLabelDescription
data Payload repeated

nr int64

in case of multi-part data, this is chunk nr...

of int64

...of a total of N chunks

CollateralAccounts

FieldTypeLabelDescription
accounts vega.Account repeated

CollateralAssets

FieldTypeLabelDescription
assets vega.Asset repeated

DecimalMap

FieldTypeLabelDescription
key int64

val string

DelegationActive

FieldTypeLabelDescription
delegations vega.Delegation repeated

DelegationAuto

FieldTypeLabelDescription
parties string repeated

DelegationPending

FieldTypeLabelDescription
delegations vega.Delegation repeated

undelegation vega.Delegation repeated

Deposit

FieldTypeLabelDescription
id string

deposit vega.Deposit

EpochState

EpochState details

FieldTypeLabelDescription
seq uint64

Sequence number that increases by one each epoch

start_time int64

What time did this epoch start

expire_time int64

What time should this epoch end

ready_to_start_new_epoch bool

Ready to start a new epoch

ready_to_end_epoch bool

Ready to end epoch

EquityShare

FieldTypeLabelDescription
mvp string

opening_auction_ended bool

lps EquityShareLP repeated

EquityShareLP

FieldTypeLabelDescription
id string

stake string

share string

avg string

ExecutionIDGenerator

State of the ID generator used for creating order IDs

FieldTypeLabelDescription
batches uint64

Which batch are we on

orders uint64

How many orders in this batch

proposals uint64

How many proposals in this batch

ExecutionMarkets

FieldTypeLabelDescription
markets Market repeated

FutureState

FieldTypeLabelDescription
market_id string

settlement_price string

trading_terminated bool

GovernanceActive

FieldTypeLabelDescription
proposals PendingProposal repeated

GovernanceEnacted

FieldTypeLabelDescription
proposals vega.Proposal repeated

GovernanceNode

FieldTypeLabelDescription
proposals vega.Proposal repeated

LimitState

LimitState details

FieldTypeLabelDescription
block_count uint32

Number of blocks into the boostrapping phase

can_propose_market bool

whether the limit on market proposals has been lifted

can_propose_asset bool

whether the limit on asset proposals has been lifted

genesis_loaded bool

whether the genesis state is loaded

propose_market_enabled bool

fields derived from the genesis state

propose_asset_enabled bool

propose_market_enabled_from int64

propose_asset_enabled_from int64

Market

FieldTypeLabelDescription
market vega.Market

price_monitor PriceMonitor

auction_state AuctionState

pegged_orders vega.Order repeated

expiring_orders vega.Order repeated

last_best_bid string

last_best_ask string

last_mid_bid string

last_mid_ask string

last_market_value_proxy string

last_equity_share_distributed int64

equity_share EquityShare

current_mark_price string

MarketPositions

FieldTypeLabelDescription
market_id string

positions Position repeated

MatchingBook

FieldTypeLabelDescription
market_id string

buy vega.Order repeated

sell vega.Order repeated

last_traded_price string

auction bool

batch_id uint64

Metadata

FieldTypeLabelDescription
version int64

chunk_hashes string repeated

node_hashes NodeHash repeated

hashes used by snapshot engine, different to chunk hash if data was split up, or combined into a single chunk

NetParams

FieldTypeLabelDescription
params vega.NetworkParameter repeated

NodeHash

FieldTypeLabelDescription
full_key string

namespace<separator>key

namespace string

key string

hash string

Notary

FieldTypeLabelDescription
notary_sigs NotarySigs repeated

NotarySigs

FieldTypeLabelDescription
id string

kind int32

node string

sig string

PartyProposalVoteCount

FieldTypeLabelDescription
party string

proposal string

count uint64

PartyTokenBalance

FieldTypeLabelDescription
party string

balance string

Payload

FieldTypeLabelDescription
active_assets ActiveAssets

pending_assets PendingAssets

banking_withdrawals BankingWithdrawals

banking_deposits BankingDeposits

banking_seen BankingSeen

banking_asset_actions BankingAssetActions

checkpoint Checkpoint

collateral_accounts CollateralAccounts

collateral_assets CollateralAssets

delegation_active DelegationActive

delegation_pending DelegationPending

delegation_auto DelegationAuto

governance_active GovernanceActive

governance_enacted GovernanceEnacted

staking_accounts StakingAccounts

matching_book MatchingBook

network_parameters NetParams

execution_markets ExecutionMarkets

market_positions MarketPositions

app_state AppState

epoch EpochState

execution_id_generator ExecutionIDGenerator

rewards_pending_payouts RewardsPendingPayouts

governance_node GovernanceNode

limit_state LimitState

vote_spam_policy VoteSpamPolicy

simple_spam_policy SimpleSpamPolicy

notary Notary

replay_protection ReplayProtection

future_state FutureState

PendingAssets

FieldTypeLabelDescription
assets vega.Asset repeated

PendingProposal

FieldTypeLabelDescription
proposal vega.Proposal

yes vega.Vote repeated

no vega.Vote repeated

invalid vega.Vote repeated

Position

FieldTypeLabelDescription
party_id string

size int64

buy int64

sell int64

price string

vw_buy_price string

vw_sell_price string

PriceBound

FieldTypeLabelDescription
active bool

up_factor string

down_factor string

trigger vega.PriceMonitoringTrigger

PriceMonitor

FieldTypeLabelDescription
initialised bool

fp_horizons DecimalMap repeated

now int64

update int64

bounds PriceBound repeated

price_range_cache_time int64

price_range_cache PriceRangeCache repeated

ref_price_cache_time int64

ref_price_cache DecimalMap repeated

PriceRange

FieldTypeLabelDescription
min string

max string

ref string

PriceRangeCache

FieldTypeLabelDescription
bound PriceBound

range PriceRange

PriceVolume

FieldTypeLabelDescription
price string

volume uint64

RecentBlocksTransactions

FieldTypeLabelDescription
tx string repeated

ReplayProtection

FieldTypeLabelDescription
recent_blocks_transactions RecentBlocksTransactions repeated

RewardsPartyAmount

FieldTypeLabelDescription
party string

amount string

RewardsPayout

FieldTypeLabelDescription
from_account string

asset string

reward_party_amount RewardsPartyAmount repeated

total_reward string

epoch_seq string

timestamp int64

RewardsPendingPayouts

FieldTypeLabelDescription
scheduled_rewards_payout ScheduledRewardsPayout repeated

ScheduledRewardsPayout

FieldTypeLabelDescription
payout_time int64

rewards_payout RewardsPayout repeated

SimpleSpamPolicy

FieldTypeLabelDescription
policy_name string

party_to_count SpamPartyTransactionCount repeated

banned_parties BannedParty repeated

token_balance PartyTokenBalance repeated

current_epoch_seq uint64

Snapshot

FieldTypeLabelDescription
height uint64

format Format

chunks uint32

hash bytes

metadata bytes

SpamPartyTransactionCount

FieldTypeLabelDescription
party string

count uint64

StakingAccount

FieldTypeLabelDescription
party string

balance string

events vega.events.v1.StakeLinking repeated

StakingAccounts

FieldTypeLabelDescription
accounts StakingAccount repeated

TimePrice

FieldTypeLabelDescription
time int64

price string

TxRef

FieldTypeLabelDescription
asset string

block_nr uint64

hash string

log_index uint64

VoteSpamPolicy

FieldTypeLabelDescription
party_to_vote PartyProposalVoteCount repeated

banned_parties BannedParty repeated

token_balance PartyTokenBalance repeated

recent_blocks_reject_stats BlockRejectStats repeated

current_block_index uint64

last_increase_block uint64

current_epoch_seq uint64

min_voting_tokens_factor string

Withdrawal

FieldTypeLabelDescription
ref string

withdrawal vega.Withdrawal

Format

NameNumberDescription
FORMAT_UNSPECIFIED 0

Default value, always invalid

FORMAT_PROTO 1

Standard proto encoding

FORMAT_PROTO_COMPRESSED 2

Compressed proto, might come in handy

FORMAT_JSON 3

Simple JSON serialisation, probably not going to be used

vega/tm/replay.proto

Top

BlockParams

FieldTypeLabelDescription
max_bytes int64

max_gas int64

ConsensusParams

FieldTypeLabelDescription
block BlockParams

evidence EvidenceParams

validator ValidatorParams

version VersionParams

Event

FieldTypeLabelDescription
type string

attributes EventAttribute repeated

EventAttribute

FieldTypeLabelDescription
key bytes

value bytes

index bool

nondeterministic

Evidence

FieldTypeLabelDescription
type EvidenceType

validator Validator

height int64

time int64

total_voting_power int64

EvidenceParams

FieldTypeLabelDescription
max_age_num_blocks int64

max_age_duration int64

max_num uint32

Header

FieldTypeLabelDescription
chain_id string

height int64

time int64

LastCommitInfo

FieldTypeLabelDescription
round int32

votes VoteInfo repeated

PublicKey

FieldTypeLabelDescription
ed25519 bytes

RequestBeginBlock

FieldTypeLabelDescription
hash bytes

header Header

last_commit_info LastCommitInfo

byzantine_validators Evidence repeated

RequestDeliverTx

FieldTypeLabelDescription
tx bytes

RequestInitChain

FieldTypeLabelDescription
time int64

chain_id string

consensus_params ConsensusParams

validators ValidatorUpdate repeated

app_state_bytes bytes

initial_height int64

ResponseBeginBlock

FieldTypeLabelDescription
events Event repeated

ResponseDeliverTx

FieldTypeLabelDescription
code uint32

data bytes

log string

nondeterministic

info string

nondeterministic

gas_wanted int64

gas_used int64

events Event repeated

codespace string

ResponseInitChain

FieldTypeLabelDescription
consensus_params ConsensusParams

validators ValidatorUpdate repeated

app_hash bytes

TmEvent

FieldTypeLabelDescription
req_init_chain RequestInitChain

res_init_chain ResponseInitChain

req_deliver_tx RequestDeliverTx

res_deliver_tx ResponseDeliverTx

req_begin_block RequestBeginBlock

res_begin_block ResponseBeginBlock

Validator

FieldTypeLabelDescription
address bytes

power int64

ValidatorParams

FieldTypeLabelDescription
pub_key_types string repeated

ValidatorUpdate

FieldTypeLabelDescription
pub_key PublicKey

power int64

VersionParams

FieldTypeLabelDescription
app_version uint64

VoteInfo

FieldTypeLabelDescription
validator Validator

signed_last_block bool

EvidenceType

NameNumberDescription
UNKNOWN 0

DUPLICATE_VOTE 1

LIGHT_CLIENT_ATTACK 2

vega/wallet/v1/wallet.proto

Top

SubmitTransactionRequest

FieldTypeLabelDescription
pub_key string

propagate bool

order_submission vega.commands.v1.OrderSubmission

User commands

order_cancellation vega.commands.v1.OrderCancellation

order_amendment vega.commands.v1.OrderAmendment

withdraw_submission vega.commands.v1.WithdrawSubmission

proposal_submission vega.commands.v1.ProposalSubmission

vote_submission vega.commands.v1.VoteSubmission

liquidity_provision_submission vega.commands.v1.LiquidityProvisionSubmission

delegate_submission vega.commands.v1.DelegateSubmission

undelegate_submission vega.commands.v1.UndelegateSubmission

node_registration vega.commands.v1.NodeRegistration

Validator commands

node_vote vega.commands.v1.NodeVote

node_signature vega.commands.v1.NodeSignature

chain_event vega.commands.v1.ChainEvent

oracle_data_submission vega.commands.v1.OracleDataSubmission

Oracle commands

Scalar Value Types

.proto TypeNotesC++JavaPythonGoC#PHPRuby
double double double float float64 double float Float
float float float float float32 float float Float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int int32 int integer Bignum or Fixnum (as required)
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64 long int/long int64 long integer/string Bignum
uint32 Uses variable-length encoding. uint32 int int/long uint32 uint integer Bignum or Fixnum (as required)
uint64 Uses variable-length encoding. uint64 long int/long uint64 ulong integer/string Bignum or Fixnum (as required)
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int int32 int integer Bignum or Fixnum (as required)
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long int64 long integer/string Bignum
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int uint32 uint integer Bignum or Fixnum (as required)
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long uint64 ulong integer/string Bignum
sfixed32 Always four bytes. int32 int int int32 int integer Bignum or Fixnum (as required)
sfixed64 Always eight bytes. int64 long int/long int64 long integer/string Bignum
bool bool boolean boolean bool bool boolean TrueClass/FalseClass
string A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode string string string String (UTF-8)
bytes May contain any arbitrary sequence of bytes. string ByteString str []byte ByteString string String (ASCII-8BIT)