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 ID, used internally by Vega. |
owner | string | 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 ID for the account. |
market_id | string | Market ID for the account, if `AccountType.ACCOUNT_TYPE_GENERAL` this will be empty. |
type | AccountType | Account type related to this account. |
AccountDetails
Name | Type | Description |
---|
asset_id | string | Asset ID of the asset for this account. |
type | AccountType | Type of the account. |
owner | optional string | Not specified if network account. |
market_id | optional string | Not specified if account is not related to a market. |
ActivityStreakBenefitTier
An activity streak benefit tier
Name | Type | Description |
---|
minimum_activity_streak | uint64 | Number of epochs a party must be active to receive the multiplier. |
reward_multiplier | string | Reward multiplier applicable to this tier. |
vesting_multiplier | string | Vesting bonus applicable to this tier. |
ActivityStreakBenefitTiers
A list of activity streak benefit tiers
AuctionIndicativeState
AuctionIndicativeState is used to emit an event with the indicative price/volume per market during an auction
Name | Type | Description |
---|
market_id | string | Market ID for which this state relates to. |
indicative_price | string | Indicative uncrossing price is the price at which all trades would occur if the auction uncrossed now. |
indicative_volume | uint64 | Indicative uncrossing volume is the volume available at the indicative crossing price if the auction uncrossed now. |
auction_start | int64 | Timestamp at which the auction started. |
auction_end | int64 | Timestamp at which the auction is meant to stop. |
BenefitTier
Name | Type | Description |
---|
minimum_running_notional_taker_volume | string | Required running notional taker volume in quantum units for parties
to access this tier. |
minimum_epochs | string | Required number of epochs a party must have been in a referral set to
access this tier. |
referral_reward_factor | string | Proportion of the referee's taker fees to be rewarded to the referrer. |
referral_discount_factor | string | Proportion of the referee's taker fees to be discounted. |
Candle
Represents the high, low, open, and closing prices for an interval of trading,
referred to commonly as a candlestick or candle
Name | Type | Description |
---|
timestamp | int64 | Timestamp in Unix nanoseconds for the point in time when the candle was initially created/opened. |
datetime | string | ISO-8601 datetime with nanosecond precision for when the candle was last updated. |
high | string | Highest price for trading during the candle interval. This field is an unsigned integer scaled to the market's decimal places. |
low | string | Lowest price for trading during the candle interval. This field is an unsigned integer scaled to the market's decimal places. |
open | string | Open trade price. This field is an unsigned integer scaled to the market's decimal places. |
close | string | Closing trade price. This field is an unsigned integer scaled to the market's decimal places. |
volume | uint64 | Total trading volume during the candle interval. |
interval | Interval | Time interval for the candle. |
notional | uint64 | Total notional value traded during the candle interval. |
Delegation
Name | Type | Description |
---|
party | string | Party which is delegating. |
node_id | string | Node ID to delegate to. |
amount | string | Amount delegated. This field is an unsigned integer scaled to the asset's decimal places. |
epoch_seq | string | Epoch of delegation. |
Deposit
Deposit on to the Vega network
Name | Type | Description |
---|
id | string | Unique ID for the deposit. |
status | Deposit.Status | Status of the deposit. |
party_id | string | Party ID of the user initiating the deposit. |
asset | string | Vega asset targeted by this deposit. |
amount | string | Amount to be deposited. This field is an unsigned integer scaled to the asset's decimal places. |
tx_hash | string | 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 | Asset to use for metric. |
metric | DispatchMetric | Metric to apply. |
markets | repeated string | Optional markets in scope. |
entity_scope | EntityScope | Mandatory enum that defines the entities within scope. |
individual_scope | IndividualScope | Optional enum if the entity scope defined is for individuals, which determines the subset of individuals that are eligible to be rewarded. |
team_scope | repeated string | Optional list applicable if the reward type has a scope of teams, which allows the funder to define a list of team IDs that are eligible to be rewarded from this transfer |
n_top_performers | string | The proportion of the top performers in the team for a given metric to be averaged for the metric calculation if the scope is team |
staking_requirement | string | Minimum number of governance (e.g. VEGA) tokens staked for a party to be considered eligible. Defaults to 0 |
notional_time_weighted_average_position_requirement | string | Minimum notional time-weighted averaged position required for a party to be considered eligible. Defaults to 0 |
window_length | uint64 | Number of epochs to evaluate the metric on |
lock_period | uint64 | Number of epochs after distribution to delay vesting of rewards by |
distribution_strategy | DistributionStrategy | Controls how the reward is distributed between qualifying parties |
rank_table | repeated Rank | Ordered list, using start rank, defining the rank bands and share ratio for each band. Mandatory for the rank distribution strategy. |
Epoch
Name | Type | Description |
---|
seq | uint64 | Sequence is used as epoch ID. |
timestamps | EpochTimestamps | Timestamps for start/end etc. |
validators | repeated Node | Validators that participated in this epoch. |
delegations | repeated 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 | |
EpochRewardSummary
Details for rewards for a combination of asset, market, and reward type in a given epoch
Name | Type | Description |
---|
epoch | uint64 | Epoch in which the reward is being paid. |
asset_id | string | Asset ID in which the reward is being paid. |
market_id | string | Market ID in which the reward is being paid. |
reward_type | string | Type of reward being paid. |
amount | string | Amount distributed. This field is an unsigned integer scaled to the asset's decimal places. |
EpochTimestamps
Describes in both human readable and block time when an epoch spans
Name | Type | Description |
---|
start_time | int64 | Timestamp in Unix nanoseconds for when epoch started. |
expiry_time | int64 | Timestamp in Unix nanoseconds for the epoch's expiry. |
end_time | int64 | Timestamp in Unix nanoseconds for when the epoch ended, empty if not ended. |
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
Extension of data required for the withdraw submissions
Name | Type | Description |
---|
receiver_address | string | Address into which the bridge will release the funds. |
ErrorDetail
Represents Vega domain specific error information over gRPC/Protobuf
Name | Type | Description |
---|
code | int32 | Vega API domain specific unique error code, useful for client side mappings, e.g. 10004. |
message | string | 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 ID of this Ethereum network. |
chain_id | string | Chain ID 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 control 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. |
EthereumL2Config
Name | Type | Description |
---|
network_id | string | Network ID of this Ethereum layer 2 network. |
chain_id | string | Chain ID of this Ethereum layer 2 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 the L2 is block 14, block
10 would be considered as trusted, but not block 11. |
name | string | Display name of this network |
EthereumL2Configs
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. This field is an unsigned integer scaled to the asset's decimal places. |
infrastructure_fee | string | Fee amount paid for maintaining the Vega infrastructure. This field is an unsigned integer scaled using the asset's decimal places. |
liquidity_fee | string | Fee amount paid to market makers. This field is an unsigned integer scaled to the asset's decimal places. |
maker_fee_volume_discount | string | Volume discounts.
Discount on maker fee based on the taker volume. |
infrastructure_fee_volume_discount | string | Discount on infrastructure fee based on the taker volume. |
liquidity_fee_volume_discount | string | Discount on liquidity fee basedo on taker volume. |
maker_fee_referrer_discount | string | Referrer discounts.
Discount on maker fee for eligible referrer. |
infrastructure_fee_referrer_discount | string | Discount on infrastructure fee for eligible referrer. |
liquidity_fee_referrer_discount | string | Discount on liquidity fee for eligible referrer. |
FinancialAmount
Asset value information used within a transfer
Name | Type | Description |
---|
amount | string | Unsigned integer amount of asset scaled to the asset's decimal places. |
asset | string | Asset ID the amount applies to. |
IcebergOrder
Details of an iceberg order
Name | Type | Description |
---|
peak_size | uint64 | Size of the order that will be made visible if the iceberg order is replenished after trading. |
minimum_visible_size | uint64 | If the visible size of the order falls below this value, it will be replenished back to the peak size using the reserved amount. |
reserved_remaining | uint64 | Size of the order that is reserved and used to restore the iceberg's peak when it is refreshed. |
KeyValueBundle
LedgerEntry
Represents a ledger entry on Vega
Name | Type | Description |
---|
from_account | AccountDetails | One or more accounts to transfer from. |
to_account | AccountDetails | One or more accounts to transfer to. |
amount | string | Amount to transfer. This field is an unsigned integer scaled to the asset's decimal places. |
type | TransferType | Transfer type for this entry. |
timestamp | int64 | Timestamp in nanoseconds of when the ledger entry was created. |
from_account_balance | string | Sender account balance after the transfer. This field is an unsigned integer scaled to the asset's decimal places. |
to_account_balance | string | Receiver account balance after the transfer. This field is an unsigned integer scaled to the asset's decimal places. |
transfer_id | optional string | Transfer ID the ledger entry relates to. |
LedgerMovement
LiquidityOrder
Represents a liquidity order
Name | Type | Description |
---|
reference | PeggedReference | Pegged reference point for the order. |
proportion | uint32 | Relative proportion of the commitment to be allocated at a price level. |
offset | string | Offset/amount of units away for the order. This field is an unsigned integer scaled using the market's decimal places. |
LiquidityOrderReference
Pair of a liquidity order and the ID of the generated order
Name | Type | Description |
---|
order_id | string | Unique ID of the pegged order generated to fulfil this liquidity order. |
liquidity_order | LiquidityOrder | Liquidity order from the original submission. |
LiquidityProviderFeeShare
Equity like share of liquidity fee for each liquidity provider
Name | Type | Description |
---|
party | string | Liquidity provider party ID. |
equity_like_share | string | Share own by this liquidity provider. |
average_entry_valuation | string | Average entry valuation of the liquidity provider for the market. |
average_score | string | Average liquidity score. |
virtual_stake | string | The virtual stake of this liquidity provider. |
LiquidityProviderSLA
SLA performance for each liquidity provider
Name | Type | Description |
---|
party | string | Liquidity provider party ID. |
current_epoch_fraction_of_time_on_book | string | Indicates how often LP meets the commitment during the current epoch. |
last_epoch_fraction_of_time_on_book | string | Indicates how often LP met the commitment in the previous epoch. |
last_epoch_fee_penalty | string | Indicates the fee penalty amount applied in the previous epoch. |
last_epoch_bond_penalty | string | Shows the bond penalties from past epochs. |
hysteresis_period_fee_penalties | repeated string | Determines how the fee penalties from past epochs affect future fee revenue. |
required_liquidity | string | Represents the total amount of funds LP must supply. The amount to be supplied is in the market’s
settlement currency, spread on both buy and sell sides of the order book within a defined range. |
notional_volume_buys | string | Notional volume of orders within the range provided on the buy side of the book. |
notional_volume_sells | string | Notional volume of orders within the range provided on the sell side of the book. |
LiquidityProvision
Liquidity provider commitment
Name | Type | Description |
---|
id | string | Unique ID for the liquidity provision. |
party_id | string | Unique party ID for the creator of the provision. |
created_at | int64 | Timestamp in Unix nanoseconds for when the liquidity provision was created. |
updated_at | int64 | Timestamp in Unix nanoseconds for when the liquidity provision was updated. |
market_id | string | Market ID for the liquidity provision. |
commitment_amount | string | Specified as a unitless number that represents the amount of settlement asset of the market.
This field is an unsigned integer scaled to the asset's decimal places. |
fee | string | Nominated liquidity fee factor, which is an input to the calculation of taker fees on the market, as per setting fees and rewarding liquidity providers. |
sells | repeated LiquidityOrderReference | Set of liquidity sell orders to meet the liquidity provision obligation. |
buys | repeated LiquidityOrderReference | Set of liquidity buy orders to meet the liquidity provision obligation. |
version | uint64 | Version of this liquidity provision. |
status | LiquidityProvision.Status | Status of this liquidity provision. |
reference | string | 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. This field is an unsigned integer scaled to the asset's decimal places. |
search_level | string | Margin search level value. This field is an unsigned integer scaled to the asset's decimal places. |
initial_margin | string | Initial margin value. This field is an unsigned integer scaled to the asset's decimal places. |
collateral_release_level | string | Collateral release level value. This field is an unsigned integer scaled to the asset's decimal places. |
party_id | string | Party ID for whom the margin levels apply. |
market_id | string | Market ID for which the margin levels apply. |
asset | string | Asset ID for which the margin levels apply. |
timestamp | int64 | Timestamp in Unix nanoseconds for when the ledger entry was created. |
order_margin | string | Margin required to cover orders in isolated margin mode. |
margin_mode | MarginMode | Margin mode for the party, cross margin or isolated margin. |
margin_factor | string | Margin factor, relevant only for isolated margin, 0 otherwise. |
MarketData
Represents data generated by a market when open
Name | Type | Description |
---|
mark_price | string | Mark price, as an unsigned integer, for example `123456` is a correctly
formatted price of `1.23456` assuming market configured to 5 decimal places. |
best_bid_price | string | Highest price level on an order book for buy orders, as an unsigned integer, for example `123456` is a correctly
formatted price of `1.23456` assuming market configured to 5 decimal places. |
best_bid_volume | uint64 | Aggregated volume being bid at the best bid price, as an integer, for example `123456` is a correctly
formatted price of `1.23456` assuming market is configured to 5 decimal places. |
best_offer_price | string | Lowest price level on an order book for offer orders. This field is an unsigned integer scaled to the market's decimal places. |
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 is configured to 5 decimal places. |
best_static_bid_price | string | Highest price on the order book for buy orders not including pegged orders.
This field is an unsigned integer scaled to the market's decimal places. |
best_static_bid_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.
This field is an unsigned integer scaled to the market's decimal places. |
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.
This field is an unsigned integer scaled to the market's decimal places. |
market | string | Market ID for the data |
timestamp | int64 | Timestamp in Unix nanoseconds at which this mark price was relevant. |
open_interest | uint64 | Sum of the size of all positions greater than zero on the market. |
auction_end | int64 | Time in seconds until the end of the auction (zero 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). This field is an unsigned scaled to the market's decimal places. |
indicative_volume | uint64 | Indicative volume (zero if not in auction). |
market_trading_mode | Market.TradingMode | 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. This field is an unsigned integer scaled to the settlement asset's decimal places. |
supplied_stake | string | Available stake for the given market. This field is an unsigned integer scaled to the settlement asset's decimal places. |
price_monitoring_bounds | repeated PriceMonitoringBounds | One or more price monitoring bounds for the current timestamp. |
market_value_proxy | string | Market value proxy. |
liquidity_provider_fee_share | repeated LiquidityProviderFeeShare | Equity like share of liquidity fee for each liquidity provider. |
market_state | Market.State | Current state of the market. |
next_mark_to_market | int64 | Time in Unix nanoseconds when the next mark-to-market calculation will occur. |
last_traded_price | string | Last traded price of the market. This field is an unsigned integer scaled to the market's decimal places. |
market_growth | string | Market growth at the last market time window. |
product_data | optional ProductData | Data related to the particular product type of the market. |
liquidity_provider_sla | repeated LiquidityProviderSLA | SLA performance for each liquidity provider. |
next_network_closeout | int64 | Time in Unix nanoseconds when the market will next submit a trade to reduce its position. |
mark_price_type | CompositePriceType | The method used for calculating the mark price. |
MarketDepth
Represents market depth or order book data for the specified market on Vega
Name | Type | Description |
---|
market_id | string | Market ID for which the depth levels apply. |
buy | repeated PriceLevel | Collection of price levels for the buy side of the book. |
sell | repeated 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 ID for which the market depth updates are for. |
buy | repeated PriceLevel | Collection of updated price levels for the buy side of the book. |
sell | repeated 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 the previous market depth update, for checking there are no gaps. |
MatrixValue
Generic structure holding a key/value pair.
Name | Type | Description |
---|
key | string | Key of the metadata. |
value | string | Value of the metadata. |
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. |
propose_market_enabled | bool | Are market proposals enabled on this chain. |
propose_asset_enabled | bool | Are asset proposals enabled on this chain. |
genesis_loaded | bool | True once the genesis file is loaded. |
propose_market_enabled_from | int64 | Timestamp in Unix nanoseconds at which market proposals will be enabled (0 indicates not set). |
propose_asset_enabled_from | int64 | Timestamp in Unix nanoseconds at which asset proposals will be enabled (0 indicates not set). |
can_propose_spot_market | bool | Are spot market proposals allowed at this point in time. |
can_propose_perpetual_market | bool | Are perpetual market proposals allowed at this point in time. |
NetworkParameter
Represents a network parameter on Vega
Name | Type | Description |
---|
key | string | Unique key of the network parameter. |
value | string | Value for the network parameter. |
Node
Name | Type | Description |
---|
id | string | Node ID i.e. the node's wallet ID. |
pub_key | string | Public key of the node operator. |
tm_pub_key | string | Public key of Tendermint. |
ethereum_address | string | Ethereum public key of the node. |
info_url | string | URL where users can find out more information on the node. |
location | string | Country code for the location of the node. |
staked_by_operator | string | Amount the node operator has put up themselves. This field is an unsigned integer scaled to the asset's decimal places. |
staked_by_delegates | string | Amount of stake that has been delegated by token holders. This field is an unsigned integer scaled to the asset's decimal places. |
staked_total | string | Total amount staked on node. This field is an unsigned integer scaled to the asset's decimal places. |
max_intended_stake | string | Max amount of (wanted) stake. This field is an unsigned integer scaled to the asset's decimal places. |
pending_stake | string | Amount of stake on the next epoch. This field is an unsigned integer scaled to the asset's decimal places. |
epoch_data | EpochData | Information about epoch. |
status | NodeStatus | Node status. |
delegations | repeated 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. This field is an unsigned integer scaled to the asset's decimal places. |
total_nodes | uint32 | Total number of nodes across all node sets. |
inactive_nodes | uint32 | Total number of nodes that had a performance score of 0 at the end of the last epoch. |
tendermint_nodes | NodeSet | Details on the set of consensus nodes in the network. |
ersatz_nodes | NodeSet | Details on the set of ersatz (standby) nodes in the network. |
pending_nodes | NodeSet | Details on the set of pending nodes in the network. |
uptime | float | Total uptime for all epochs across all nodes. |
NodeSet
Details on the collection of nodes for a particular validator status
Name | Type | Description |
---|
total | uint32 | Total number of nodes in the node set. |
inactive | uint32 | Number of nodes in the node set that had a performance score of 0 at the end of the last epoch. |
promoted | repeated string | IDs of nodes that were promoted into this node set at the start of the epoch. |
demoted | repeated string | IDs of nodes that were demoted into this node set at the start of the epoch. |
maximum | optional uint32 | Total number of nodes allowed in the node set. |
Order
Orders can be submitted, amended and cancelled on Vega in an attempt to make trades with other parties
Name | Type | Description |
---|
id | string | Unique ID generated for the order. |
market_id | string | Market ID for the order. |
party_id | string | Party ID 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. |
created_at | int64 | Timestamp for when the order was created at, in nanoseconds. |
status | Order.Status | Current status of the order. |
expires_at | int64 | Timestamp in Unix nanoseconds for when the order will expire. |
reference | string | Reference given for the order. |
reason | optional OrderError | Futher details for why an order with status `STATUS_REJECTED` was rejected. |
updated_at | int64 | Timestamp in Unix nanoseconds for when the order was last updated. |
version | uint64 | Version for the order, initial value is version 1 and is incremented after each successful amend. |
batch_id | uint64 | Batch ID for the order, used internally for orders submitted during auctions
to keep track of the auction batch this order falls under. Required for fees calculation. |
pegged_order | PeggedOrder | Pegged order details, used only if the order represents a pegged order. |
liquidity_provision_id | string | Set if the order was created as part of a liquidity provision, will be empty if not. |
post_only | bool | Only valid for Limit orders. Cannot be True at the same time as Reduce-Only. |
reduce_only | bool | Only valid for Non-Persistent orders. Cannot be True at the same time as Post-Only.
If set, order will only be executed if the outcome of the trade moves the trader's position closer to 0. |
iceberg_order | optional IcebergOrder | Details of an iceberg order |
OrderCancellationConfirmation
Used when cancelling an order
Name | Type | Description |
---|
order | Order | Order that was cancelled. |
OrderConfirmation
Used when confirming an order
Name | Type | Description |
---|
order | Order | Order that was confirmed. |
trades | repeated Trade | 0 or more trades that were emitted. |
passive_orders_affected | repeated Order | 0 or more passive orders that were affected. |
Party
Party represents an entity who wishes to trade on or query a Vega network
Name | Type | Description |
---|
id | string | Unique ID for the party, typically represented by a public key. |
alias | string | Alias given to the party. |
metadata | repeated Metadata | Metadata to associate to a party, in a key/value format where the key
describes the type of metadata in the value field. |
PartyProfile
Holds metadata associated to a party.
Name | Type | Description |
---|
party_id | string | Party ID associated to the profile. |
alias | string | Alias given to the party. |
metadata | repeated Metadata | Metadata to associate to a party, in a key/value format where the key
describes the type of metadata in the value field. |
PeggedOrder
Pegged orders are limit orders where the price is specified in the form REFERENCE +/- OFFSET
They can be used for any limit order that is valid during continuous trading
Name | Type | Description |
---|
reference | PeggedReference | Price point the order is linked to. |
offset | string | Offset from the price reference. |
PerpetualData
Represents market data specific to a perpetual market.
Name | Type | Description |
---|
funding_payment | string | Current funding payment for the in-progress funding period. |
funding_rate | string | Current funding rate for the in-progress funding period. |
internal_twap | string | Time-weighted-average the internal data-points for the in-progress funding period. |
external_twap | string | Time-weighted-average the external data points for the in-progress funding period. |
seq_num | uint64 | Funding period sequence number |
start_time | int64 | Funding period start time |
index_price | string | The index price used for perps. |
next_index_price_calc | int64 | The next time the index price is calculated for perps. |
index_price_type | CompositePriceType | The method used for calculating the index price (perps only). |
Position
Represents position data for a party on the specified market on Vega
Name | Type | Description |
---|
market_id | string | Market ID in which the position is held. |
party_id | string | Party ID holding the position. |
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.
This field is a signed integer scaled to the market's decimal places. |
unrealised_pnl | string | Unrealised profit and loss for the position, value is signed +ve for long and -ve for short.
This field is a signed integer scaled to the market's decimal places. |
average_entry_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. |
loss_socialisation_amount | string | Sum of profit that could not be paid due to loss socialisation. |
position_status | PositionStatus | Position status, indicating whether the party was distressed and had orders cancelled or was closed out. |
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. |
PostTransferBalance
Represents the balance for an account during a transfer
Name | Type | Description |
---|
account | AccountDetails | Account relating to the transfer. |
balance | string | Balance relating to the transfer. This field is an unsigned integer scaled to the asset's decimal places. |
PriceLevel
Represents a price level from market depth or order book data
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. This field
is an unsigned integer passed as a string and needs to be scaled using the market's 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.
This field is an unsigned integer scaled to the market's decimal places. |
max_valid_price | string | Maximum price that isn't currently breaching the specified price monitoring trigger.
This field is an unsigned integer scaled to the market's decimal places. |
trigger | PriceMonitoringTrigger | Price monitoring trigger associated with the bounds. |
reference_price | string | Reference price used to calculate the valid price range. This field is an unsigned integer scaled to the market's decimal places. |
ProductData
Represents market data specific to a particular product type.
Rank
Name | Type | Description |
---|
start_rank | uint32 | |
share_ratio | uint32 | |
RankingScore
Name | Type | Description |
---|
stake_score | string | Stake based score - no anti-whaling. |
performance_score | string | Performance based score. |
previous_status | ValidatorNodeStatus | Status of the validator in the previous epoch. |
status | ValidatorNodeStatus | Status of the validator in the current epoch. |
voting_power | uint32 | Tendermint voting power of the validator. |
ranking_score | string | Final score. |
ReferralProgram
Name | Type | Description |
---|
version | uint64 | Incremental version of the program. It is incremented after each program
update. |
id | string | Unique ID generated from the proposal that created this program. |
benefit_tiers | repeated BenefitTier | Defined benefit tiers ordered by increasing discounts. |
end_of_program_timestamp | int64 | Timestamp in Unix nanoseconds, after which when the current epoch ends,
the program will end and benefits will be disabled. |
window_length | uint64 | Number of epochs over which the referral set's running volume is evaluated. |
staking_tiers | repeated StakingTier | Defined benefit tiers ordered by increasing reward multiplier. Determines the level of
benefit a party can expect based on their staking. |
Reward
Details for a single reward payment
Name | Type | Description |
---|
asset_id | string | Asset ID in which the reward is being paid. |
party_id | string | Party ID to whom the reward is being paid. |
epoch | uint64 | Epoch in which the reward is being paid. |
amount | string | Amount paid as a reward. This field is an unsigned integer scaled to the asset's decimal places. |
percentage_of_total | string | Percentage of total rewards paid in the epoch. |
received_at | int64 | Timestamp at which the reward was paid as Unix nano time. |
market_id | string | Market ID in which the reward is being paid. |
reward_type | string | Type of reward being paid. |
locked_until_epoch | uint64 | The epoch when the reward is being released. |
quantum_amount | string | Amount paid as a reward, expressed in asset's quantum unit. |
game_id | optional string | ID of the game the reward payment was made for if the payment was made for participation in a game. |
team_id | optional string | ID of the team the party is a member of, if the party is a member of a participating team,
and the reward payment was made for participation in a game.
This field is currently only populated by the rewards API. |
RewardScore
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 | Status of the validator for reward. |
RewardSummary
Details for rewards for a single asset
Name | Type | Description |
---|
asset_id | string | Asset ID in which the reward is being paid. |
party_id | string | Party ID to whom the reward is being paid. |
amount | string | Total amount of rewards paid in the asset. This field is an unsigned integer scaled to the asset's decimal places. |
RiskFactor
Risk factors are used to calculate the current risk associated with orders trading on a given market
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 | |
StakingTier
Name | Type | Description |
---|
minimum_staked_tokens | string | Required number of governance tokens ($VEGA) a referrer must have staked to
receive the multiplier. |
referral_reward_multiplier | string | Multiplier applied to the referral reward factor when calculating referral
rewards due to the referrer. |
StateValueProposal
Name | Type | Description |
---|
state_var_id | string | State variable ID. |
event_id | string | Event ID. |
kvb | repeated KeyValueBundle | Key value tolerance triplets. |
StateVarValue
StopOrder
Name | Type | Description |
---|
id | string | ID of this stop order
also the ID of the associated order if it is ever triggered |
oco_link_id | optional string | The ID of the 'other' part of the OCO if 2 stop orders were submitted at once |
expires_at | optional int64 | Optional expiry timestamp. |
expiry_strategy | optional StopOrder.ExpiryStrategy | Strategy to adopt if the expiry time is reached. |
trigger_direction | StopOrder.TriggerDirection | Trigger direction for this stop order. |
status | StopOrder.Status | Status of the stop order. |
created_at | int64 | Creation time of the stop order. |
updated_at | optional int64 | Last update of this stop order. |
order_id | string | ID of the order created once the trigger is hit. |
party_id | string | ID of the party that submitted this stop order. |
market_id | string | ID of the market the stop order is submitted to. |
rejection_reason | optional StopOrder.RejectionReason | An optional reason for why a stop order was rejected |
size_override_setting | StopOrder.SizeOverrideSetting | Size override setting |
size_override_value | optional StopOrder.SizeOverrideValue | Size override value |
price | string | Fixed price at which the order will be submitted. |
trailing_percent_offset | string | Trailing percentage at which the order will be submitted.
This should be expressed as a decimal value between 0 and 1, e.g. 0.01 for 1% |
StopOrder.SizeOverrideValue
Name | Type | Description |
---|
percentage | string | Scaling percentage of the current position’s size |
Trade
A trade occurs when an aggressive order crosses one or more passive orders on the order book for a market on Vega
Name | Type | Description |
---|
id | string | Unique ID for the trade. |
market_id | string | Market ID on which the trade occurred. |
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 ID for the buyer. |
seller | string | Unique party ID for the seller. |
aggressor | Side | Direction of the aggressive party e.g. SIDE_BUY or SIDE_SELL. |
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 in Unix nanoseconds for when the trade occurred. |
type | Trade.Type | Type for the trade. |
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. |
asset_price | string | Price for the trade using asset decimals, as opposed to market decimals used
in the price field. This is only used in trade events for position updates. |
TradeSet
Transfer
Represents a financial transfer within Vega
Name | Type | Description |
---|
owner | string | Party ID for the owner of the transfer. |
amount | FinancialAmount | Financial amount of an asset to transfer. |
type | TransferType | Type of transfer, gives the reason for the transfer. |
min_amount | string | Minimum amount. This field is an unsigned integer scaled to the asset's decimal places. |
market_id | string | Market ID the transfer is for |
TransferRequest
Represents a request to transfer from one set of accounts to another
Name | Type | Description |
---|
from_account | repeated Account | One or more accounts to transfer from. |
to_account | repeated Account | One or more accounts to transfer to. |
amount | string | Amount to transfer for the asset. This field is an unsigned integer scaled to the asset's decimal places. |
min_amount | string | Minimum amount that needs to be transferred for the transfer request. If this minimum isn't reached, it will error.
This field is an unsigned integer scaled to the asset's decimal places. |
asset | string | Asset ID of the asset being transferred. |
type | TransferType | Type of the request for transfer. |
VectorValue
Name | Type | Description |
---|
value | repeated string | |
VestingBenefitTier
Name | Type | Description |
---|
minimum_quantum_balance | string | |
reward_multiplier | string | |
VestingBenefitTiers
VolumeBenefitTier
Name | Type | Description |
---|
minimum_running_notional_taker_volume | string | Required running notional taker volume in quantum units for parties
to access this tier. |
volume_discount_factor | string | Proportion of the taker fees to be discounted. |
VolumeDiscountProgram
Name | Type | Description |
---|
version | uint64 | Incremental version of the program. It is incremented after each program
update. |
id | string | Unique ID generated from the proposal that created this program. |
benefit_tiers | repeated VolumeBenefitTier | Defined benefit tiers ordered by increasing discounts. |
end_of_program_timestamp | int64 | Timestamp in Unix seconds, after which when the current epoch
ends, the program will end and benefits will be disabled. |
window_length | uint64 | Number of epochs over which a referral set's running volume is evaluated. |
WithdrawExt
Withdrawal external details
Withdrawal
Withdrawal from the Vega network
Name | Type | Description |
---|
id | string | Unique ID for the withdrawal. |
party_id | string | Unique party ID of the user initiating the withdrawal. |
amount | string | Amount to be withdrawn. This field is an unsigned integer scaled to the asset's decimal places. |
asset | string | Asset to withdraw funds from. |
status | Withdrawal.Status | Status of the withdrawal. |
ref | string | Reference which is used by the foreign chain
to refer to this withdrawal. |
tx_hash | string | 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.
Required initial margin is allocated to each market from user's general account.
Collateral in the margin account can't be withdrawn or used as margin on another market until
it is released back to the general account.
Vega protocol uses an internal accounting system to segregate funds held as
margin from other funds to ensure they are never lost or 'double spent'
Margin account funds will vary as margin requirements on positions change |
ACCOUNT_TYPE_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_MAKER_PAID_FEES | 14 | Per asset reward account for fees paid to makers |
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 |
ACCOUNT_TYPE_HOLDING | 18 | Per asset account for holding in-flight unfilled orders' funds |
ACCOUNT_TYPE_LP_LIQUIDITY_FEES | 19 | Network controlled liquidity provider's account, per market, to hold accrued liquidity fees. |
ACCOUNT_TYPE_LIQUIDITY_FEES_BONUS_DISTRIBUTION | 20 | Network controlled liquidity fees bonus distribution account, per market. |
ACCOUNT_TYPE_NETWORK_TREASURY | 21 | Network controlled treasury |
ACCOUNT_TYPE_VESTING_REWARDS | 22 | Account holding user's rewards for the vesting period |
ACCOUNT_TYPE_VESTED_REWARDS | 23 | Account holding user's rewards after the vesting period |
ACCOUNT_TYPE_REWARD_AVERAGE_POSITION | 24 | Per asset market reward account given for average position |
ACCOUNT_TYPE_REWARD_RELATIVE_RETURN | 25 | Per asset market reward account given for relative return |
ACCOUNT_TYPE_REWARD_RETURN_VOLATILITY | 26 | Per asset market reward account given for return volatility |
ACCOUNT_TYPE_REWARD_VALIDATOR_RANKING | 27 | Per asset market reward account given to validators by their ranking |
ACCOUNT_TYPE_PENDING_FEE_REFERRAL_REWARD | 28 | Per asset account for pending fee referral reward payouts |
ACCOUNT_TYPE_ORDER_MARGIN | 29 | Per asset market account for party in isolated margin mode |
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 | Deprecated |
AUCTION_TRIGGER_LIQUIDITY_TARGET_NOT_MET | 5 | Liquidity auction due to not enough committed liquidity |
AUCTION_TRIGGER_UNABLE_TO_DEPLOY_LP_ORDERS | 6 | Deprecated |
AUCTION_TRIGGER_GOVERNANCE_SUSPENSION | 7 | Market is suspended and put into auction via governance |
ChainStatus
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
Status of the deposit
Name | Number | Description |
---|
STATUS_UNSPECIFIED | 0 | Default value, always invalid |
STATUS_OPEN | 1 | Deposit is being processed by the network |
STATUS_CANCELLED | 2 | Deposit has been cancelled by the network |
STATUS_FINALIZED | 3 | Deposit has been finalised and accounts have been updated |
DispatchMetric
Name | Number | Description |
---|
DISPATCH_METRIC_UNSPECIFIED | 0 | |
DISPATCH_METRIC_MAKER_FEES_PAID | 1 | Dispatch metric that uses the total maker fees paid in the market |
DISPATCH_METRIC_MAKER_FEES_RECEIVED | 2 | Dispatch metric that uses the total maker fees received in the market |
DISPATCH_METRIC_LP_FEES_RECEIVED | 3 | Dispatch metric that uses the total LP fees received in the market |
DISPATCH_METRIC_MARKET_VALUE | 4 | Dispatch metric that uses total value of the market if above the required threshold and not paid given proposer bonus yet |
DISPATCH_METRIC_AVERAGE_POSITION | 5 | Dispatch metric that uses the time weighted average position |
DISPATCH_METRIC_RELATIVE_RETURN | 6 | Dispatch metric that uses the relative PNL of the party in the market |
DISPATCH_METRIC_RETURN_VOLATILITY | 7 | Dispatch metric that uses return volatility of the party in the market |
DISPATCH_METRIC_VALIDATOR_RANKING | 8 | Dispatch metric that uses the validator ranking of the validator as metric |
DistributionStrategy
Name | Number | Description |
---|
DISTRIBUTION_STRATEGY_UNSPECIFIED | 0 | |
DISTRIBUTION_STRATEGY_PRO_RATA | 1 | Rewards funded using the pro-rata strategy should be distributed pro-rata by each entity's reward metric, scaled by any active multipliers that party has. |
DISTRIBUTION_STRATEGY_RANK | 2 | Rewards funded using the party rank. |
EntityScope
Name | Number | Description |
---|
ENTITY_SCOPE_UNSPECIFIED | 0 | |
ENTITY_SCOPE_INDIVIDUALS | 1 | Rewards must be distributed directly to eligible parties. |
ENTITY_SCOPE_TEAMS | 2 | Rewards must be distributed to directly eligible teams, and then amongst team members |
EpochAction
What epoch action has occurred
Name | Number | Description |
---|
EPOCH_ACTION_UNSPECIFIED | 0 | |
EPOCH_ACTION_START | 1 | Epoch update is for a new epoch. |
EPOCH_ACTION_END | 2 | Epoch update is for the end of an epoch. |
IndividualScope
Name | Number | Description |
---|
INDIVIDUAL_SCOPE_UNSPECIFIED | 0 | |
INDIVIDUAL_SCOPE_ALL | 1 | All parties on the network are within the scope of this reward. |
INDIVIDUAL_SCOPE_IN_TEAM | 2 | All parties that are part of a team are within the scope of this reward. |
INDIVIDUAL_SCOPE_NOT_IN_TEAM | 3 | All parties that are not part of a team are within the scope of this reward. |
Interval
Represents a set of time intervals that are used when querying for candle-stick data
Name | Number | Description |
---|
INTERVAL_UNSPECIFIED | 0 | Default value, always invalid |
INTERVAL_BLOCK | -1 | Block interval is not a fixed amount of time, rather it is used to indicate grouping of events that occur in a single block. It is usually about a second. |
INTERVAL_I1M | 60 | 1 minute. |
INTERVAL_I5M | 300 | 5 minutes. |
INTERVAL_I15M | 900 | 15 minutes. |
INTERVAL_I30M | 1800 | 30 minutes. |
INTERVAL_I1H | 3600 | 1 hour. |
INTERVAL_I4H | 14400 | 4 hours. |
INTERVAL_I6H | 21600 | 6 hours. |
INTERVAL_I8H | 28800 | 8 hours. |
INTERVAL_I12H | 43200 | 12 hours. |
INTERVAL_I1D | 86400 | 1 day. |
INTERVAL_I7D | 604800 | 7 days. |
LiquidityProvision.Status
Status of a liquidity provision.
Name | Number | Description |
---|
STATUS_UNSPECIFIED | 0 | Always invalid |
STATUS_ACTIVE | 1 | Liquidity provision is active |
STATUS_STOPPED | 2 | Liquidity provision was stopped by the network |
STATUS_CANCELLED | 3 | Liquidity provision was cancelled by the liquidity provider |
STATUS_REJECTED | 4 | Liquidity provision was invalid and got rejected |
STATUS_UNDEPLOYED | 5 | Liquidity provision is valid and accepted by network, but orders aren't deployed |
STATUS_PENDING | 6 | 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. |
MarginMode
Name | Number | Description |
---|
MARGIN_MODE_UNSPECIFIED | 0 | Never valid. |
MARGIN_MODE_CROSS_MARGIN | 1 | Cross margin mode - margin is dynamically acquired and released as a position is marked to market |
MARGIN_MODE_ISOLATED_MARGIN | 2 | Isolated margin mode - margin for any newly opened position volume is transferred to the margin account when the trade is executed |
NodeStatus
Node status type
Name | Number | Description |
---|
NODE_STATUS_UNSPECIFIED | 0 | |
NODE_STATUS_VALIDATOR | 1 | Node is a validating node |
NODE_STATUS_NON_VALIDATOR | 2 | Node is a non-validating node |
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 and liquidity orders (orders created from a liquidity provision shape) |
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 i.e. remainingSize == 0 after adding,
or not at all, and does not remain on the book if it doesn't trade |
TIME_IN_FORCE_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.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 ID |
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 | 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 ID) |
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 ID |
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_CANNOT_SEND_GFN_ORDER_DURING_AN_AUCTION | 24 | Good For Normal order has reached the market when it is in auction mode |
ORDER_ERROR_CANNOT_SEND_GFA_ORDER_DURING_CONTINUOUS_TRADING | 25 | Good For Auction order has reached 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 | 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 | FOK, IOC, or GFN order was rejected because it resulted in trades outside the price bounds |
ORDER_ERROR_TOO_MANY_PEGGED_ORDERS | 48 | Unable to submit pegged order, temporarily too many pegged orders across all markets |
ORDER_ERROR_POST_ONLY_ORDER_WOULD_TRADE | 49 | Post order would trade |
ORDER_ERROR_REDUCE_ONLY_ORDER_WOULD_NOT_REDUCE_POSITION | 50 | Post order would trade |
ORDER_ERROR_ISOLATED_MARGIN_CHECK_FAILED | 51 | Isolated margin check failed |
ORDER_ERROR_PEGGED_ORDERS_NOT_ALLOWED_IN_ISOLATED_MARGIN_MODE | 52 | In isolated margin pegged orders are rejected |
PeggedReference
Pegged reference defines which price point a pegged order is linked to - meaning
the price for a pegged order is calculated from the value of the reference price point
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 |
PositionStatus
Represents the status of a position
Name | Number | Description |
---|
POSITION_STATUS_UNSPECIFIED | 0 | |
POSITION_STATUS_ORDERS_CLOSED | 1 | |
POSITION_STATUS_CLOSED_OUT | 2 | |
POSITION_STATUS_DISTRESSED | 4 | |
Side
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 |
StopOrder.ExpiryStrategy
Name | Number | Description |
---|
EXPIRY_STRATEGY_UNSPECIFIED | 0 | Never valid |
EXPIRY_STRATEGY_CANCELS | 1 | Stop order should be cancelled if the expiry time is reached. |
EXPIRY_STRATEGY_SUBMIT | 2 | Order should be submitted if the expiry time is reached. |
StopOrder.RejectionReason
Name | Number | Description |
---|
REJECTION_REASON_UNSPECIFIED | 0 | Never valid |
REJECTION_REASON_TRADING_NOT_ALLOWED | 1 | Trading is not allowed yet |
REJECTION_REASON_EXPIRY_IN_THE_PAST | 2 | Expiry of the stop order is in the past |
REJECTION_REASON_MUST_BE_REDUCE_ONLY | 3 | Stop orders submission must be reduce only |
REJECTION_REASON_MAX_STOP_ORDERS_PER_PARTY_REACHED | 4 | Party has reached the maximum stop orders allowed for this market |
REJECTION_REASON_STOP_ORDER_NOT_ALLOWED_WITHOUT_A_POSITION | 5 | Stop orders are not allowed if there is no open position |
REJECTION_REASON_STOP_ORDER_NOT_CLOSING_THE_POSITION | 6 | This stop order does not close the position |
REJECTION_REASON_STOP_ORDER_LINKED_PERCENTAGE_INVALID | 7 | The percentage value for the linked stop order is invalid |
REJECTION_REASON_STOP_ORDER_NOT_ALLOWED_DURING_OPENING_AUCTION | 8 | Stop orders are not allowed during the opening auction |
REJECTION_REASON_STOP_ORDER_CANNOT_MATCH_OCO_EXPIRY_TIMES | 9 | Stop OCO orders cannot have the same expiry timestamp |
StopOrder.SizeOverrideSetting
Name | Number | Description |
---|
SIZE_OVERRIDE_SETTING_UNSPECIFIED | 0 | Never valid |
SIZE_OVERRIDE_SETTING_NONE | 1 | No override, the size within the contained normal order submission will be used |
SIZE_OVERRIDE_SETTING_POSITION | 2 | Use the total position of the trader |
StopOrder.Status
Name | Number | Description |
---|
STATUS_UNSPECIFIED | 0 | Never valid |
STATUS_PENDING | 1 | Pending to be executed once the trigger is breached |
STATUS_CANCELLED | 2 | Cancelled by the user |
STATUS_STOPPED | 3 | Stopped by the network, e.g: OCO on the other side has been triggered |
STATUS_TRIGGERED | 4 | Stop order has been triggered and generated an order |
STATUS_EXPIRED | 5 | Stop order has expired |
STATUS_REJECTED | 6 | Stop order was rejected at submission |
StopOrder.TriggerDirection
Name | Number | Description |
---|
TRIGGER_DIRECTION_UNSPECIFIED | 0 | Never valid |
TRIGGER_DIRECTION_RISES_ABOVE | 1 | Stop order is triggered once the price rises above a certain level |
TRIGGER_DIRECTION_FALLS_BELOW | 2 | Stop order is triggered once the price falls below a certain level |
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 | Funds deducted after final settlement loss |
TRANSFER_TYPE_WIN | 2 | Funds added to general account after final settlement gain |
TRANSFER_TYPE_MTM_LOSS | 4 | Funds deducted from margin account after mark to market loss |
TRANSFER_TYPE_MTM_WIN | 5 | Funds added to margin account after mark to market gain |
TRANSFER_TYPE_MARGIN_LOW | 6 | Funds transferred from general account to meet margin requirement |
TRANSFER_TYPE_MARGIN_HIGH | 7 | Excess margin amount returned to general account |
TRANSFER_TYPE_MARGIN_CONFISCATED | 8 | Margin confiscated from margin account to fulfil closeout |
TRANSFER_TYPE_MAKER_FEE_PAY | 9 | Maker fee paid from general account |
TRANSFER_TYPE_MAKER_FEE_RECEIVE | 10 | Maker fee received into general account |
TRANSFER_TYPE_INFRASTRUCTURE_FEE_PAY | 11 | Infrastructure fee paid from general account |
TRANSFER_TYPE_INFRASTRUCTURE_FEE_DISTRIBUTE | 12 | Infrastructure fee received into general account |
TRANSFER_TYPE_LIQUIDITY_FEE_PAY | 13 | Liquidity fee paid from general account |
TRANSFER_TYPE_LIQUIDITY_FEE_DISTRIBUTE | 14 | Liquidity fee received into general account |
TRANSFER_TYPE_BOND_LOW | 15 | Bond account funded from general account to meet required bond amount |
TRANSFER_TYPE_BOND_HIGH | 16 | Bond returned to general account after liquidity commitment was reduced |
TRANSFER_TYPE_WITHDRAW | 18 | Funds withdrawn from general account |
TRANSFER_TYPE_DEPOSIT | 19 | Funds deposited to general account |
TRANSFER_TYPE_BOND_SLASHING | 20 | Bond account penalised when liquidity commitment not met |
TRANSFER_TYPE_REWARD_PAYOUT | 21 | Reward payout received |
TRANSFER_TYPE_TRANSFER_FUNDS_SEND | 22 | Internal Vega network instruction for the collateral engine to move funds from a user's general account into the pending transfers pool |
TRANSFER_TYPE_TRANSFER_FUNDS_DISTRIBUTE | 23 | Internal Vega network instruction for the collateral engine to move funds from the pending transfers pool account into the destination account |
TRANSFER_TYPE_CLEAR_ACCOUNT | 24 | Market-related accounts emptied because market has closed |
TRANSFER_TYPE_CHECKPOINT_BALANCE_RESTORE | 25 | Balances restored after network restart |
TRANSFER_TYPE_SPOT | 26 | Spot trade delivery |
TRANSFER_TYPE_HOLDING_LOCK | 27 | An internal instruction to transfer a quantity corresponding to an active spot order from a general account into a party holding account. |
TRANSFER_TYPE_HOLDING_RELEASE | 28 | An internal instruction to transfer an excess quantity corresponding to an active spot order from a holding account into a party general account. |
TRANSFER_TYPE_SUCCESSOR_INSURANCE_FRACTION | 29 | Insurance pool fraction transfer from parent to successor market. |
TRANSFER_TYPE_LIQUIDITY_FEE_ALLOCATE | 30 | Allocates liquidity fee earnings to each liquidity provider's network controlled liquidity fee account. |
TRANSFER_TYPE_LIQUIDITY_FEE_NET_DISTRIBUTE | 31 | Distributes net fee earnings from liquidity provider's fee account to their general account. |
TRANSFER_TYPE_SLA_PENALTY_BOND_APPLY | 32 | Applies SLA penalty by moving funds from party's bond account to market's insurance pool. |
TRANSFER_TYPE_SLA_PENALTY_LP_FEE_APPLY | 33 | Applies SLA penalty by moving funds from the liquidity provider's fee account to market insurance pool. |
TRANSFER_TYPE_LIQUIDITY_FEE_UNPAID_COLLECT | 34 | Collects penalties from the liquidity provider's fee account before the fee revenue is paid, and transfers it to the market's bonus distribution account. |
TRANSFER_TYPE_SLA_PERFORMANCE_BONUS_DISTRIBUTE | 35 | Distributes performance bonus from market bonus to liquidity provider's general account. |
TRANSFER_TYPE_PERPETUALS_FUNDING_LOSS | 36 | Funds deducted from margin account after a perpetuals funding loss. |
TRANSFER_TYPE_PERPETUALS_FUNDING_WIN | 37 | Funds added to margin account after a perpetuals funding gain. |
TRANSFER_TYPE_REWARDS_VESTED | 38 | Funds moved from the vesting account to the vested account once the vesting period is reached. |
TRANSFER_TYPE_FEE_REFERRER_REWARD_PAY | 39 | Fee referrer reward paid from general account. |
TRANSFER_TYPE_FEE_REFERRER_REWARD_DISTRIBUTE | 44 | Fee referrer reward received into general account of the referrer. |
TRANSFER_TYPE_ORDER_MARGIN_LOW | 45 | Funds transferred from general account to meet order margin requirement in isolated margin mode. |
TRANSFER_TYPE_ORDER_MARGIN_HIGH | 46 | Excess order margin amount returned to general account. |
TRANSFER_TYPE_ISOLATED_MARGIN_LOW | 47 | Transfer from order margin account to margin account due to increase of position. |
TRANSFER_TYPE_ISOLATED_MARGIN_HIGH | 48 | Transfer from excess order margin account to general account. |
ValidatorNodeStatus
Validation status of the node
Name | Number | Description |
---|
VALIDATOR_NODE_STATUS_UNSPECIFIED | 0 | |
VALIDATOR_NODE_STATUS_TENDERMINT | 1 | Node is a tendermint validator |
VALIDATOR_NODE_STATUS_ERSATZ | 2 | Node is an ersatz validator |
VALIDATOR_NODE_STATUS_PENDING | 3 | Node is a pending validator |
Withdrawal.Status
Status of the withdrawal
Name | Number | Description |
---|
STATUS_UNSPECIFIED | 0 | Default value, always invalid |
STATUS_OPEN | 1 | Withdrawal is open and being processed by the network |
STATUS_REJECTED | 2 | Withdrawal have been cancelled |
STATUS_FINALIZED | 3 | 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 |