vega.proto
path vega/vega.proto
package vega
Messages
Account
Represents an account for an asset on Vega for a particular owner or party
Name | Type | Description |
---|
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
Name | Type | Description |
---|
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 the auction uncrossed now |
indicative_volume | uint64 | The Indicative Uncrossing Volume is the volume available at the Indicative crossing price if the auction uncrossed 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
Name | Type | Description |
---|
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
Name | Type | Description |
---|
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
Name | Type | Description |
---|
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 |
DispatchStrategy
Name | Type | Description |
---|
asset_for_metric | string | The asset to use for metric |
metric | DispatchMetric | The metric to apply |
markets | string | Optional markets in scope |
Epoch
Name | Type | Description |
---|
seq | uint64 | Sequence is used as epoch identifier |
timestamps | EpochTimestamps | Timestamps for start/end etc |
validators | Node | Validators that participated in this epoch |
delegations | Delegation | List of all delegations in epoch |
EpochData
Name | Type | Description |
---|
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
Name | Type | Description |
---|
epoch | Epoch | |
offline | uint64 | |
online | uint64 | |
total_rewards | double | |
EpochTimestamps
Describes in both human readable and block time when an epoch spans
Name | Type | Description |
---|
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
Name | Type | Description |
---|
receiver_address | string | The address into which the bridge will release the funds |
ErrorDetail
Represents Vega domain specific error information over gRPC/Protobuf
Name | Type | Description |
---|
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.
Name | Type | Description |
---|
network_id | string | Network identifier of this Ethereum network. |
chain_id | string | Chain identifier of this Ethereum network. |
collateral_bridge_contract | EthereumContractConfig | Contract configuration of the collateral bridge contract for this Ethereum network. |
confirmations | uint32 | Number of block confirmations to wait to consider an Ethereum transaction trusted.
An Ethereum block is trusted when there are at least "n" blocks confirmed by the
network, "n" being the number of `confirmations` required. If `confirmations` was set to `3`,
and the current block to be forged (or mined) on Ethereum is block 14, block
10 would be considered as trusted, but not block 11. |
staking_bridge_contract | EthereumContractConfig | Contract configuration of the stacking bridge contract for this Ethereum network. |
token_vesting_contract | EthereumContractConfig | Contract configuration of the token vesting contract for this Ethereum network. |
multisig_control_contract | EthereumContractConfig | Contract configuration of the multisig controld contract for this Ethereum network. |
EthereumContractConfig
Name | Type | Description |
---|
address | string | Address of the contract for this Ethereum network. The address should start with "0x". |
deployment_block_height | uint64 | Block height at which the stacking contract has been deployed for this Ethereum network. |
Fee
Represents any fees paid by a party, resulting from a trade
Name | Type | Description |
---|
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
Name | Type | Description |
---|
amount | string | A signed integer amount of asset |
asset | string | Asset identifier |
KeyValueBundle
LedgerEntry
Represents a ledger entry on Vega
Name | Type | Description |
---|
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
Name | Type | Description |
---|
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 | string | 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
Name | Type | Description |
---|
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
Name | Type | Description |
---|
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
Name | Type | Description |
---|
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 | A set of liquidity sell orders to meet the liquidity provision obligation |
buys | LiquidityOrderReference | A set of liquidity buy orders to meet the liquidity provision obligation |
version | uint64 | 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 its orders |
MarginLevels
Represents the margin levels for a party on a market at a given time
Name | Type | Description |
---|
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
Name | Type | Description |
---|
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, or start time of the current auction if market is in auction period |
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 | One or more price monitoring bounds for the current timestamp |
market_value_proxy | string | the market value proxy |
liquidity_provider_fee_share | LiquidityProviderFeeShare | 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
Name | Type | Description |
---|
market_id | string | Market identifier |
buy | PriceLevel | Collection of price levels for the buy side of the book |
sell | PriceLevel | 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
Name | Type | Description |
---|
market_id | string | Market identifier |
buy | PriceLevel | Collection of updated price levels for the buy side of the book |
sell | PriceLevel | Collection of updated price levels for the sell side of the book |
sequence_number | uint64 | Sequence number for the market depth update data returned. It is increasing but not monotonic. |
previous_sequence_number | uint64 | Sequence number of of the previous market depth update, for checking there are no gaps. |
MatrixValue
NetworkLimits
Network limits, defined in the genesis file
Name | Type | Description |
---|
can_propose_market | bool | Are market proposals allowed at this point in time |
can_propose_asset | bool | Are asset proposals allowed at this point in time |
bootstrap_finished | bool | True once block count > bootstrapBlockCount |
propose_market_enabled | bool | Are market proposals enabled on this chain |
propose_asset_enabled | bool | Are asset proposals enabled on this chain |
bootstrap_block_count | uint32 | How many blocks before the chain comes out of bootstrap mode |
genesis_loaded | bool | True once the genesis file is loaded |
propose_market_enabled_from | int64 | The date/timestamp in unix nanoseconds at which market proposals will be enabled (0 indicates not set) |
propose_asset_enabled_from | int64 | The date/timestamp in unix nanoseconds at which asset proposals will be enabled (0 indicates not set) |
NetworkParameter
Represents a network parameter on Vega
Name | Type | Description |
---|
key | string | The unique key |
value | string | The value for the network parameter |
Node
Name | Type | Description |
---|
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 | Information about epoch |
status | NodeStatus | Node status |
delegations | Delegation | Node's delegations |
reward_score | RewardScore | Node reward score |
ranking_score | RankingScore | Node ranking information |
name | string | Node name |
avatar_url | string | Avatar url |
NodeData
Name | Type | Description |
---|
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
Name | Type | Description |
---|
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 |
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 OrderTimeInForce |
type | Order.Type | Type for the order - See OrderType |
created_at | int64 | Timestamp for when the order was created at, in nanoseconds since the epoch |
status | Order.Status | The current status for the order.
- For detail on `STATUS_REJECTED` please check the OrderError value given in the `reason` field |
expires_at | int64 | Timestamp for when the order will expire, in nanoseconds since the epoch |
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 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
Name | Type | Description |
---|
order | Order | The order that was cancelled |
OrderConfirmation
Used when confirming an order
Name | Type | Description |
---|
order | Order | The order that was confirmed |
trades | Trade | 0 or more trades that were emitted |
passive_orders_affected | Order | 0 or more passive orders that were affected |
Party
A party represents an entity who wishes to trade on or query a Vega network
Name | Type | Description |
---|
id | string | A unique identifier for the party, typically represented by a public key |
PeggedOrder
Pegged orders are limit orders where the price is specified in the form REFERENCE +/- OFFSET
They can be used for any limit order that is valid during continuous trading
Name | Type | Description |
---|
reference | PeggedReference | The price point the order is linked to |
offset | string | Offset from the price reference |
Position
Represents position data for a party on the specified market on Vega
Name | Type | Description |
---|
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
Name | Type | Description |
---|
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 |
PriceLevel
Represents a price level from market depth or order book data
Name | Type | Description |
---|
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
Name | Type | Description |
---|
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 | string | Reference price used to calculate the valid price range |
RankingScore
Name | Type | Description |
---|
stake_score | string | stake based score - no anti-whaling |
performance_score | string | performance based score |
previous_status | ValidatorNodeStatus | the status of the validator in the previous epoch |
status | ValidatorNodeStatus | the status of the validator in the current epoch |
voting_power | uint32 | tendermint voting power of the validator |
ranking_score | string | final score |
Reward
Details for a single reward payment
Name | Type | Description |
---|
asset_id | string | |
party_id | string | |
epoch | uint64 | |
amount | string | |
percentage_of_total | string | |
received_at | int64 | |
market_id | string | |
reward_type | string | |
RewardScore
Name | Type | Description |
---|
raw_validator_score | string | stake based score - with anti-whaling |
performance_score | string | performance based score |
multisig_score | string | multisig score |
validator_score | string | un-normalised score |
normalised_score | string | normalised validator score for rewards |
validator_status | ValidatorNodeStatus | the status of the validator for reward |
RewardSummary
Details for rewards for a single asset
Name | Type | Description |
---|
asset_id | string | |
party_id | string | |
amount | 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
Name | Type | Description |
---|
market | string | Market ID that relates to this risk factor |
short | string | Short Risk factor value |
long | string | Long Risk factor value |
ScalarValue
Name | Type | Description |
---|
value | string | |
StateValueProposal
Name | Type | Description |
---|
state_var_id | string | state variable identifier |
event_id | string | event identifier |
kvb | KeyValueBundle | key value tolerance triplets |
StateVarValue
Trade
A trade occurs when an aggressive order crosses one or more passive orders on the order book for a market on Vega
Name | Type | Description |
---|
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
Name | Type | Description |
---|
trades | Trade | A set of one or more trades |
Transfer
Represents a financial transfer within Vega
Name | Type | Description |
---|
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 |
market_id | string | optional dispatch strategy |
TransferBalance
Represents the balance for an account during a transfer
Name | Type | Description |
---|
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
Name | Type | Description |
---|
from_account | Account | One or more accounts to transfer from |
to_account | Account | 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
Name | Type | Description |
---|
transfers | LedgerEntry | One or more ledger entries representing the transfers |
balances | TransferBalance | One or more account balances |
VectorValue
Name | Type | Description |
---|
value | string | |
WithdrawExt
Withdrawal external details
Withdrawal
A withdrawal from the Vega network
Name | Type | Description |
---|
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 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 |
Enums
AccountType
Various collateral/account types as used by Vega
Name | Number | Description |
---|
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 funds set aside for the margin needed to support a party's open positions.
Each party will have a margin account for each market they have traded in.
The required initial margin is allocated to each market from your general account.
Collateral in the margin account can't be withdrawn or used as margin on another market until
it is released back to the general account.
The Vega protocol uses an internal accounting system to segregate funds held as
margin from other funds to ensure they are never lost or 'double spent'
Margin account funds will vary as margin requirements on positions change |
ACCOUNT_TYPE_GENERAL | 4 | General accounts contain the collateral for a party that is not otherwise allocated. A party will
have multiple general accounts, one for each asset they want
to trade with
General accounts are where funds are initially deposited or withdrawn from,
it is also the account where funds are taken to fulfil fees and initial margin requirements |
ACCOUNT_TYPE_FEES_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_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 |
ACCOUNT_TYPE_PENDING_TRANSFERS | 13 | Per asset account used to store pending transfers (if any) |
ACCOUNT_TYPE_REWARD_TAKER_PAID_FEES | 14 | Per asset reward account for fees paid by takers |
ACCOUNT_TYPE_REWARD_MAKER_RECEIVED_FEES | 15 | Per asset reward account for fees received by makers |
ACCOUNT_TYPE_REWARD_LP_RECEIVED_FEES | 16 | Per asset reward account for fees received by liquidity providers |
ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS | 17 | Per asset reward account for market proposers when the market goes above some trading threshold |
AuctionTrigger
Auction triggers indicate what condition triggered an auction (if market is in auction mode)
Name | Number | Description |
---|
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
Name | Number | Description |
---|
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
Name | Number | Description |
---|
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 |
DispatchMetric
Name | Number | Description |
---|
DISPATCH_METRIC_UNSPECIFIED | 0 | |
DISPATCH_METRIC_TAKER_FEES_PAID | 1 | Dispatch metric that is using the total taker fees paid in the market |
DISPATCH_METRIC_MAKER_FEES_RECEIVED | 2 | Dispatch metric that is using the total maker fees received in the market |
DISPATCH_METRIC_LP_FEES_RECEIVED | 3 | Dispatch metric that is using the total LP fees received in the market |
DISPATCH_METRIC_MARKET_VALUE | 4 | Dispatch metric that is using total value of the market if above the required threshold and not paid given proposer bonus yet |
EpochAction
What epoch action has occurred
Name | Number | Description |
---|
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
Name | Number | Description |
---|
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
Name | Number | Description |
---|
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 has never been deployed. If when it's possible to deploy the orders for the first time
margin check fails, then they will be cancelled without any penalties. |
NodeStatus
Node status type
Name | Number | Description |
---|
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
Name | Number | Description |
---|
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
Name | Number | Description |
---|
TIME_IN_FORCE_UNSPECIFIED | 0 | Default value for TimeInForce, can be valid for an amend |
TIME_IN_FORCE_GTC | 1 | Good until cancelled, the order trades any amount and as much as possible
and remains on the book until it either trades completely or is cancelled |
TIME_IN_FORCE_GTT | 2 | Good until specified time, this order type trades any amount and as much as possible
and remains on the book until it either trades completely, is cancelled, or expires at a set time
NOTE: this may in future be multiple types or have sub types for orders that provide different ways of specifying expiry |
TIME_IN_FORCE_IOC | 3 | Immediate or cancel, the order trades any amount and as much as possible
but does not remain on the book (whether it trades or not) |
TIME_IN_FORCE_FOK | 4 | Fill or kill, The order either trades completely (remainingSize == 0 after adding)
or not at all, does not remain on the book if it doesn't trade |
TIME_IN_FORCE_GFA | 5 | Good for auction, this order is only accepted during an auction period |
TIME_IN_FORCE_GFN | 6 | Good for normal, this order is only accepted during normal trading (that can be continuous trading or frequent batched auctions) |
Order.Type
Type values for an order
Name | Number | Description |
---|
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`
Name | Number | Description |
---|
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_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 details of a non pegged details |
ORDER_ERROR_UNABLE_TO_REPRICE_PEGGED_ORDER | 45 | Could not 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
Name | Number | Description |
---|
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
Name | Number | Description |
---|
SIDE_UNSPECIFIED | 0 | Default value, always invalid |
SIDE_BUY | 1 | Buy order |
SIDE_SELL | 2 | Sell order |
Trade.Type
Type values for a trade
Name | Number | Description |
---|
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
Name | Number | Description |
---|
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 |
TRANSFER_TYPE_TRANSFER_FUNDS_SEND | 22 | Transfer funds |
TRANSFER_TYPE_TRANSFER_FUNDS_DISTRIBUTE | 23 | Transfer funds |
ValidatorNodeStatus
Validation status of the node
Name | Number | Description |
---|
VALIDATOR_NODE_STATUS_UNSPECIFIED | 0 | |
VALIDATOR_NODE_STATUS_TENDERMINT | 1 | The node is a tendermint validator |
VALIDATOR_NODE_STATUS_ERSATZ | 2 | The node is an ersatz validator |
VALIDATOR_NODE_STATUS_PENDING | 3 | The node is a pending validator |
Withdrawal.Status
The status of the withdrawal
Name | Number | Description |
---|
STATUS_UNSPECIFIED | 0 | Default value, always invalid |
STATUS_OPEN | 1 | The withdrawal is open and being processed by the network |
STATUS_REJECTED | 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 |