trading_data.proto
path data-node/api/v2/trading_data.proto
package datanode.api.v2
Messages
AccountBalance
Represents the current balance of an account for an asset on Vega, for a particular owner or party
Name | Type | Description |
---|
owner | string | Unique account ID used internally by Vega
string id = 1;
Party that owns the account.
Special values include `network` - represents the Vega network and is
most commonly seen during liquidation of a distressed trading position. |
balance | string | Asset balance represented as an integer, for example `123456` is a correctly
formatted price of `1.23456` assuming market configured to 5 decimal places.
Balances cannot be negative. |
asset | string | Asset ID for the account. |
market_id | string | Market ID for the account, this field will be empty if the asset is in a general account. |
type | vega.AccountType | Account type of this account. |
AccountEdge
Account data item with the corresponding cursor.
Name | Type | Description |
---|
node | AccountBalance | Account balance data. |
cursor | string | Cursor that can be used to fetch further pages with reference to this account. |
AccountFilter
Filter that is used to filter account data by asset ID, party ID, market ID and account type
Name | Type | Description |
---|
asset_id | string | Restrict accounts to those holding balances in this asset ID. |
party_ids | string | Restrict accounts to those owned by the parties in this list. Pass an empty list for no filter. |
market_ids | string | Restrict accounts to those connected to the markets in this list. Pass an empty list for no filter. |
account_types | vega.AccountType | Restrict accounts to those connected to any of the types in this list. Pass an empty list for no filter. |
AccountSnapshotPage
'Initial image' snapshot containing current account balances - may be sent over several response messages
Name | Type | Description |
---|
accounts | AccountBalance | List of account balances. |
last_page | bool | Indicator if the current page is the last one or not. |
AccountUpdates
List of account updates in the last block
AccountsConnection
Page of accounts data and corresponding page information.
Name | Type | Description |
---|
edges | AccountEdge | Page of accounts data and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
AggregatedBalance
AggregatedBalance data contains the balance of the set of requested accounts combined with corresponding
party ID, market ID and account type details
Name | Type | Description |
---|
timestamp | int64 | Timestamp to of block the balance is referring to, in nanoseconds. |
balance | string | Balance of the set of requested accounts at the time above. |
party_id | string | If grouping by party, the party ID. |
asset_id | string | If grouping by asset, the asset ID. |
market_id | string | If grouping by market, the market ID |
account_type | vega.AccountType | If grouping by account type, the account type. |
AggregatedBalanceConnection
Page of aggregated balance objects and corresponding page information
Name | Type | Description |
---|
edges | AggregatedBalanceEdge | Page of aggregated balance data and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
AggregatedBalanceEdge
Aggregated balance data with the corresponding cursor.
Name | Type | Description |
---|
node | AggregatedBalance | Balance of the set of requested accounts. |
cursor | string | Cursor that can be used to fetch further pages. |
AggregatedLedgerEntriesConnection
Page of aggregated ledger entries data and corresponding page information
Name | Type | Description |
---|
edges | AggregatedLedgerEntriesEdge | Page of 'AggregatedLedgerEntry' data and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
AggregatedLedgerEntriesEdge
Represents the aggregated ledger entry data with corresponding cursor for it
Name | Type | Description |
---|
node | AggregatedLedgerEntry | 'AggregatedLedgerEntry' data. |
cursor | string | Cursor that can be used to fetch further pages. |
AggregatedLedgerEntry
Represents an aggregated view of ledger entry data, sender and receiver accounts,
details and balances for both sides after the transfer has been made
Name | Type | Description |
---|
timestamp | int64 | Timestamp to of block the result is referring to, in nanoseconds. |
quantity | string | Amount of ledger entries for the set of requested accounts at the time above. |
transfer_type | vega.TransferType | Transfer type. |
asset_id | string | Asset ID for the asset associated with the entry. |
from_account_type | vega.AccountType | Type of account sent from. |
to_account_type | vega.AccountType | Type of account received to. |
from_account_party_id | string | Sender's party ID. |
to_account_party_id | string | Receiver's party ID. |
from_account_market_id | string | Sender market ID. |
to_account_market_id | string | Receiver market ID. |
from_account_balance | string | Sender account balance after the transfer. |
to_account_balance | string | Receiver account balance after the transfer. |
AssetEdge
Assets data with the corresponding cursor.
Name | Type | Description |
---|
node | vega.Asset | Asset data returned. |
cursor | string | Cursor that can be used to fetch further pages. |
AssetsConnection
Page of asset data and corresponding page information
Name | Type | Description |
---|
edges | AssetEdge | Page of assets data and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
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 |
---|
start | int64 | Timestamp for the point in time when the candle was initially created/opened, in nanoseconds. |
last_update | int64 | Timestamp for the point in time when the candle was last updated, in nanoseconds. |
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. |
CandleDataConnection
Page of candles data and corresponding page information
Name | Type | Description |
---|
edges | CandleEdge | Page of candle data items and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
CandleEdge
Candle data with the corresponding cursor.
Name | Type | Description |
---|
node | Candle | Candlestick data, i.e. high, low, open, and closing prices for an interval of trading. |
cursor | string | Cursor that can be used to fetch further pages. |
Checkpoint
Actual data regarding a checkpoint
Name | Type | Description |
---|
hash | string | Hash of the checkpoint. |
block_hash | string | Block hash at which the checkpoint is made. |
at_block | uint64 | Block number at which the checkpoint is made. |
CheckpointEdge
Checkpoint data with the corresponding cursor.
Name | Type | Description |
---|
node | Checkpoint | Data relating to a single checkpoint generated by the Vega network. |
cursor | string | Cursor that can be used to fetch further pages. |
CheckpointsConnection
Page of checkpoints data and corresponding page information
Name | Type | Description |
---|
edges | CheckpointEdge | Page of checkpoints data and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
CoreSnapshotConnection
Page of core snapshot data and corresponding page information.
Name | Type | Description |
---|
edges | CoreSnapshotEdge | Page of core snapshot data and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
CoreSnapshotEdge
Core snapshot data with the corresponding cursor.
DateRange
Date range for queries that can return historical data
Timestamps should be provided as unix time in nanoseconds and are inclusive.
Name | Type | Description |
---|
start_timestamp | int64 | |
end_timestamp | int64 | |
DelegationEdge
Delegation data with the corresponding cursor.
Name | Type | Description |
---|
node | vega.Delegation | How much a party is delegating to a node and when. |
cursor | string | Cursor that can be used to fetch further pages. |
DelegationsConnection
Page of delegations data and corresponding page information
Name | Type | Description |
---|
edges | DelegationEdge | Page of delegations data and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
DepositEdge
Deposits data with the corresponding cursor.
Name | Type | Description |
---|
node | vega.Deposit | Data associated with a single deposit made on the Vega network. |
cursor | string | Cursor that can be used to fetch further pages. |
DepositsConnection
Page of deposits data received and corresponding page information
Name | Type | Description |
---|
edges | DepositEdge | Page of deposits data and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
ERC20MultiSigSignerAddedBundle
Signature bundle data to be added
Name | Type | Description |
---|
new_signer | string | Ethereum address of the signer to be removed. |
submitter | string | Ethereum address of the submitter. |
nonce | string | Nonce used in the signing operation. |
timestamp | int64 | Unixnano timestamp for when the validator was added. |
signatures | string | Bundle of signatures from current validators to sign in the new signer. |
epoch_seq | string | Epoch in which the validator was added. |
ERC20MultiSigSignerAddedBundleEdge
Signature bundle data that is to be added with the corresponding cursor.
ERC20MultiSigSignerAddedConnection
Page of signature data items to be added and corresponding page information
ERC20MultiSigSignerAddedEdge
Signature data that is to be added with the corresponding cursor.
ERC20MultiSigSignerRemovedBundle
Signature bundle data to be removed
Name | Type | Description |
---|
old_signer | string | Ethereum address of the signer to be removed. |
submitter | string | Ethereum address of the submitter. |
nonce | string | Nonce used in the signing operation. |
timestamp | int64 | Unixnano timestamp for when the validator was added. |
signatures | string | Bundle of signatures from current validators to sign in the new signer. |
epoch_seq | string | Epoch in which the validator was removed. |
ERC20MultiSigSignerRemovedBundleEdge
Signature bundle data to be removed, with the corresponding cursor.
ERC20MultiSigSignerRemovedConnection
Page of signature data items to be removed and corresponding page information.
ERC20MultiSigSignerRemovedEdge
Signature data to be removed with the corresponding cursor.
EpochRewardSummaryConnection
Page of rewards summary data for epoch and corresponding page information
Name | Type | Description |
---|
edges | EpochRewardSummaryEdge | Page of rewards summary data for epochs and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
EpochRewardSummaryEdge
Rewards summary data for epoch with the corresponding cursor.
Name | Type | Description |
---|
node | vega.EpochRewardSummary | Rewards summary data for epoch. |
cursor | string | Cursor that can be used to fetch further pages. |
EstimateFeeRequest
Request to fetch the estimated fee if an order were to trade immediately
Name | Type | Description |
---|
market_id | string | Market ID, used to specify the fee factors. |
price | string | Price at which the potential order is expected to trade. |
size | uint64 | Size at which the potential order is expected to trade. |
EstimateFeeResponse
Response that is received from EstimateFeeRequest, contains the estimated fees for a given order
Name | Type | Description |
---|
fee | vega.Fee | Summary of the estimated fees for this order if it were to trade now. |
EstimateMarginRequest
Request to fetch the estimated MarginLevels if an order were to trade immediately
Name | Type | Description |
---|
market_id | string | Market ID for the order. |
party_id | string | Party ID of the order. |
side | vega.Side | Order side - indicator for Seller or Buyer side. |
type | vega.Order.Type | Type of the order. |
size | uint64 | Size of order. |
price | string | Price of the asset. |
EstimateMarginResponse
Response to an estimate margin request, containing the estimated margin levels for a given order
Name | Type | Description |
---|
margin_levels | vega.MarginLevels | Summary of the estimated margins for this order if it were to trade now. |
EstimatePositionRequest
Request for the estimate of the margin level and, if available collateral is provided, liqudation price for the specified position.
Name | Type | Description |
---|
market_id | string | Market ID. |
open_volume | int64 | Open volume.
This field is an signed integer (negative for short position) passed as a string and needs to be scaled using the market's position decimal places. |
orders | OrderInfo | Open and/or hypothetical orders. |
collateral_available | string | Optional argument specifying collateral available for the position, if provided then response will contain the liquidation price estimate. |
EstimatePositionResponse
Response for the estimate of the margin level and, if available collateral was provided in the request, liqudation price for the specified position.
Name | Type | Description |
---|
margin | MarginEstimate | Margin level range estimate for the specified position. |
liquidation | LiquidationEstimate | Liquidation price range estimate for the specified position. Only populated if available collateral was specified in the request. |
EthereumKeyRotationEdge
Ethereum key rotation data with the corresponding cursor.
Name | Type | Description |
---|
node | vega.events.v1.EthereumKeyRotation | Data relating to an Ethereum key rotation performed by a node on the Vega network. |
cursor | string | Cursor that can be used to fetch further pages. |
EthereumKeyRotationsConnection
Page of Ethereum key rotations data and corresponding page information
Name | Type | Description |
---|
edges | EthereumKeyRotationEdge | Page of Ethereum key rotations data and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
ExportLedgerEntriesRequest
Request that is sent when exporting ledger entries to csv
Name | Type | Description |
---|
party_id | string | Party ID to export ledger entries for. |
asset_id | string | Optional: Asset ID. |
date_range | DateRange | Date range to export ledger entries for. |
ExportNetworkHistoryRequest
Request to export network history data in CSV format
Name | Type | Description |
---|
from_block | int64 | Block to begin exporting from. Must be the first block of a history segment,
which by default are 1000 blocks each; in that case - 1, 1001, 2001 etc. are valid values.
This can be checked by first calling the API to list all network history segments. |
to_block | int64 | Last block to export up to and including. Must be the last block of a history segment
which by default are 1000 blocks each; in that case - 1000, 2000, 3000 etc. are valid values.
This can be checked by first calling the API to list all network history segments. |
table | Table | Table to export data from. |
GetActiveNetworkHistoryPeerAddressesRequest
Request to get the addresses of active network history peers
GetActiveNetworkHistoryPeerAddressesResponse
Response containing the addresses of active network history peers
Name | Type | Description |
---|
ip_addresses | string | List of IP addresses for the active peers. |
GetAssetRequest
Request for obtaining asset
Name | Type | Description |
---|
asset_id | string | Asset ID to get data for. |
GetAssetResponse
Response from getting an asset
Name | Type | Description |
---|
asset | vega.Asset | Asset information that is returned. |
GetBalanceHistoryRequest
Request that is used when querying balance history
Name | Type | Description |
---|
filter | AccountFilter | AccountFilter contains values that can be set in order to limit balance history data to them. |
group_by | AccountField | By default the net balances of all the accounts specified by the filter are returned.
If a list of fields is given in group_by, split out those balances by the supplied criteria. |
pagination | Pagination | |
date_range | DateRange | |
GetBalanceHistoryResponse
Response that is received when querying for balance history
GetDepositRequest
Request to get data about a specific deposit by ID
Name | Type | Description |
---|
id | string | Deposit ID, which can be obtained using the List Deposits query. |
GetDepositResponse
Response that is received from getting deposit data
Name | Type | Description |
---|
deposit | vega.Deposit | Deposit matching the ID from the request. |
GetERC20ListAssetBundleRequest
Request for listing the signature bundle to an ERC-20 token in the collateral bridge
Name | Type | Description |
---|
asset_id | string | Asset ID of the asset bundle requested. |
GetERC20ListAssetBundleResponse
Response from listing the signature bundle to an ERC-20 token in the collateral bridge
Name | Type | Description |
---|
asset_source | string | Address of the asset on ethereum. |
vega_asset_id | string | Asset ID for the underlying Vega asset. |
nonce | string | Nonce, which is actually the internal reference for the proposal. |
signatures | string | Signatures bundle as hex encoded data, forward by 0x
e.g: 0x + sig1 + sig2 + ... + sixN. |
GetERC20SetAssetLimitsBundleRequest
Request for the signature bundle to update the token limits i.e. maxLifetimeDeposit and withdrawThreshold for a given ERC20 token that is already allowlisted in the collateral bridge
Name | Type | Description |
---|
proposal_id | string | Proposal ID of the asset update proposal. |
GetERC20SetAssetLimitsBundleResponse
Response for the signature bundle to update the token limits i.e. maxLifetimeDeposit and withdrawThreshold for a given ERC20 token that is already allowlisted in the collateral bridge
Name | Type | Description |
---|
asset_source | string | Address of the asset on ethereum. |
vega_asset_id | string | Asset ID for the underlying Vega asset. |
nonce | string | Nonce, which is actually the internal reference for the proposal. |
lifetime_limit | string | Lifetime limit deposit for this asset. |
threshold | string | Threshold withdraw for this asset. |
signatures | string | Signatures bundle as hex encoded data, forward by 0x
e.g: 0x + sig1 + sig2 + ... + sixN. |
GetERC20WithdrawalApprovalRequest
Request to get all information required to bundle the call to finalise the withdrawal on the erc20 bridge
Name | Type | Description |
---|
withdrawal_id | string | Withdrawal ID to retrieve. |
GetERC20WithdrawalApprovalResponse
Response with all information required to bundle the call to finalise the withdrawal on the erc20 bridge
function withdraw_asset(address asset_source, uint256 asset_id, uint256 amount, uint256 expiry, uint256 nonce, bytes memory signatures)
Name | Type | Description |
---|
asset_source | string | Address of asset on ethereum. |
amount | string | Amount to be withdrawn. |
nonce | string | Nonce, which is actually the internal reference for the withdrawal. |
signatures | string | Signatures bundle as hex encoded data, forward by 0x
e.g: 0x + sig1 + sig2 + ... + sixN. |
target_address | string | Ethereum address to withdraw the funds to, 0x prefixed. |
creation | int64 | Creation timestamps. |
GetEpochRequest
Request to fetch epoch data
Name | Type | Description |
---|
id | uint64 | Epoch ID to get, if provided. If omitted, data for the current epoch is returned. |
GetEpochResponse
Response from getting epoch
Name | Type | Description |
---|
epoch | vega.Epoch | Data specific to a single epoch on the Vega network. This includes the epoch number,
start and end times, and the nodes that participated in the epoch. |
GetGovernanceDataRequest
Request to get governance data
Name | Type | Description |
---|
proposal_id | string | Proposal ID to get governance data for, if provided. |
reference | string | Reference to get proposal data for, if provided. |
GetGovernanceDataResponse
Response from getting governance data
Name | Type | Description |
---|
data | vega.GovernanceData | Governance data content, i.e. proposal and votes for and against. |
GetLastTradeRequest
Request for the latest trade that occurred on Vega for a given market
Name | Type | Description |
---|
market_id | string | Market ID to retrieve the last trade for, required field. |
GetLastTradeResponse
Response for the latest trade that occurred on Vega for a given market
Name | Type | Description |
---|
trade | vega.Trade | Information about the trade, if one is found. |
GetLatestMarketDataRequest
Request that is sent when listing the latest market data for a given market
Name | Type | Description |
---|
market_id | string | Market ID to retrieve market data for, required field. |
GetLatestMarketDataResponse
Response that is received when listing the latest market data for a given market
Name | Type | Description |
---|
market_data | vega.MarketData | Market data that was requested. |
GetLatestMarketDepthRequest
Request that is sent when requesting latest market depth data
Name | Type | Description |
---|
market_id | string | Market ID to request market depth for, required field. |
max_depth | uint64 | Optional field to indicate the maximum market depth. |
GetLatestMarketDepthResponse
Response that is received when latest market depth data is queried
Name | Type | Description |
---|
market_id | string | Market ID of the depth levels returned. |
buy | vega.PriceLevel | Zero or more price levels for the buy side of the market depth data. |
sell | vega.PriceLevel | Zero or more price levels for the sell side of the market depth data. |
last_trade | vega.Trade | Last trade recorded on Vega at the time of retrieving the `MarketDepthResponse`. |
sequence_number | uint64 | Sequence number incremented after each update. |
GetMarketDataHistoryByIDRequest
Request that is sent for getting Market Data History
Name | Type | Description |
---|
market_id | string | Market ID to request data history for, required field. |
start_timestamp | int64 | Optional Unix time in nanoseconds. |
end_timestamp | int64 | Optional Unix time in nanoseconds. |
pagination | Pagination | Optional pagination control. |
GetMarketDataHistoryByIDResponse
Response that is received when querying Market Data History
Name | Type | Description |
---|
market_data | MarketDataConnection | Page of market data history with the corresponding page information. |
GetMarketRequest
Request for getting a market by ID
Name | Type | Description |
---|
market_id | string | Market ID of the market to retrieve data for. |
GetMarketResponse
Response from getting a market by ID
Name | Type | Description |
---|
market | vega.Market | Information about the market requested. |
GetMostRecentNetworkHistorySegmentRequest
Request to get the most recent history segment
GetMostRecentNetworkHistorySegmentResponse
Response from getting most recent history segment
Name | Type | Description |
---|
segment | HistorySegment | Data relating to a history segment created by a Vega data node. |
swarm_key_seed | string | Key seed for the swarm section. |
GetNetworkDataRequest
Request to get network data
GetNetworkDataResponse
Response from getting network data
Name | Type | Description |
---|
node_data | vega.NodeData | Summary of information with respect to nodes on the Vega network. |
GetNetworkHistoryBootstrapPeersRequest
Request to get the nodes network history bootstrap peers
GetNetworkHistoryBootstrapPeersResponse
Response containing the nodes network history bootstrap peers
Name | Type | Description |
---|
bootstrap_peers | string | List of peers that can be used to bootstrap a Vega data node. |
GetNetworkHistoryStatusRequest
Request to get the status of network history
GetNetworkHistoryStatusResponse
Response containing the status of network history
Name | Type | Description |
---|
ipfs_address | string | IPFS address of the data node currently connected to. |
swarm_key | string | Swarm key used by the IPFS swarm. |
swarm_key_seed | string | Swarm key seed used by the IPFS swarm. |
connected_peers | string | List of peers connected to the IPFS swarm. |
GetNetworkLimitsRequest
Request that is used to query current network limits
GetNetworkLimitsResponse
Response received when querying the current network limits
GetNetworkParameterRequest
Request for a single network parameter
Name | Type | Description |
---|
key | string | Key identifying the network parameter. |
GetNetworkParameterResponse
Response that is received when getting a network parameter
GetNodeRequest
Request to get node data
Name | Type | Description |
---|
id | string | Node ID to get data for. |
GetNodeResponse
Response from getting node
Name | Type | Description |
---|
node | vega.Node | Data specific to a single node on the Vega network. |
GetOracleSpecRequest
Request to get a specific oracle spec by its ID
Name | Type | Description |
---|
oracle_spec_id | string | Oracle spec ID to request data for. |
GetOracleSpecResponse
Response for a oracle spec
Name | Type | Description |
---|
oracle_spec | vega.OracleSpec | External data spec matching the ID. |
GetOrderRequest
Request that is sent when executing the query for getting a single order
Name | Type | Description |
---|
order_id | string | Order ID to retrieve order information for. |
version | int32 | Optional version of the order. |
GetOrderResponse
Response received from the query for getting a single order
Name | Type | Description |
---|
order | vega.Order | Order details, if one was found. |
GetPartyRequest
Request to get party by ID
Name | Type | Description |
---|
party_id | string | Party ID to retrieve party information for. |
GetPartyResponse
Response from getting party by ID
Name | Type | Description |
---|
party | vega.Party | Data for the party requested. |
GetProtocolUpgradeStatusRequest
Request to get protocol upgrade status
GetProtocolUpgradeStatusResponse
Response from getting protocol upgrade status
Name | Type | Description |
---|
ready | bool | Indicator if the upgrade is ready or not. |
GetRiskFactorsRequest
Request to get risk factor
Name | Type | Description |
---|
market_id | string | Market ID to get the risk factor for. |
GetRiskFactorsResponse
Response that is received from getting a risk factor
Name | Type | Description |
---|
risk_factor | vega.RiskFactor | Risk factor emitted by the risk model for a given market. |
GetStakeRequest
Request to get stake
Name | Type | Description |
---|
party_id | string | Party ID for which the stake information is requested. |
pagination | Pagination | Optional pagination information to limit the data that is returned. |
GetStakeResponse
Response that is received from requesting stake information
Name | Type | Description |
---|
current_stake_available | string | Current stake available information. |
stake_linkings | StakesConnection | Paged list of stake data with corresponding page information. |
GetVegaTimeRequest
Request to get the current time of the Vega network
GetVegaTimeResponse
Response for the current consensus coordinated time on the Vega network, referred to as "VegaTime"
Name | Type | Description |
---|
timestamp | int64 | Timestamp representation of current VegaTime as represented in
Nanoseconds since the epoch, for example `1580473859111222333` corresponds to `2020-01-31T12:30:59.111222333Z`. |
GetWithdrawalRequest
Request to get a specific withdrawal by ID
Name | Type | Description |
---|
id | string | Withdrawal ID to retrieve data for. |
GetWithdrawalResponse
Response for a withdrawal request
Name | Type | Description |
---|
withdrawal | vega.Withdrawal | Withdrawal matching the ID from the request. |
GovernanceDataConnection
Page of governance data and corresponding page information
Name | Type | Description |
---|
edges | GovernanceDataEdge | Page of governance data and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
GovernanceDataEdge
Governance data with the corresponding cursor.
Name | Type | Description |
---|
node | vega.GovernanceData | Governance data content, i.e. proposal and votes for and against. |
cursor | string | Cursor that can be used to fetch further pages. |
HistorySegment
Describes a network history segment
Name | Type | Description |
---|
from_height | int64 | Starting height of the history segment. |
to_height | int64 | Ending height of the history segment. |
history_segment_id | string | History segment ID. |
previous_history_segment_id | string | Previous history segment ID. |
database_version | int64 | Database schema version of the history segment. |
chain_id | string | Chain ID of the history segment. |
InfoRequest
Request that is sent when querying node information
InfoResponse
Response that is received from the node information query
Name | Type | Description |
---|
version | string | Semver formatted version of the data node. |
commit_hash | string | Commit hash from which the data node was built. |
IntervalToCandleId
Maps an interval for a given market to its corresponding candle ID
Name | Type | Description |
---|
interval | string | Interval for the candle. |
candle_id | string | Unique id of the candle. |
KeyRotationConnection
Page of key rotations data and corresponding page information
Name | Type | Description |
---|
edges | KeyRotationEdge | Page of key rotation data and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
KeyRotationEdge
Key rotation data with the corresponding cursor.
Name | Type | Description |
---|
node | vega.events.v1.KeyRotation | Data relating to a key rotation that was performed by a node on the Vega network. |
cursor | string | Cursor that can be used to fetch further pages. |
LedgerEntryFilter
Ledger entry filter sets filters on returned set of ledger entries.
Name | Type | Description |
---|
close_on_account_filters | bool | Determines whether an entry must have accounts matching both the account_from_filter
and the account_to_filter. If set to 'true', entries must have matches in both filters.
If set to `false`, entries matching only the account_from_filter or the account_to_filter will also be included. |
from_account_filter | AccountFilter | Used to set values for filtering sender accounts. |
to_account_filter | AccountFilter | Used to set values for filtering receiver accounts. |
transfer_types | vega.TransferType | List of transfer types that is used for filtering sender and receiver accounts. |
LiquidationEstimate
Liquidation estimate for both worst and best case possible.
Name | Type | Description |
---|
worst_case | LiquidationPrice | Liquidation price estimate assuming slippage cap is applied. |
best_case | LiquidationPrice | Liquidation price estimate assuming no slippage. |
LiquidationPrice
Liquidation price estimate for either only the current open volume and position given some or all buy orders get filled, or position given some or all sell orders get filled.
Name | Type | Description |
---|
open_volume_only | string | Liquidation price for current open volume ignoring any active orders. |
including_buy_orders | string | Liquidation price assuming buy orders start getting filled. |
including_sell_orders | string | Liquidation price assuming sell orders start getting filled. |
LiquidityProvisionsConnection
Page of liquidity provisions data and corresponding page information
Name | Type | Description |
---|
edges | LiquidityProvisionsEdge | Page of liquidity provisions data and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
LiquidityProvisionsEdge
Liquidity provision data with the corresponding cursor.
Name | Type | Description |
---|
node | vega.LiquidityProvision | Data corresponding to a liquidity provider's commitment. |
cursor | string | Cursor that can be used to fetch further pages. |
ListAccountsRequest
Request that is sent when listing accounts
Name | Type | Description |
---|
filter | AccountFilter | AccountFilter contains all filter conditions and values that can be applied to the listing. |
pagination | Pagination | Optional pagination control. |
ListAccountsResponse
Response that is received from listing accounts query
Name | Type | Description |
---|
accounts | AccountsConnection | Page of accounts data and corresponding page information. |
ListAllNetworkHistorySegmentsRequest
Request to list all the nodes history segments
ListAllNetworkHistorySegmentsResponse
Response with a list of all the nodes history segments
Name | Type | Description |
---|
segments | HistorySegment | Page of history segments data and corresponding page information. |
ListAllPositionsRequest
Request to list positions, given the position filter is supplied.
ListAllPositionsResponse
Response to query for listing of positions, given the filter is supplied
Name | Type | Description |
---|
positions | PositionConnection | Page of positions data and corresponding page information. |
ListAssetsRequest
Request for listing assets data
Name | Type | Description |
---|
asset_id | string | Optional asset ID to list data for. |
pagination | Pagination | Optional pagination information to limit the data that is returned. |
ListAssetsResponse
Response from listing assets
Name | Type | Description |
---|
assets | AssetsConnection | Page of assets data and corresponding page information. |
ListBalanceChangesRequest
Request that is received when querying balances changes
Name | Type | Description |
---|
filter | AccountFilter | Limit the accounts considered according to the filter supplied. |
pagination | Pagination | Pagination controls. |
date_range | DateRange | Date range over which to query. |
ListBalanceChangesResponse
Response that is received when querying balances changes
ListCandleDataRequest
Request that is used when listing candles for a market at an interval
Name | Type | Description |
---|
candle_id | string | Candle ID to retrieve candle data for, required field. |
from_timestamp | int64 | Timestamp to retrieve candles since, in nanoseconds since the epoch. |
to_timestamp | int64 | Timestamp to retrieve candles to, in nanoseconds since the epoch. |
pagination | Pagination | pagination controls |
ListCandleDataResponse
Response for list of candles for a market at an interval
Name | Type | Description |
---|
candles | CandleDataConnection | Page of candle data and corresponding page information. |
ListCandleIntervalsRequest
Request that is used to fetch a list of supported intervals for the given market along with the corresponding candle ID
Name | Type | Description |
---|
market_id | string | Unique ID for the market to list candle intervals for. |
ListCandleIntervalsResponse
List of mapped pairs `interval` -> `candle ID` for a given market
ListCheckpointsRequest
Request to get all checkpoints. Currently no fields, probably will be expanded to allow filtering data
Name | Type | Description |
---|
pagination | Pagination | Optional pagination information to limit the data that is returned. |
ListCheckpointsResponse
Response message containing all checkpoints requested
Name | Type | Description |
---|
checkpoints | CheckpointsConnection | Page of checkpoints data and corresponding page information. |
ListCoreSnapshotsRequest
Request type for ListCoreSnapshots; fetches a paginated list of the core snapshots.
Name | Type | Description |
---|
pagination | Pagination | Optional pagination information to limit the data that is returned. |
ListCoreSnapshotsResponse
Response from a ListCoreSnapshots RPC call; a paginated list of the core snapshots.
Name | Type | Description |
---|
core_snapshots | CoreSnapshotConnection | Page of core snapshot data and corresponding page information. |
ListDelegationsRequest
Request for listing delegations
Name | Type | Description |
---|
party_id | string | Party ID to list delegations for, if provided. |
node_id | string | Node ID to list delegations for, if provided. |
epoch_id | string | Epoch ID to list delegations for, if provided. |
pagination | Pagination | Optional pagination information to limit the data that is returned. |
ListDelegationsResponse
Response from listing delegations
Name | Type | Description |
---|
delegations | DelegationsConnection | Page of delegations data and corresponding page information. |
ListDepositsRequest
Request to list all deposits for a given party
Name | Type | Description |
---|
party_id | string | Party ID whose deposits are to be retrieved.
If not provided, deposits for all parties will be provided. |
pagination | Pagination | Optional pagination information to limit the data that is returned. |
date_range | DateRange | Date range of the requested data, if provided. |
ListDepositsResponse
Response from listing deposits
Name | Type | Description |
---|
deposits | DepositsConnection | Page of deposits data and corresponding page information. |
ListERC20MultiSigSignerAddedBundlesRequest
Request for adding a signature bundle to the signer list of a multisig contract for a particular validator
Name | Type | Description |
---|
node_id | string | Node ID of the validator for which a signature bundle is required. |
submitter | string | Ethereum address of the validator that will submit the bundle. |
epoch_seq | string | Epoch in which the bundle was generated, i.e. the epoch in which the node was promoted to consensus validator. |
pagination | Pagination | Pagination controls. |
ListERC20MultiSigSignerAddedBundlesResponse
Response from adding a signature bundle to the signer list of a multisig contract for a particular validator
Name | Type | Description |
---|
bundles | ERC20MultiSigSignerAddedConnection | Page of bundles for that validator - it may have been added multiple times if removed in between - and corresponding page information. |
ListERC20MultiSigSignerRemovedBundlesRequest
Request for removing a signature bundle from the signer list of the multisig contract for a particular validator
Name | Type | Description |
---|
node_id | string | Node ID of the validator of which a signature bundle is required. |
submitter | string | Ethereum address of the validator that will submit the bundle. |
epoch_seq | string | Epoch in which the bundle was generated, i.e. the epoch in which the node was demoted from a consensus validator. |
pagination | Pagination | Pagination controls. |
ListERC20MultiSigSignerRemovedBundlesResponse
Response when removing a signature bundle from the signer list of the multisig contract for a particular validator
ListEntitiesRequest
Request to list all entities that were created by the given transaction hash
Name | Type | Description |
---|
transaction_hash | string | Transaction hash to match against |
ListEntitiesResponse
Response from listing entities that were created for a given transaction hash
ListEpochRewardSummariesRequest
Request to get summary of reward per epoch for a given range of epochs
Name | Type | Description |
---|
filter | RewardSummaryFilter | Limit the results considered according to the filter supplied. |
pagination | Pagination | Optional pagination information to limit the data that is returned. |
ListEpochRewardSummariesResponse
Return message with reward details in for a single party
ListEthereumKeyRotationsRequest
Request to list ethereum key rotations for nodes, optionally filtered by node
Name | Type | Description |
---|
node_id | string | Node ID to get the rotation for, if provided. |
pagination | Pagination | Optional pagination information to limit the data that is returned. |
ListEthereumKeyRotationsResponse
Response message containing Ethereum key rotations
ListGovernanceDataRequest
Request to list governance data
Name | Type | Description |
---|
proposal_state | vega.Proposal.State | Proposal state to list governance data for, if provided. |
proposal_type | ListGovernanceDataRequest.Type | Proposal type to list governance data for, if provided. |
proposer_party_id | string | Proposer party ID to list governance data for, if provided. |
proposal_reference | string | Proposal reference to list governance data for, if provided. |
pagination | Pagination | Optional pagination information to limit the data that is returned. |
ListGovernanceDataResponse
Response from listing governance data
ListKeyRotationsRequest
Request to list all key rotations
Name | Type | Description |
---|
node_id | string | Node ID to get key rotations for, if provided. |
pagination | Pagination | Optional pagination information to limit the data that is returned. |
ListKeyRotationsResponse
Response message containing Vega key rotations
Name | Type | Description |
---|
rotations | KeyRotationConnection | Page of key rotations data and corresponding page information. |
ListLatestMarketDataRequest
Request that is sent when listing the latest market data for every market
ListLatestMarketDataResponse
Response that is received when listing the latest market data for every market
ListLedgerEntriesRequest
Request that is sent when listing ledger entries
Name | Type | Description |
---|
filter | LedgerEntryFilter | 'LedgerEntryFilter' that contains all values and conditions according to which
the listing of ledger entries is filtered. |
pagination | Pagination | Optional pagination control. |
date_range | DateRange | Date range for which to list ledger entries. |
ListLedgerEntriesResponse
Response that is received when listing ledger entries
ListLiquidityProvisionsRequest
Request for listing liquidity provisions
Name | Type | Description |
---|
market_id | string | Target market for the liquidity provision orders. |
party_id | string | Party which submitted the liquidity provision orders. |
reference | string | Reference of the liquidity provision. |
live | bool | Indicator if the listed liquidity provision orders will include live orders or not. |
pagination | Pagination | Optional pagination information to limit the data that is returned. |
ListLiquidityProvisionsResponse
Response from listing liquidity provisions
ListMarginLevelsRequest
Request for listing margin levels
Name | Type | Description |
---|
party_id | string | Party ID for which to list the margin levels |
market_id | string | Market ID for which to list the margin levels |
pagination | Pagination | Pagination control |
ListMarginLevelsResponse
Response from listing margin levels
Name | Type | Description |
---|
margin_levels | MarginConnection | Page of margin levels data and corresponding page information. |
ListMarketsRequest
Request for listing markets
Name | Type | Description |
---|
pagination | Pagination | Pagination control. |
include_settled | bool | Whether or not to include settled markets in the response; default to true if not specified. |
ListMarketsResponse
Response from listing markets
Name | Type | Description |
---|
markets | MarketConnection | Page of markets and corresponding page information. |
ListNetworkParametersRequest
Message requesting for the list of all network parameters
Name | Type | Description |
---|
pagination | Pagination | Optional pagination information to limit the data that is returned. |
ListNetworkParametersResponse
Response containing all of the Vega network parameters
ListNodeSignaturesRequest
Request to specify the ID of the resource to retrieve aggregated signatures for
Name | Type | Description |
---|
id | string | Resource ID to list signatures for, required field. |
pagination | Pagination | Optional pagination information to limit the data that is returned. |
ListNodeSignaturesResponse
Response to specify the ID of the resource to retrieve aggregated signatures for
ListNodesRequest
Request to list nodes
Name | Type | Description |
---|
epoch_seq | uint64 | Epoch number to list nodes for, if provided. |
pagination | Pagination | Optional pagination information to limit the data that is returned. |
ListNodesResponse
Response from listing nodes
Name | Type | Description |
---|
nodes | NodesConnection | Page of node data and corresponding page information. |
ListOracleDataRequest
Request to get all seen oracle data
Name | Type | Description |
---|
oracle_spec_id | string | Oracle spec ID to list data for. |
pagination | Pagination | Pagination controls. |
ListOracleDataResponse
Response to get all seen oracle data
Name | Type | Description |
---|
oracle_data | OracleDataConnection | Page of seen oracle data and corresponding page information. |
ListOracleSpecsRequest
Request to get all active oracle specs
Name | Type | Description |
---|
pagination | Pagination | Pagination controls. |
ListOracleSpecsResponse
Response to get all active oracle specs
Name | Type | Description |
---|
oracle_specs | OracleSpecsConnection | Page of active oracle specs and corresponding page information. |
ListOrderVersionsRequest
Request that is sent when listing possible order versions
Name | Type | Description |
---|
order_id | string | Order ID to list versions for. |
pagination | Pagination | Optional pagination control. |
ListOrderVersionsResponse
Response that is received when listing possible order versions
Name | Type | Description |
---|
orders | OrderConnection | Page of order versions and corresponding page information. |
ListOrdersRequest
Request that is sent when executing a query for a list of orders
Name | Type | Description |
---|
pagination | Pagination | Optional pagination control. |
filter | OrderFilter | Order filter contains all filtering conditions and values that are applied to the orders listing. |
ListOrdersResponse
Response that is received from the query to list orders
Name | Type | Description |
---|
orders | OrderConnection | Page of orders data and corresponding page information. |
ListPartiesRequest
Request to list parties by ID
Name | Type | Description |
---|
party_id | string | Party ID to filter for. If omitted, no filter will be applied. |
pagination | Pagination | Pagination control. |
ListPartiesResponse
Response from listing parties
Name | Type | Description |
---|
parties | PartyConnection | Page of parties data and corresponding page information. |
ListPositionsRequest
Request used to list all positions for a party
Optionally, if a market ID is set, the results will be filtered for that market only
Name | Type | Description |
---|
party_id | string | Party ID to list positions for, required field. |
market_id | string | Market ID to filter for. If empty, no markets will be filtered. |
pagination | Pagination | Optional pagination control. |
ListPositionsResponse
Response for a list of positions for a party
Name | Type | Description |
---|
positions | PositionConnection | Page of positions data and corresponding page information. |
ListProtocolUpgradeProposalsRequest
Request type for ListProtocolUpgradeProposals; fetches a paginated list of protocol upgrade proposals
Name | Type | Description |
---|
status | vega.events.v1.ProtocolUpgradeProposalStatus | Protocol upgrade proposal status to filter results from listing proposals, if provided. |
approved_by | string | Option to filter listed proposals on being approved or not, if provided. |
pagination | Pagination | Optional pagination information to limit the data that is returned. |
ListProtocolUpgradeProposalsResponse
Response type from a ListProtocolUpgradeProposals RPC call; a paginated list of protocol upgrade proposals
ListRewardSummariesRequest
Request to get reward details for a party
Name | Type | Description |
---|
party_id | string | Party ID for which to list rewards, if provided. |
asset_id | string | Asset ID for which to list rewards, if provided. |
pagination | Pagination | Optional pagination information to limit the data that is returned. |
ListRewardSummariesResponse
Response from listing reward details in for a single party
Name | Type | Description |
---|
summaries | vega.RewardSummary | Page of rewards details data and corresponding page information. |
ListRewardsRequest
Request to get reward details for a party
Name | Type | Description |
---|
party_id | string | Party ID for which to get the list of rewards. |
asset_id | string | Asset ID for which to get the list of rewards, if provided. |
pagination | Pagination | Pagination control. |
from_epoch | uint64 | Epoch from which to list the rewards, if provided. |
to_epoch | uint64 | Epoch up-to-which to list the rewards, if provided. |
ListRewardsResponse
Response for listing reward details for a single party
Name | Type | Description |
---|
rewards | RewardsConnection | Page of rewards data and corresponding page information. |
ListTradesRequest
Request to list trades
Name | Type | Description |
---|
market_ids | string | List of Market IDs for which to list trades for, if provided. |
order_ids | string | List of Order IDs for which to list trades for, if provided. |
party_ids | string | List of Party ID for which to list trades for, if provided. |
pagination | Pagination | Pagination control. |
date_range | DateRange | Date range for the listing, if provided. |
ListTradesResponse
Response from listing trades
Name | Type | Description |
---|
trades | TradeConnection | Page of trades data and corresponding page information. |
ListTransfersRequest
Request that is sent to list transfers
Name | Type | Description |
---|
pubkey | string | Public key for which to request transfers, this can be a party ID, "0000000000000000000000000000000000000000000000000000000000000000" for the global rewards account, or "network". |
direction | TransferDirection | Transfer directions - i.e. sender, receiver - to include in the response data |
pagination | Pagination | Optional pagination control |
ListTransfersResponse
Response that is received when listing transfers
Name | Type | Description |
---|
transfers | TransferConnection | Page of transfers data and corresponding page information. |
ListVotesRequest
Request that is used to list governance votes
Name | Type | Description |
---|
party_id | string | Party for which the votes are requested. |
proposal_id | string | Proposal ID to list votes for. |
pagination | Pagination | Optional pagination control. |
ListVotesResponse
Response that is received when listing Votes
Name | Type | Description |
---|
votes | VoteConnection | Page of votes data received and corresponding page information. |
ListWithdrawalsRequest
List all withdrawals for a given party
Name | Type | Description |
---|
party_id | string | Party ID whose withdrawals are to retrieved.
If not provided, withdrawals for all parties will be returned. |
pagination | Pagination | Optional pagination information to limit the data that is returned. |
date_range | DateRange | Date range of the requested data, if provided. |
ListWithdrawalsResponse
Response from listing withdrawals data
Name | Type | Description |
---|
withdrawals | WithdrawalsConnection | Page of withdrawals data and corresponding page information. |
MarginConnection
Page of margins data and corresponding page information.
Name | Type | Description |
---|
edges | MarginEdge | Page of margins data and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
MarginEdge
Margin data with the corresponding cursor.
Name | Type | Description |
---|
node | vega.MarginLevels | Margin levels data that satisfy a list margin levels request. |
cursor | string | Cursor that can be used to fetch further pages. |
MarginEstimate
Margin level estimate for both worst and best case possible.
Name | Type | Description |
---|
worst_case | vega.MarginLevels | Margin level estimate assuming slippage cap is applied. |
best_case | vega.MarginLevels | Margin level estimate assuming no slippage. |
MarketConnection
Page of markets and corresponding page information.
Name | Type | Description |
---|
edges | MarketEdge | Page of markets and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
MarketDataConnection
Page of market data items and corresponding page information
Name | Type | Description |
---|
edges | MarketDataEdge | Page of market data items and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
MarketDataEdge
Market data with the corresponding cursor.
Name | Type | Description |
---|
node | vega.MarketData | Data generated by a market when open. |
cursor | string | Cursor that can be used to fetch further pages. |
MarketEdge
Market information with the corresponding cursor.
Name | Type | Description |
---|
node | vega.Market | Information about the market. |
cursor | string | Cursor that can be used to fetch further pages. |
NetworkParameterConnection
Page of network parameters and corresponding page information
Name | Type | Description |
---|
edges | NetworkParameterEdge | Page of network parameters data and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
NetworkParameterEdge
Network parameter with the corresponding cursor.
Name | Type | Description |
---|
node | vega.NetworkParameter | Name and associated value of a network parameter. |
cursor | string | Cursor that can be used to fetch further pages. |
NodeBasic
Represents a basic node without any epoch specific details like delegations, staking, rewards etc.
Name | Type | Description |
---|
id | string | Unique ID identifying the node. |
pub_key | string | Node operator's public key. |
tm_pub_key | string | Tendermint public key of the node. |
ethereum_address | string | Ethereum public key of the node. |
info_url | string | URL that provides more information about the node. |
location | string | Country code for the location of the node. |
status | vega.NodeStatus | Node status. |
name | string | Node name. |
avatar_url | string | Avatar URL. |
NodeEdge
Node data with the corresponding cursor.
Name | Type | Description |
---|
node | vega.Node | Data specific to a single node on the Vega network. |
cursor | string | Cursor that can be used to fetch further pages. |
NodeSignatureEdge
Nodes signature edge with the corresponding cursor.
NodeSignaturesConnection
Page of node signatures and corresponding page information.
Name | Type | Description |
---|
edges | NodeSignatureEdge | Page of node signatures and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
NodesConnection
Page of node data and corresponding page information
Name | Type | Description |
---|
edges | NodeEdge | Page of node data and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
ObserveAccountsRequest
Request that is sent when getting a subscription to a stream of accounts
Name | Type | Description |
---|
market_id | string | Market ID to filter accounts by. If empty, no markets will be filtered. |
party_id | string | Party ID to filter accounts by. If empty, no parties will be filtered. |
asset | string | Asset ID to filter accounts by. If empty, no assets will be filtered. |
type | vega.AccountType | Account type to subscribe to, required field. |
ObserveAccountsResponse
Response that is received when subscribing to a stream of accounts
Name | Type | Description |
---|
snapshot | AccountSnapshotPage | 'Initial image' snapshot containing current account balances. |
updates | AccountUpdates | List of account updates in the last block. |
ObserveCandleDataRequest
Request that is used to subscribe to a stream of candles
Name | Type | Description |
---|
candle_id | string | Unique ID for the candle. |
ObserveCandleDataResponse
Response that is received when subscribing to a stream of candles
Name | Type | Description |
---|
candle | Candle | Candle data. |
ObserveDelegationsRequest
Request to subscribe to all event related to delegations, with the given filters
Name | Type | Description |
---|
party_id | string | Party ID to get delegations for, if provided. |
node_id | string | Node ID to get delegations for, if provided. |
ObserveDelegationsResponse
Response with all events related to delegations, with the given filters
Name | Type | Description |
---|
delegation | vega.Delegation | How much a party is delegating to a node and when. |
ObserveEventBusRequest
Request to subscribe to a stream of one or more event types from the Vega event bus
Name | Type | Description |
---|
type | vega.events.v1.BusEventType | One or more types of event, required field. |
market_id | string | Market ID to filter for, optional field. If empty, no markets will be excluded from the stream. |
party_id | string | Party ID to filter for, optional field. If empty, no parties will be excluded from the stream. |
batch_size | int64 | Batch size,
If not specified, any events received will be sent immediately. If the client is not ready
for the next data-set, data may be dropped a number of times, and eventually the stream is closed.
if specified, the first batch will be sent when ready. To receive the next set of events, the client
must write an `ObserveEventBatch` message on the stream to flush the buffer.
If no message is received in 5 seconds, the stream is closed.
Default: 0, send any and all events when they are available. |
ObserveEventBusResponse
Response to a subscribed stream of events from the Vega event bus
ObserveGovernanceRequest
Request for governance subscription
Name | Type | Description |
---|
party_id | string | Party ID to get the governance subscription for, if provided. |
ObserveGovernanceResponse
Response from governance subscription
Name | Type | Description |
---|
data | vega.GovernanceData | Governance data, i.e. proposal and votes for and against. |
ObserveLedgerMovementsRequest
Request to subscribe to ledger movements
ObserveLedgerMovementsResponse
Response from ledger movements subscription
Name | Type | Description |
---|
ledger_movement | vega.LedgerMovement | Ledger movements data with list of ledger entries and and post-transfer balances. |
ObserveLiquidityProvisionsRequest
Request sent to subscribe to liquidity provisions
Name | Type | Description |
---|
market_id | string | Target market to observe for liquidity provision orders. |
party_id | string | Target party to observe for submitted liquidity provision orders. |
ObserveLiquidityProvisionsResponse
Response from liquidity provisions subscription
ObserveMarginLevelsRequest
Request to subscribe to a stream of MarginLevels data.
If a party ID is provided, the stream will contain margin levels for that party only.
Optionally, the list can be additionally filtered by market
Name | Type | Description |
---|
party_id | string | Party ID to filter for. If empty, no parties will be filtered. |
market_id | string | Optional Market ID to filter for. If omitted, no markets will be filtered. |
ObserveMarginLevelsResponse
Response from subscribing to margin levels data
Name | Type | Description |
---|
margin_levels | vega.MarginLevels | Margin levels data that match the subscription request filters. |
ObserveMarketsDataRequest
Request that is sent for market data subscription
Name | Type | Description |
---|
market_ids | string | List of market IDs to be obtained in the subscription. |
ObserveMarketsDataResponse
Response that is received for market data subscription
ObserveMarketsDepthRequest
Request that is sent to get market depth subscription
Name | Type | Description |
---|
market_ids | string | List of market IDs to be obtained in the subscription. |
ObserveMarketsDepthResponse
Response that is received for MarketDepth subscription.
ObserveMarketsDepthUpdatesRequest
Request that is sent for market depth update subscription
Name | Type | Description |
---|
market_ids | string | List of market IDs to be obtained in the subscription. |
ObserveMarketsDepthUpdatesResponse
Response that is received for market depth update subscription
ObserveOrdersRequest
Request to subscribe to a stream of orders
Request fields market ID and party ID are both optional filters:
If omitted all orders, for all parties on all markets will be returned on the stream
Both filters can be combined
Name | Type | Description |
---|
market_ids | string | Market ID to filter for. If empty, no markets will be filtered. |
party_ids | string | Party ID to filter for. If empty, no parties will be filtered. |
exclude_liquidity | bool | Indicates whether liquidity orders should be excluded from the stream. |
ObserveOrdersResponse
Response that is received from an orders subscription
Name | Type | Description |
---|
snapshot | OrderSnapshotPage | An 'initial image' snapshot containing current live orders. |
updates | OrderUpdates | List of order updates in the last block. |
ObservePositionsRequest
Request that is used to subscribe to a stream of positions
Name | Type | Description |
---|
party_id | string | Optional party ID to filter for. If empty, no parties will be filtered from the stream. |
market_id | string | Optional market ID to filter for. If empty, no markets will be filtered from the stream. |
ObservePositionsResponse
Response received from a positions subscription request
ObserveRewardsRequest
Request sent for subscribing to rewards
Name | Type | Description |
---|
asset_id | string | Asset ID to get rewards data for, if provided. |
party_id | string | Party ID to get rewards data for, if provided. |
ObserveRewardsResponse
Response that is received from subscribing to rewards data
Name | Type | Description |
---|
reward | vega.Reward | Rewards data received. |
ObserveTradesRequest
Request to subscribe to a stream of trades
Request fields market ID and party ID are both optional filters:
If omitted all trades, for all parties on all markets will be returned on the stream
If market ID is given, trades from that market will be returned on the stream
If party ID is given, trades from that party will be returned on the stream
Both filters can be combined.
Name | Type | Description |
---|
market_ids | string | List of Market ID to filter by. |
party_ids | string | List of Party IDs to filter by. |
ObserveTradesResponse
Stream of trades
Name | Type | Description |
---|
trades | vega.Trade | List of 0 or more trades. |
ObserveVotesRequest
Request that is sent to subscribe to votes
Name | Type | Description |
---|
party_id | string | Party ID for which the votes are requested. |
proposal_id | string | Option proposal ID for which the votes are requested. |
ObserveVotesResponse
Response that is received from votes subscription
Name | Type | Description |
---|
vote | vega.Vote | Data associated with governance votes that are published to the stream. |
OracleDataConnection
Page of oracle data and corresponding page information.
Name | Type | Description |
---|
edges | OracleDataEdge | Page of oracle data and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
OracleDataEdge
Oracle data item with the corresponding cursor.
Name | Type | Description |
---|
node | vega.OracleData | Data that was received from an external oracle. |
cursor | string | Cursor that can be used to fetch further pages. |
OracleSpecEdge
Oracle specs data item with the corresponding cursor.
Name | Type | Description |
---|
node | vega.OracleSpec | External spec data that satisfies the list request. |
cursor | string | Cursor that can be used to fetch further pages. |
OracleSpecsConnection
Page of oracle specs and corresponding page information
Name | Type | Description |
---|
edges | OracleSpecEdge | Page of oracle specs data and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
OrderConnection
Page of orders data and corresponding page information.
Name | Type | Description |
---|
edges | OrderEdge | Page of orders and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
OrderEdge
Order data with the corresponding cursor.
Name | Type | Description |
---|
node | vega.Order | Data associated with an order submitted to a Vega node. |
cursor | string | Cursor that can be used to fetch further pages. |
OrderFilter
Order filter that contains all filtering conditions and values that are applied to the orders listing
Name | Type | Description |
---|
statuses | vega.Order.Status | List of order statuses the orders can be filtered by. |
types | vega.Order.Type | List of order types the orders can be filtered by. |
time_in_forces | vega.Order.TimeInForce | List of timings the orders can be filtered by. |
exclude_liquidity | bool | Indicator if liquidity provision orders should be included or not in the list. |
party_ids | string | List of party IDs to filter on. |
market_ids | string | List of market IDs to filter on. |
reference | string | Reference. |
date_range | DateRange | Date range of the orders being listed. |
live_only | bool | Indicator for listing only live orders, if set to true. |
OrderInfo
Basic description of an order.
Name | Type | Description |
---|
side | vega.Side | Side for the order, e.g. buy or 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.
This field is an unsigned integer passed as a string and needs to be scaled using the market's decimal places. |
remaining | uint64 | Size remaining.
This field is an unsigned integer passed as a string and needs to be scaled using the market's position decimal places. |
is_market_order | bool | Boolean that indicates if it is a market order. |
OrderSnapshotPage
'Initial image' of live orders, may be sent over multiple response messages
Name | Type | Description |
---|
orders | vega.Order | List of order data parts. |
last_page | bool | Indicator if the last page is reached or not. |
OrderUpdates
List of order updates in the last block
Name | Type | Description |
---|
orders | vega.Order | List of orders data. |
PageInfo
Page information for cursor based pagination
Name | Type | Description |
---|
has_next_page | bool | Indicator if there is a next page. |
has_previous_page | bool | Indicator if there is a previous page. |
start_cursor | string | Start cursor. |
end_cursor | string | End cursor. |
All data returned from the API is ordered in a well-defined manner.
The specific columns and the order in which the sorting is performed
depend on the API endpoint being called. However, the primary sorting
column is usually the timestamp of the block in which the data was last updated.
To prevent excessively large response messages and to avoid overloading
database resources, the API employs a cursor-based pagination mechanism.
This Pagination message can be optionally provided as part of the request to specify:
- The starting point within the total result set for beginning the page
- The size of the returned page
- The ordering of the data within that page
If no Pagination message is provided, the API will return the first page of
data using the default page size. The default page size is 1000.
To retrieve subsequent pages, the caller must examine the PageInfo structure
returned in the response to find a cursor string that uniquely identifies the
last row of that page. This cursor should then be passed in the 'after' field
of the Pagination message in a subsequent request.
For paging backward, take the cursor for the first row of the page from PageInfo
and pass it in the 'before' field of the Pagination message.
Pagination message that uses both first/after and last/before is considered invalid.
Name | Type | Description |
---|
first | int32 | Number of records to be returned that sort greater than row identified by cursor supplied in 'after'. |
after | string | If paging forwards, the cursor string for the last row of the previous page. |
last | int32 | Number of records to be returned that sort less than row identified by cursor supplied in 'before'. |
before | string | If paging forwards, the cursor string for the first row of the previous page. |
newest_first | bool | Newest records first, older records last, default is true. |
PartyConnection
Page of parties data and corresponding page information.
Name | Type | Description |
---|
edges | PartyEdge | Page of parties and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
PartyEdge
Party data with the corresponding cursor.
Name | Type | Description |
---|
node | vega.Party | Data associated with a party. |
cursor | string | Cursor that can be used to fetch further pages. |
PingRequest
Request to ping the data node
PingResponse
Ping response from the data node
PositionConnection
Page of positions and corresponding page information
Name | Type | Description |
---|
edges | PositionEdge | Page of positions data and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
PositionEdge
Position data with the corresponding cursor.
Name | Type | Description |
---|
node | vega.Position | Represents position data for a party on the specified market on Vega. |
cursor | string | Cursor that can be used to fetch further pages. |
PositionSnapshotPage
'Initial image' of current positions, may be sent over multiple response messages
Name | Type | Description |
---|
positions | vega.Position | List of positions data. |
last_page | bool | Indicator if last page is reached or not. |
PositionUpdates
List of position updates in the last block
PositionsFilter
Filter to apply to the ListAllPositionsRequest
Name | Type | Description |
---|
party_ids | string | List of party IDs to filter on. |
market_ids | string | List of market IDs to filter on. |
ProtocolUpgradeProposalConnection
Page of protocol upgrade proposals and corresponding page information
Name | Type | Description |
---|
edges | ProtocolUpgradeProposalEdge | Page of protocol upgrade proposals data and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
ProtocolUpgradeProposalEdge
Protocol upgrade proposal data with the corresponding cursor.
RewardEdge
Rewards data with the corresponding cursor.
Name | Type | Description |
---|
node | vega.Reward | Details for a single reward payment. |
cursor | string | Cursor that can be used to fetch further pages. |
RewardSummaryFilter
Filter to restrict the results returned by the ListEpochRewardSummaries
Name | Type | Description |
---|
asset_ids | string | Restrict the results to those connected to the assets in this list. Pass an empty list for no filter. |
market_ids | string | Restrict the results to those connected to the markets in this list. Pass an empty list for no filter. |
from_epoch | uint64 | Optional range of epochs to filter on. |
to_epoch | uint64 | Epoch to which to filter rewards summaries. |
RewardsConnection
Page of rewards data and corresponding page information.
Name | Type | Description |
---|
edges | RewardEdge | Page of rewards data items and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
StakeLinkingEdge
Stake linking data with the corresponding cursor.
Name | Type | Description |
---|
node | vega.events.v1.StakeLinking | Stake linking represent the intent from a party to deposit. |
cursor | string | Cursor that can be used to fetch further pages. |
StakesConnection
Page of stake data and corresponding page information.
Name | Type | Description |
---|
edges | StakeLinkingEdge | Page of stake data and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
TradeConnection
Page of trades and corresponding page information
Name | Type | Description |
---|
edges | TradeEdge | Page of trades and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
TradeEdge
Trade data item with the corresponding cursor..
Name | Type | Description |
---|
node | vega.Trade | Data associated with a trade that has been executed. |
cursor | string | Cursor that can be used to fetch further pages. |
TransferConnection
Page of transfers data items and corresponding page information
Name | Type | Description |
---|
edges | TransferEdge | Page of transfers data and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
TransferEdge
Transfers data with the corresponding cursor.
Name | Type | Description |
---|
node | vega.events.v1.Transfer | Data relating to a transfer that has been made. |
cursor | string | Cursor that can be used to fetch further pages. |
VoteConnection
Page of vote data items and corresponding page information
Name | Type | Description |
---|
edges | VoteEdge | Page of vote data and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
VoteEdge
Votes data with the corresponding cursor.
Name | Type | Description |
---|
node | vega.Vote | Data associated with a governance vote. |
cursor | string | Cursor that can be used to fetch further pages. |
WithdrawalEdge
Withdrawals data with the corresponding cursor.
Name | Type | Description |
---|
node | vega.Withdrawal | Data associated with a single withdrawal made from the Vega network. |
cursor | string | Cursor that can be used to fetch further pages. |
WithdrawalsConnection
Page of withdrawals data and corresponding page information
Name | Type | Description |
---|
edges | WithdrawalEdge | Page of withdrawals data and their corresponding cursors. |
page_info | PageInfo | Page information that is used for fetching further pages. |
Enums
AccountField
List of the properties of an account, used for grouping
Name | Number | Description |
---|
ACCOUNT_FIELD_UNSPECIFIED | 0 | |
ACCOUNT_FIELD_ID | 1 | |
ACCOUNT_FIELD_PARTY_ID | 2 | |
ACCOUNT_FIELD_ASSET_ID | 3 | |
ACCOUNT_FIELD_MARKET_ID | 4 | |
ACCOUNT_FIELD_TYPE | 5 | |
LedgerEntryField
List of fields for a ledger entry
Name | Number | Description |
---|
LEDGER_ENTRY_FIELD_UNSPECIFIED | 0 | |
LEDGER_ENTRY_FIELD_ACCOUNT_FROM_ID | 1 | |
LEDGER_ENTRY_FIELD_ACCOUNT_TO_ID | 2 | |
LEDGER_ENTRY_FIELD_TRANSFER_TYPE | 3 | |
ListGovernanceDataRequest.Type
Filter for the types of governance proposals to view
Name | Number | Description |
---|
TYPE_UNSPECIFIED | 0 | |
TYPE_ALL | 1 | List all proposals |
TYPE_NEW_MARKET | 2 | List new market proposals |
TYPE_UPDATE_MARKET | 3 | List update market proposals |
TYPE_NETWORK_PARAMETERS | 4 | List change Vega network parameter proposals |
TYPE_NEW_ASSET | 5 | New asset proposals |
TYPE_NEW_FREE_FORM | 6 | Proposals for creating a new free form proposal |
TYPE_UPDATE_ASSET | 7 | Update asset proposals |
Table
Name | Number | Description |
---|
TABLE_UNSPECIFIED | 0 | |
TABLE_BALANCES | 1 | |
TABLE_CHECKPOINTS | 2 | |
TABLE_DELEGATIONS | 3 | |
TABLE_LEDGER | 4 | |
TABLE_ORDERS | 5 | |
TABLE_TRADES | 6 | |
TABLE_MARKET_DATA | 7 | |
TABLE_MARGIN_LEVELS | 8 | |
TABLE_POSITIONS | 9 | |
TABLE_LIQUIDITY_PROVISIONS | 10 | |
TABLE_MARKETS | 11 | |
TABLE_DEPOSITS | 12 | |
TABLE_WITHDRAWALS | 13 | |
TABLE_BLOCKS | 14 | |
TABLE_REWARDS | 15 | |
TransferDirection
Direction of a transfer
Name | Number | Description |
---|
TRANSFER_DIRECTION_UNSPECIFIED | 0 | |
TRANSFER_DIRECTION_TRANSFER_FROM | 1 | |
TRANSFER_DIRECTION_TRANSFER_TO | 2 | |
TRANSFER_DIRECTION_TRANSFER_TO_OR_FROM | 3 | |
Services
TradingDataService
ListAccounts
Method | ListAccounts |
---|
Request | ListAccountsRequest |
---|
Response | ListAccountsResponse |
---|
Description | List accounts
Get a list of accounts matching the supplied filter, including their current balances.
If a given account has never had a balance, it will be absent from the list. |
---|
ObserveAccounts
Info
Method | Info |
---|
Request | InfoRequest |
---|
Response | InfoResponse |
---|
Description | Data node information
Get information about the data node.
Response contains a semver formatted version of the data node and the commit hash, from which the data node was built |
---|
GetOrder
Method | GetOrder |
---|
Request | GetOrderRequest |
---|
Response | GetOrderResponse |
---|
Description | Get order
Get the current version of an order, or optionally provide a version ID to retrieve a given version if order was amended. |
---|
ListOrders
ListOrderVersions
ObserveOrders
ListPositions
Method | ListPositions |
---|
Request | ListPositionsRequest |
---|
Response | ListPositionsResponse |
---|
Description | Deprecated: List positions
Get a list of positions by party's public key using cursor based pagination
Deprecated: use ListAllPositions instead |
---|
ListAllPositions
ObservePositions
ListLedgerEntries
Method | ListLedgerEntries |
---|
Request | ListLedgerEntriesRequest |
---|
Response | ListLedgerEntriesResponse |
---|
Description | List ledger entries
Get a list of ledger entries within the given date range.
This query requests and sums the number of ledger entries from a given subset of accounts, specified via the 'filter' argument.
It returns a time series - implemented as a list of AggregateLedgerEntry structs - with a row for every time
the summed ledger entries of the set of specified accounts changes.
Each account filter must contain no more than one party ID.
Entries can be filtered by:
- the sending account (market ID, asset ID, account type)
- receiving account (market ID, asset ID, account type)
- sending AND receiving account
- transfer type either in addition to the above filters or as a standalone option |
---|
ExportLedgerEntries
Method | ExportLedgerEntries |
---|
Request | ExportLedgerEntriesRequest |
---|
Response | HttpBody stream |
---|
Description | Export ledger entries
Export ledger entries records ledger entries to a csv file.
May or may not contain a date range - if no date range is provided, list all records for all times.
Ledger entries can be exported by:
- export ledger entries for a single party for a given asset within a given time range
- export ledger entries for a single party for a given asset for all times
buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE |
---|
ListBalanceChanges
Method | ListBalanceChanges |
---|
Request | ListBalanceChangesRequest |
---|
Response | ListBalanceChangesResponse |
---|
Description | List balance changes
Get a list of the changes in account balances over a period of time.
An account is defined as a set of asset_id, type, party_id, and market_id.
- Every account has an associated asset and type.
- Certain account types such as the global reward pool for example, do not have an associated party.
These are denoted by the special party ID 'network'
- Certain account types do not have an associated market such as the general party accounts, for example.
These are denoted by the special market ID '' (the empty string)
`ListBalanceChangesRequest` will return a list of `AggregatedBalance` records,
with a row for each block at which a given account's balance changes. |
---|
GetLatestMarketData
ListLatestMarketData
GetLatestMarketDepth
ObserveMarketsDepth
ObserveMarketsDepthUpdates
ObserveMarketsData
GetMarketDataHistoryByID
ListTransfers
GetNetworkLimits
ListCandleData
Method | ListCandleData |
---|
Request | ListCandleDataRequest |
---|
Response | ListCandleDataResponse |
---|
Description | List candle data
Get a list of candle data for a given candle ID. You can get a candle ID from the list candle intervals query |
---|
ObserveCandleData
ListCandleIntervals
ListVotes
ObserveVotes
ListERC20MultiSigSignerAddedBundles
ListERC20MultiSigSignerRemovedBundles
GetERC20ListAssetBundle
GetERC20SetAssetLimitsBundle
GetERC20WithdrawalApproval
GetLastTrade
ListTrades
ObserveTrades
GetOracleSpec
ListOracleSpecs
ListOracleData
GetMarket
Method | GetMarket |
---|
Request | GetMarketRequest |
---|
Response | GetMarketResponse |
---|
Description | Get market
Get information about a specific market using its ID. Use the market lists query to get a market's ID |
---|
ListMarkets
GetParty
ListParties
ListMarginLevels
ObserveMarginLevels
ListRewards
Method | ListRewards |
---|
Request | ListRewardsRequest |
---|
Response | ListRewardsResponse |
---|
Description | List rewards
Get a list of rewards that match the provided criteria. If no filter is provided, all rewards will be returned. |
---|
ListRewardSummaries
Method | ListRewardSummaries |
---|
Request | ListRewardSummariesRequest |
---|
Response | ListRewardSummariesResponse |
---|
Description | List reward summaries
Get a list of reward summaries where the reward amount is the total rewards received over all epochs
per party ID and asset ID.
Request parameters are optional party ID and asset ID.
If no data is provided, all reward summaries will be returned grouped by party and asset ID. |
---|
ListEpochRewardSummaries
Method | ListEpochRewardSummaries |
---|
Request | ListEpochRewardSummariesRequest |
---|
Response | ListEpochRewardSummariesResponse |
---|
Description | List epoch reward summaries
Get a list of reward summaries by epoch for a given range of epochs.
The result is filtered by list of asset IDs, market IDs and starting and ending epochs, for which to return rewards.
If no data is provided, all reward summaries will be returned, grouped by epochs, market IDs, asset IDs and reward type. |
---|
GetDeposit
ListDeposits
Method | ListDeposits |
---|
Request | ListDepositsRequest |
---|
Response | ListDepositsResponse |
---|
Description | List deposits
Get a list of deposits for a given party.
If a date range is provided, filtering will be based on the last time the deposit
has been updated in Vega time. |
---|
GetWithdrawal
ListWithdrawals
GetAsset
Method | GetAsset |
---|
Request | GetAssetRequest |
---|
Response | GetAssetResponse |
---|
Description | Get asset
Get a single asset using its ID. Use the assets list query to get an asset's ID |
---|
ListAssets
ListLiquidityProvisions
ObserveLiquidityProvisions
GetGovernanceData
ListGovernanceData
ObserveGovernance
ListDelegations
GetNetworkData
GetNode
ListNodes
ListNodeSignatures
GetEpoch
Method | GetEpoch |
---|
Request | GetEpochRequest |
---|
Response | GetEpochResponse |
---|
Description | Get epoch
Get data for a specific epoch, if ID is omitted, it retrieves the current epoch |
---|
EstimateFee
Method | EstimateFee |
---|
Request | EstimateFeeRequest |
---|
Response | EstimateFeeResponse |
---|
Description | Estimate fee
Estimate the fee that would be incurred for submitting an order
with the specified price and size on the market. |
---|
EstimateMargin
EstimatePosition
Method | EstimatePosition |
---|
Request | EstimatePositionRequest |
---|
Response | EstimatePositionResponse |
---|
Description | Estimate position
Estimate the margin that would be required for maintaining the specified position.
If the optional collateral available argument is supplied, the response also contains the estimate of the liquidation price. |
---|
ListNetworkParameters
GetNetworkParameter
ListCheckpoints
GetStake
GetRiskFactors
ObserveEventBus
ObserveLedgerMovements
ListKeyRotations
ListEthereumKeyRotations
GetVegaTime
GetProtocolUpgradeStatus
ListProtocolUpgradeProposals
ListCoreSnapshots
GetMostRecentNetworkHistorySegment
ListAllNetworkHistorySegments
GetActiveNetworkHistoryPeerAddresses
GetNetworkHistoryStatus
GetNetworkHistoryBootstrapPeers
ListEntities
ExportNetworkHistory
Method | ExportNetworkHistory |
---|
Request | ExportNetworkHistoryRequest |
---|
Response | HttpBody stream |
---|
Description | Export network history as CSV
Export CSV table data from network history between two block heights.
The requested block heights must fall on network history segment boundaries, which can
be discovered by calling the API to list all network history segments. By default
segments contain 1000 blocks. In that case ranges such as (1, 1000), (1001, 2000), (1, 3000)
would all fall on segment boundaries and be valid.
The generated CSV file is compressed into a ZIP file and returned, with the file name
in the following format: [chain id]-[table name]-[start block]-[end block].zip
In gRPC, results are returned in a chunked stream of base64 encoded data.
Through the REST gateway, the base64 data chunks are decoded and streamed as a
`content-type: application/zip` HTTP response.
The CSV exported data uses a comma as a DELIMITER between fields, and " for QUOTE-ing fields.
If a value contains any of: DELIMITER, QUOTE, carriage return, or line feed then the whole
value is prefixed and suffixed by the QUOTE character and any occurrence within
the value of a QUOTE character preceded by another QUOTE.
A NULL is output as the NULL parameter string and is not quoted, while a non-NULL value
matching the NULL parameter string is quoted.
For example, with the default settings, a NULL is written as an unquoted empty string,
while an empty string data value is written with double quotes.
Note that CSV files produced may contain quoted values containing embedded carriage returns and line feeds.
Thus the files are not strictly one line per table row like text-format files.
The first row of the CSV file is a header that describes the contents of each column
in subsequent rows.
Usually the ZIP file will contain only a single CSV file. However it is possible that
the (from_block, to_block) request spans over a range of blocks in which the underlying
schema of the database changes. For example, a column may have been added, removed, or renamed.
If this happens, the CSV file will be split at the point of the schema change and the zip
file will contain multiple CSV files, with a potentially different set of headers. The
'version' number of the database schema is part of the in the CSV filename:
[chain id]-[table name]-[schema version]-[start block]-[end block].zip
For example, a zip file might be called mainnet-sometable-000001-003000.zip
And contain two CSV files: mainnet-sometable-1-000001-002000.csv:
timestamp, value
1, foo
2, bar
And mainnet-sometable-2-002001-003000.csv:
timestamp, value, extra_value
3, baz, apple
It is worth noting that the schema will not change within a single network history segment.
buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE |
---|
Ping