code.vegaprotocol.io/vega@v0.79.0/protos/sources/data-node/api/v2/trading_data.proto (about) 1 syntax = "proto3"; 2 3 package datanode.api.v2; 4 5 import "google/api/field_behavior.proto"; 6 import "google/api/httpbody.proto"; 7 import "protoc-gen-openapiv2/options/annotations.proto"; 8 import "vega/assets.proto"; 9 import "vega/commands/v1/validator_commands.proto"; 10 import "vega/events/v1/events.proto"; 11 import "vega/governance.proto"; 12 import "vega/markets.proto"; 13 import "vega/oracle.proto"; 14 import "vega/vega.proto"; 15 16 option go_package = "code.vegaprotocol.io/vega/protos/data-node/api/v2"; 17 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { 18 info: { 19 title: "Vega data node APIs"; 20 version: "v0.79.0"; 21 } 22 schemes: [ 23 HTTP, 24 HTTPS 25 ]; 26 host: "https://api.testnet.vega.xyz"; 27 consumes: "application/json"; 28 responses: {// can add more keys here to specify common errors between all endpoints, can also be overwritten per rpc call 29 key: "500"; 30 value: { 31 description: "An internal server error"; 32 schema: { 33 json_schema: {ref: ".google.rpc.Status"} 34 } 35 } 36 } 37 }; 38 39 service TradingDataService { 40 // List accounts 41 // 42 // Get a list of accounts matching the supplied filter, including their current balances. 43 // If a given account has never had a balance, it will be absent from the list. 44 rpc ListAccounts(ListAccountsRequest) returns (ListAccountsResponse) { 45 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Accounts"}; 46 } 47 48 // Accounts subscription 49 // 50 // Subscribe to a stream of accounts 51 rpc ObserveAccounts(ObserveAccountsRequest) returns (stream ObserveAccountsResponse) { 52 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Accounts"}; 53 } 54 55 // Data node information 56 // 57 // Get information about the data node. 58 // Response contains a semver formatted version of the data node and the commit hash, from which the data node was built 59 rpc Info(InfoRequest) returns (InfoResponse) { 60 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Node information"}; 61 } 62 63 // Get order 64 // 65 // Get an order by its ID. An order's ID will be the SHA3-256 hash of the signature that the order was submitted with 66 rpc GetOrder(GetOrderRequest) returns (GetOrderResponse) { 67 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Orders"}; 68 } 69 70 // List orders 71 // 72 // Get a list of orders that match the given filters 73 rpc ListOrders(ListOrdersRequest) returns (ListOrdersResponse) { 74 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Orders"}; 75 } 76 77 // List order versions 78 // 79 // Get a list of all versions of an order in the order history 80 rpc ListOrderVersions(ListOrderVersionsRequest) returns (ListOrderVersionsResponse) { 81 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Orders"}; 82 } 83 84 // Observe orders 85 // 86 // Subscribe to a stream of orders 87 rpc ObserveOrders(ObserveOrdersRequest) returns (stream ObserveOrdersResponse) { 88 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Orders"}; 89 } 90 91 // Get stop order 92 // 93 // Get a stop order by its ID. A stop order's ID will be the SHA3-256 hash of the signature that the order was submitted with. 94 // A stop order's ID is likely to be different from the ID of the order that will be submitted when the stop is triggered. 95 rpc GetStopOrder(GetStopOrderRequest) returns (GetStopOrderResponse) { 96 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Orders"}; 97 } 98 99 // List stop orders 100 // 101 // Get a list of stop orders that match the given filters 102 rpc ListStopOrders(ListStopOrdersRequest) returns (ListStopOrdersResponse) { 103 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Orders"}; 104 } 105 106 // List game team scores 107 // 108 // Get a list of team scores for the given filters 109 rpc ListGameTeamScores(ListGameTeamScoresRequest) returns (ListGameTeamScoresResponse) { 110 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Games"}; 111 } 112 113 // List game party scores 114 // 115 // Get a list of party scores for the given filters 116 rpc ListGamePartyScores(ListGamePartyScoresRequest) returns (ListGamePartyScoresResponse) { 117 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Games"}; 118 } 119 120 // Deprecated: List positions 121 // 122 // Get a list of positions by party's public key using cursor based pagination 123 // Deprecated: use ListAllPositions instead 124 rpc ListPositions(ListPositionsRequest) returns (ListPositionsResponse) { 125 option deprecated = true; 126 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Positions"}; 127 } 128 129 // List positions 130 // 131 // Get a list of all of a party's positions 132 rpc ListAllPositions(ListAllPositionsRequest) returns (ListAllPositionsResponse) { 133 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Positions"}; 134 } 135 136 // Observe positions 137 // 138 // Subscribe to a stream of position updates. The first messages sent through the stream will contain 139 // information about current positions, followed by updates to those positions. 140 rpc ObservePositions(ObservePositionsRequest) returns (stream ObservePositionsResponse) { 141 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Positions"}; 142 } 143 144 // List ledger entries 145 // 146 // Get a list of ledger entries within the given date range. The date range is restricted to a maximum of 5 days. 147 // This query requests and sums the number of ledger entries from a given subset of accounts, specified via the 'filter' argument. 148 // It returns a time series - implemented as a list of AggregateLedgerEntry structs - with a row for every time 149 // the summed ledger entries of the set of specified accounts changes. 150 // Each account filter must contain no more than one party ID. 151 // At least one party ID must be specified in the from or to account filter. 152 // 153 // Entries can be filtered by: 154 // - the sending account (market ID, asset ID, account type) 155 // - receiving account (market ID, asset ID, account type) 156 // - sending AND receiving account 157 // - transfer type either in addition to the above filters or as a standalone option 158 // Note: The date range is restricted to any 5 days. 159 // If no start or end date is provided, only ledger entries from the last 5 days will be returned. 160 // If a start and end date are provided, but the end date is more than 5 days after the start date, only data up to 5 days after the start date will be returned. 161 // If a start date is provided but no end date, the end date will be set to 5 days after the start date. 162 // If no start date is provided, but the end date is, the start date will be set to 5 days before the end date. 163 rpc ListLedgerEntries(ListLedgerEntriesRequest) returns (ListLedgerEntriesResponse) { 164 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Ledger entries"}; 165 } 166 167 // Export ledger entries 168 // 169 // Export ledger entries records ledger entries to a csv file. 170 // May or may not contain a date range - if no date range is provided, list all records for all times. 171 // 172 // Ledger entries can be exported by: 173 // - export ledger entries for a single party for a given asset within a given time range 174 // - export ledger entries for a single party for a given asset for all times 175 // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME 176 // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE 177 rpc ExportLedgerEntries(ExportLedgerEntriesRequest) returns (stream google.api.HttpBody) { 178 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Ledger entries"}; 179 } 180 181 // List balance changes 182 // 183 // Get a list of the changes in account balances over a period of time. 184 rpc ListBalanceChanges(ListBalanceChangesRequest) returns (ListBalanceChangesResponse) { 185 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Accounts"}; 186 } 187 188 // Get latest market data 189 // 190 // Get the latest market data for a given market 191 rpc GetLatestMarketData(GetLatestMarketDataRequest) returns (GetLatestMarketDataResponse) { 192 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"}; 193 } 194 195 // List latest market data 196 // 197 // Get a list of the latest market data for every market 198 rpc ListLatestMarketData(ListLatestMarketDataRequest) returns (ListLatestMarketDataResponse) { 199 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"}; 200 } 201 202 // Get latest market depth 203 // 204 // Get the latest market depth for a given market 205 rpc GetLatestMarketDepth(GetLatestMarketDepthRequest) returns (GetLatestMarketDepthResponse) { 206 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"}; 207 } 208 209 // Observe markets depth 210 // 211 // Subscribe to a stream of the latest market depth for a given market 212 rpc ObserveMarketsDepth(ObserveMarketsDepthRequest) returns (stream ObserveMarketsDepthResponse) { 213 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"}; 214 } 215 216 // Observe markets depth updates 217 // 218 // Subscribe to a stream of updates on market depth for a given market 219 rpc ObserveMarketsDepthUpdates(ObserveMarketsDepthUpdatesRequest) returns (stream ObserveMarketsDepthUpdatesResponse) { 220 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"}; 221 } 222 223 // Observe markets data 224 // 225 // Subscribe to a stream of data about a given market 226 rpc ObserveMarketsData(ObserveMarketsDataRequest) returns (stream ObserveMarketsDataResponse) { 227 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"}; 228 } 229 230 // Get market data history 231 // 232 // Get market data history for a market ID from between a given date range 233 rpc GetMarketDataHistoryByID(GetMarketDataHistoryByIDRequest) returns (GetMarketDataHistoryByIDResponse) { 234 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"}; 235 } 236 237 // List transfers 238 // 239 // Get a list of transfers between public keys. A valid value for public key can be one of: 240 // - a party ID 241 // - "network" 242 // - "0000000000000000000000000000000000000000000000000000000000000000", the public key for the global rewards account 243 rpc ListTransfers(ListTransfersRequest) returns (ListTransfersResponse) { 244 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Transfers"}; 245 } 246 247 // Get transfer by ID 248 // 249 // Get a specific transfer by ID 250 rpc GetTransfer(GetTransferRequest) returns (GetTransferResponse) { 251 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Transfers"}; 252 } 253 254 // Get network limits 255 // 256 // Get the network limits relating to asset and market creation 257 rpc GetNetworkLimits(GetNetworkLimitsRequest) returns (GetNetworkLimitsResponse) { 258 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"}; 259 } 260 261 // List candle data 262 // 263 // Get a list of candle data for a given candle ID. 264 // A candle ID encapsulates a market ID and candle interval. A list of available candle IDs, and therefore candle intervals can be found using the list-candle-intervals API. 265 rpc ListCandleData(ListCandleDataRequest) returns (ListCandleDataResponse) { 266 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Candles"}; 267 } 268 269 // Observe candle data 270 // 271 // Subscribe to a stream of candle updates given a candle ID. 272 // A candle ID encapsulates a market ID and candle interval. A list of available candle IDs, and therefore candle intervals can be found using the list-candle-intervals API. 273 rpc ObserveCandleData(ObserveCandleDataRequest) returns (stream ObserveCandleDataResponse) { 274 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Candles"}; 275 } 276 277 // List candle intervals 278 // 279 // Get a list of all available candle intervals for a given market along with the corresponding candle ID. 280 rpc ListCandleIntervals(ListCandleIntervalsRequest) returns (ListCandleIntervalsResponse) { 281 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Candles"}; 282 } 283 284 // List votes 285 // 286 // Get a list of votes. A party ID or a proposal ID must be provided. 287 rpc ListVotes(ListVotesRequest) returns (ListVotesResponse) { 288 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Governance"}; 289 } 290 291 // Observe votes 292 // 293 // Subscribe to a stream of votes cast on a given proposal, or by all votes made by a given party 294 rpc ObserveVotes(ObserveVotesRequest) returns (stream ObserveVotesResponse) { 295 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Governance"}; 296 } 297 298 // List ERC20 multisig signer added bundles 299 // 300 // Get a list of the signature bundles to add a particular validator to the signer list of the multisig contract 301 rpc ListERC20MultiSigSignerAddedBundles(ListERC20MultiSigSignerAddedBundlesRequest) returns (ListERC20MultiSigSignerAddedBundlesResponse) { 302 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "ERC20 bridge"}; 303 } 304 305 // List ERC20 multisig signer removed bundles 306 // 307 // Get a list of the signature bundles to remove a particular validator from signer list of the multisig contract 308 rpc ListERC20MultiSigSignerRemovedBundles(ListERC20MultiSigSignerRemovedBundlesRequest) returns (ListERC20MultiSigSignerRemovedBundlesResponse) { 309 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "ERC20 bridge"}; 310 } 311 312 // Get ERC20 list asset bundle 313 // 314 // Get the signatures bundle to allowlist an ERC20 token in the collateral bridge 315 rpc GetERC20ListAssetBundle(GetERC20ListAssetBundleRequest) returns (GetERC20ListAssetBundleResponse) { 316 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "ERC20 bridge"}; 317 } 318 319 // Get ERC20 set asset limits bundle 320 // 321 // Get the signature bundle to update the token limits. These are `maxLifetimeDeposit` and `withdrawThreshold` for a given ERC20 token that is 322 // already allowlisted in the collateral bridge. 323 rpc GetERC20SetAssetLimitsBundle(GetERC20SetAssetLimitsBundleRequest) returns (GetERC20SetAssetLimitsBundleResponse) { 324 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "ERC20 bridge"}; 325 } 326 327 // Get ERC20 withdrawal approval 328 // 329 // Get the signature bundle to finalise a withdrawal on Ethereum 330 rpc GetERC20WithdrawalApproval(GetERC20WithdrawalApprovalRequest) returns (GetERC20WithdrawalApprovalResponse) { 331 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "ERC20 bridge"}; 332 } 333 334 // Get last trade 335 // 336 // Get the last trade made for a given market. 337 rpc GetLastTrade(GetLastTradeRequest) returns (GetLastTradeResponse) { 338 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Trades"}; 339 } 340 341 // List trades 342 // 343 // Get a list of all trades, optionally filtered by party/market/order 344 rpc ListTrades(ListTradesRequest) returns (ListTradesResponse) { 345 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Trades"}; 346 } 347 348 // Observe trades 349 // 350 // Subscribe to a stream of trades, optionally filtered by party/market 351 rpc ObserveTrades(ObserveTradesRequest) returns (stream ObserveTradesResponse) { 352 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Trades"}; 353 } 354 355 // Get oracle spec 356 // 357 // Get an oracle spec by ID. Oracle spec IDs can be found by querying markets that use them as a data source 358 rpc GetOracleSpec(GetOracleSpecRequest) returns (GetOracleSpecResponse) { 359 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Data sources"}; 360 } 361 362 // List oracle specs 363 // 364 // Get a list of all oracles specs that are defined against all markets 365 rpc ListOracleSpecs(ListOracleSpecsRequest) returns (ListOracleSpecsResponse) { 366 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Data sources"}; 367 } 368 369 // List oracle data 370 // 371 // Get a list of all oracle data that have been broadcast to any market 372 rpc ListOracleData(ListOracleDataRequest) returns (ListOracleDataResponse) { 373 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Data sources"}; 374 } 375 376 // Get market 377 // 378 // Get information about a specific market using its ID. A market's ID will be the same as the ID of the proposal that 379 // generated it 380 rpc GetMarket(GetMarketRequest) returns (GetMarketResponse) { 381 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"}; 382 } 383 384 // List markets 385 // 386 // Get a list of markets 387 rpc ListMarkets(ListMarketsRequest) returns (ListMarketsResponse) { 388 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"}; 389 } 390 391 // List successor markets 392 // 393 // Given a market ID, return the full lineage of markets since inception, or all successor markets since and including 394 // the given market ID. The markets will be returned in succession order, i.e. the market at position i will be the parent 395 // of the market at position i+1. 396 rpc ListSuccessorMarkets(ListSuccessorMarketsRequest) returns (ListSuccessorMarketsResponse) { 397 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"}; 398 } 399 400 // Get party 401 // 402 // Get a single party 403 rpc GetParty(GetPartyRequest) returns (GetPartyResponse) { 404 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Parties"}; 405 } 406 407 // List parties 408 // 409 // Get a list of parties 410 rpc ListParties(ListPartiesRequest) returns (ListPartiesResponse) { 411 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Parties"}; 412 } 413 414 // List parties' profiles 415 // 416 // Get a list of profiles for multiple parties 417 rpc ListPartiesProfiles(ListPartiesProfilesRequest) returns (ListPartiesProfilesResponse) { 418 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Parties"}; 419 } 420 421 // List margin levels 422 // 423 // Get a list of margin levels that match the provided criteria. If no filter is provided, all margin levels will be returned. 424 rpc ListMarginLevels(ListMarginLevelsRequest) returns (ListMarginLevelsResponse) { 425 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Margin"}; 426 } 427 428 // Observe margin levels 429 // 430 // Subscribe to a stream of margin levels updates 431 rpc ObserveMarginLevels(ObserveMarginLevelsRequest) returns (stream ObserveMarginLevelsResponse) { 432 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Margin"}; 433 } 434 435 // List rewards 436 // 437 // Get a list of rewards that match the provided criteria. If no filter is provided, all rewards will be returned. 438 rpc ListRewards(ListRewardsRequest) returns (ListRewardsResponse) { 439 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Rewards"}; 440 } 441 442 // List reward summaries 443 // 444 // Get a list of reward summaries where the reward amount is the total rewards received over all epochs 445 // per party ID and asset ID. 446 // Request parameters are optional party ID and asset ID. 447 // If no data is provided, all reward summaries will be returned grouped by party and asset ID. 448 rpc ListRewardSummaries(ListRewardSummariesRequest) returns (ListRewardSummariesResponse) { 449 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Rewards"}; 450 } 451 452 // List epoch reward summaries 453 // 454 // Get a list of reward summaries by epoch for a given range of epochs. 455 // The result is filtered by a list of asset IDs, market IDs and starting and ending epochs, for which to return rewards. 456 // If no data is provided, all reward summaries will be returned, grouped by epochs, market IDs, asset IDs and reward type. 457 rpc ListEpochRewardSummaries(ListEpochRewardSummariesRequest) returns (ListEpochRewardSummariesResponse) { 458 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Rewards"}; 459 } 460 461 // Get deposit 462 // 463 // Get a deposit by its ID 464 rpc GetDeposit(GetDepositRequest) returns (GetDepositResponse) { 465 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Assets"}; 466 } 467 468 // List deposits 469 // 470 // Get a list of deposits for a given party. 471 // If a date range is provided, filtering will be based on the last time the deposit 472 // has been updated in Vega time. 473 rpc ListDeposits(ListDepositsRequest) returns (ListDepositsResponse) { 474 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Assets"}; 475 } 476 477 // Get withdrawal 478 // 479 // Get a withdrawal by its ID. A withdrawal's ID will be the SHA3-256 hash of the signature that the withdrawal was submitted with 480 rpc GetWithdrawal(GetWithdrawalRequest) returns (GetWithdrawalResponse) { 481 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Assets"}; 482 } 483 484 // List withdrawals 485 // 486 // Get a list of withdrawals for a given party 487 rpc ListWithdrawals(ListWithdrawalsRequest) returns (ListWithdrawalsResponse) { 488 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Assets"}; 489 } 490 491 // Get asset 492 // 493 // Get a single asset using its ID. Use the assets list query to get an asset's ID 494 rpc GetAsset(GetAssetRequest) returns (GetAssetResponse) { 495 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Assets"}; 496 } 497 498 // List assets 499 // 500 // Get a list of assets available on the Vega network 501 rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { 502 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Assets"}; 503 } 504 505 // List liquidity provisions 506 // 507 // DEPRECATED: When a liquidity provider amends a provision, and it's accepted by the network, the pending 508 // provision is returned by the API instead of the provision that is currently active. 509 // Use ListAllLiquidityProvisions instead. 510 rpc ListLiquidityProvisions(ListLiquidityProvisionsRequest) returns (ListLiquidityProvisionsResponse) { 511 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Liquidity"}; 512 option deprecated = true; 513 } 514 515 // List liquidity provisions 516 // 517 // Get a list of liquidity provisions for a given market. This API returns a current and pending liquidity provision 518 // in the event that a provision has been updated by the provider but the updated provision will not be active until the next epoch. 519 rpc ListAllLiquidityProvisions(ListAllLiquidityProvisionsRequest) returns (ListAllLiquidityProvisionsResponse) { 520 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Liquidity"}; 521 } 522 523 // Observe liquidity provisions 524 // 525 // Subscribe to a stream of liquidity provision events for a given market and party 526 rpc ObserveLiquidityProvisions(ObserveLiquidityProvisionsRequest) returns (stream ObserveLiquidityProvisionsResponse) { 527 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Liquidity"}; 528 } 529 530 // List liquidity providers data 531 // 532 // List information about active liquidity provider(s) for a given market, or liquidity provider's party ID. 533 rpc ListLiquidityProviders(ListLiquidityProvidersRequest) returns (ListLiquidityProvidersResponse) { 534 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Liquidity"}; 535 } 536 537 // List paid liquidity fees data 538 // 539 // List information about paid liquidity fees for a given market, or asset ID. 540 rpc ListPaidLiquidityFees(ListPaidLiquidityFeesRequest) returns (ListPaidLiquidityFeesResponse) { 541 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Liquidity"}; 542 } 543 544 // Get governance data 545 // 546 // Get a single proposal's details either by proposal ID or by reference 547 rpc GetGovernanceData(GetGovernanceDataRequest) returns (GetGovernanceDataResponse) { 548 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Governance"}; 549 } 550 551 // List governance data 552 // 553 // Get a list of proposals 554 rpc ListGovernanceData(ListGovernanceDataRequest) returns (ListGovernanceDataResponse) { 555 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Governance"}; 556 } 557 558 // Observe governance 559 // 560 // Subscribe to a stream of updates to governance proposals 561 rpc ObserveGovernance(ObserveGovernanceRequest) returns (stream ObserveGovernanceResponse) { 562 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Governance"}; 563 } 564 565 // List delegations 566 // 567 // Get a list of the token delegations on the network 568 rpc ListDelegations(ListDelegationsRequest) returns (ListDelegationsResponse) { 569 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"}; 570 } 571 572 // Get network data 573 // 574 // Get data regarding the nodes of the network 575 rpc GetNetworkData(GetNetworkDataRequest) returns (GetNetworkDataResponse) { 576 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"}; 577 } 578 579 // Get node 580 // 581 // Get information about a given node 582 rpc GetNode(GetNodeRequest) returns (GetNodeResponse) { 583 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"}; 584 } 585 586 // List nodes 587 // 588 // Get a list of the nodes on the network along with the related information. 589 rpc ListNodes(ListNodesRequest) returns (ListNodesResponse) { 590 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"}; 591 } 592 593 // List node signatures 594 // 595 // Get a list of aggregate signatures from all the nodes of the network 596 rpc ListNodeSignatures(ListNodeSignaturesRequest) returns (ListNodeSignaturesResponse) { 597 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "ERC20 bridge"}; 598 } 599 600 // Get epoch 601 // 602 // Get data for a specific epoch, if ID is omitted, it retrieves the current epoch 603 rpc GetEpoch(GetEpochRequest) returns (GetEpochResponse) { 604 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"}; 605 } 606 607 // Estimate fee 608 // 609 // Estimate the fee that would be incurred for submitting an order 610 // with the specified price and size on the market. 611 rpc EstimateFee(EstimateFeeRequest) returns (EstimateFeeResponse) { 612 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Orders"}; 613 } 614 615 // Estimate margin 616 // 617 // Estimate the margin that would be required for submitting this order 618 rpc EstimateMargin(EstimateMarginRequest) returns (EstimateMarginResponse) { 619 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Orders"}; 620 option deprecated = true; 621 } 622 623 // Estimate position 624 // 625 // Estimate the margin that would be required for maintaining the specified position, collateral increase needed to open the specified position and the liquidation price estimate. 626 // Margin estimates are scaled to asset decimal places. 627 // Liquidation price estimates are scaled to asset decimal places by default, unless an argument to scale to market decimal places is specified in the request. 628 rpc EstimatePosition(EstimatePositionRequest) returns (EstimatePositionResponse) { 629 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Positions"}; 630 } 631 632 // List network parameters 633 // 634 // Get a list of the network parameter keys and their values 635 rpc ListNetworkParameters(ListNetworkParametersRequest) returns (ListNetworkParametersResponse) { 636 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"}; 637 } 638 639 // Get network parameter 640 // 641 // Get a network parameter's value by its key 642 rpc GetNetworkParameter(GetNetworkParameterRequest) returns (GetNetworkParameterResponse) { 643 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"}; 644 } 645 646 // List checkpoints 647 // 648 // Get a list of information about checkpoints generated by the network 649 rpc ListCheckpoints(ListCheckpointsRequest) returns (ListCheckpointsResponse) { 650 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"}; 651 } 652 653 // Get stake 654 // 655 // Get staking information for a given party 656 rpc GetStake(GetStakeRequest) returns (GetStakeResponse) { 657 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"}; 658 } 659 660 // Get risk factors 661 // 662 // Get risk factor data for a given market 663 rpc GetRiskFactors(GetRiskFactorsRequest) returns (GetRiskFactorsResponse) { 664 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"}; 665 } 666 667 // Observe event bus 668 // 669 // Subscribe to a stream of events from the core 670 rpc ObserveEventBus(stream ObserveEventBusRequest) returns (stream ObserveEventBusResponse) { 671 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Events"}; 672 } 673 674 // Observe ledger movements 675 // 676 // Subscribe to a stream of transfer responses 677 rpc ObserveLedgerMovements(ObserveLedgerMovementsRequest) returns (stream ObserveLedgerMovementsResponse) { 678 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Ledger movements"}; 679 } 680 681 // List key rotations 682 // 683 // Get a list of information about Vega key rotations that have been performed by validator nodes 684 rpc ListKeyRotations(ListKeyRotationsRequest) returns (ListKeyRotationsResponse) { 685 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"}; 686 } 687 688 // List Ethereum key rotations 689 // 690 // Get a list of information about Ethereum key rotations that have been performed by validator nodes 691 rpc ListEthereumKeyRotations(ListEthereumKeyRotationsRequest) returns (ListEthereumKeyRotationsResponse) { 692 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"}; 693 } 694 695 // Get Vega time 696 // 697 // Get the current time of the network in Unix nanoseconds 698 rpc GetVegaTime(GetVegaTimeRequest) returns (GetVegaTimeResponse) { 699 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"}; 700 } 701 702 // Get protocol upgrade status 703 // 704 // Get status of a protocol upgrade 705 rpc GetProtocolUpgradeStatus(GetProtocolUpgradeStatusRequest) returns (GetProtocolUpgradeStatusResponse) { 706 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"}; 707 } 708 709 // List protocol upgrade proposals 710 // 711 // Get a list of protocol upgrade proposals, optionally filtering on status or approver. 712 rpc ListProtocolUpgradeProposals(ListProtocolUpgradeProposalsRequest) returns (ListProtocolUpgradeProposalsResponse) { 713 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"}; 714 } 715 716 // List snapshots 717 // 718 // Get a list of core snapshots taken 719 rpc ListCoreSnapshots(ListCoreSnapshotsRequest) returns (ListCoreSnapshotsResponse) { 720 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"}; 721 } 722 723 // Network History 724 // 725 // Network history allows the data node to reach out to peer nodes and fetch the most recent history, as well as 726 // older history if desired, such that it can quickly get itself up to the latest block height of the network and start 727 // to consume events for the latest block from the Vega core. 728 // See https://github.com/vegaprotocol/vega/tree/develop/datanode/networkhistory/README.md for a full description of network history 729 730 // Get most recent network history segment 731 // 732 // Get the network's most recently history segment 733 rpc GetMostRecentNetworkHistorySegment(GetMostRecentNetworkHistorySegmentRequest) returns (GetMostRecentNetworkHistorySegmentResponse) { 734 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network history"}; 735 } 736 737 // List all network history segments 738 // 739 // Get a list of all history segments stored by the data node currently connected to 740 rpc ListAllNetworkHistorySegments(ListAllNetworkHistorySegmentsRequest) returns (ListAllNetworkHistorySegmentsResponse) { 741 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network history"}; 742 } 743 744 // Get active network history peer addresses 745 // 746 // Get a list of the addresses of all active network history peers 747 rpc GetActiveNetworkHistoryPeerAddresses(GetActiveNetworkHistoryPeerAddressesRequest) returns (GetActiveNetworkHistoryPeerAddressesResponse) { 748 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network history"}; 749 } 750 751 // Network history status 752 // 753 // Get information about the current state of network history's IPFS swarm 754 rpc GetNetworkHistoryStatus(GetNetworkHistoryStatusRequest) returns (GetNetworkHistoryStatusResponse) { 755 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network history"}; 756 } 757 758 // Network history bootstrap peers 759 // 760 // Get a list of IPFS peers that can be used to initialise a new data node with network history 761 rpc GetNetworkHistoryBootstrapPeers(GetNetworkHistoryBootstrapPeersRequest) returns (GetNetworkHistoryBootstrapPeersResponse) { 762 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network history"}; 763 } 764 765 // List entities 766 // 767 // Get a list of all entities created by transaction hash 768 rpc ListEntities(ListEntitiesRequest) returns (ListEntitiesResponse) { 769 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Explorer"}; 770 } 771 772 // List funding periods 773 // 774 // Get a list of funding periods for a perpetual market. 775 rpc ListFundingPeriods(ListFundingPeriodsRequest) returns (ListFundingPeriodsResponse) { 776 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"}; 777 } 778 779 // List funding period data points 780 // 781 // Get a list of data points for a perpetual market's funding periods. 782 rpc ListFundingPeriodDataPoints(ListFundingPeriodDataPointsRequest) returns (ListFundingPeriodDataPointsResponse) { 783 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"}; 784 } 785 786 // List funding payments 787 // 788 // Get a list of funding payment gains and losses for a party as a result of their position on a perpetual market when a funding 789 // period ends. 790 rpc ListFundingPayments(ListFundingPaymentsRequest) returns (ListFundingPaymentsResponse) { 791 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"}; 792 } 793 794 // List party activity streak 795 // 796 // Get a party's activity across epochs. 797 rpc GetPartyActivityStreak(GetPartyActivityStreakRequest) returns (GetPartyActivityStreakResponse) { 798 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Referral program"}; 799 } 800 801 // Get current referral program 802 // 803 // Get the current referral program for the network. This program may not be active if it has ended 804 // and has not been replaced by another. 805 rpc GetCurrentReferralProgram(GetCurrentReferralProgramRequest) returns (GetCurrentReferralProgramResponse) { 806 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Referral program"}; 807 } 808 809 // List referral sets 810 // 811 // List all referral sets, or a specific referral set if you know its ID. 812 rpc ListReferralSets(ListReferralSetsRequest) returns (ListReferralSetsResponse) { 813 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Referral program"}; 814 } 815 816 // List referral set referees 817 // 818 // List all referees that belong to a referral set. 819 rpc ListReferralSetReferees(ListReferralSetRefereesRequest) returns (ListReferralSetRefereesResponse) { 820 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Referral program"}; 821 } 822 823 // Get referral set statistics 824 // 825 // Get the total taker volume, and each referee's taker volume and, reward and discount factors for a referral set 826 // at the latest or a specific epoch. You can also optionally filter for a specific referee's statistics. 827 rpc GetReferralSetStats(GetReferralSetStatsRequest) returns (GetReferralSetStatsResponse) { 828 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Referral program"}; 829 } 830 831 // List teams 832 // 833 // Get a list of all teams, or for a specific team by using team ID, or party ID of a referrer or referee 834 rpc ListTeams(ListTeamsRequest) returns (ListTeamsResponse) { 835 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Teams"}; 836 } 837 838 // List teams statistics 839 // 840 // Get the statistics of all teams, or for a specific team by using team ID, over a number of epochs. 841 // If a team does not have at least the number of epochs' worth of data, it is ignored. 842 rpc ListTeamsStatistics(ListTeamsStatisticsRequest) returns (ListTeamsStatisticsResponse) { 843 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Teams"}; 844 } 845 846 // List team members' statistics 847 // 848 // Get the statistics for all members of a given team, or for a specific member by using party ID, over a number of epochs. 849 // If a team does not have at least the number of epochs' worth of data, it is ignored. 850 rpc ListTeamMembersStatistics(ListTeamMembersStatisticsRequest) returns (ListTeamMembersStatisticsResponse) { 851 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Teams"}; 852 } 853 854 // List team referees 855 // 856 // Get a list of all referees for a given team ID 857 rpc ListTeamReferees(ListTeamRefereesRequest) returns (ListTeamRefereesResponse) { 858 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Teams"}; 859 } 860 861 // List referee team history 862 // 863 // Get a list of a referee's team history, i.e. the teams that a referee has been a member of and transferred from/to. 864 rpc ListTeamRefereeHistory(ListTeamRefereeHistoryRequest) returns (ListTeamRefereeHistoryResponse) { 865 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Teams"}; 866 } 867 868 // Get fees statistics 869 // 870 // Get accumulated fees, rewards, and applied discount information. Either a market or an asset must be supplied as a filter. 871 rpc GetFeesStats(GetFeesStatsRequest) returns (GetFeesStatsResponse) { 872 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Fees"}; 873 } 874 875 // Get fees statistics for a party 876 // 877 // Get accumulated fees, rewards, and applied discount information. A party ID must be supplied as a filter. 878 rpc GetFeesStatsForParty(GetFeesStatsForPartyRequest) returns (GetFeesStatsForPartyResponse) { 879 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Fees"}; 880 } 881 882 // Get current volume rebate program 883 // 884 // Get the current volume rebate program for the network. This program may not be active if it has ended 885 // and has not been replaced by another. 886 rpc GetCurrentVolumeRebateProgram(GetCurrentVolumeRebateProgramRequest) returns (GetCurrentVolumeRebateProgramResponse) { 887 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Volume rebate program"}; 888 } 889 890 // Get volume rebate statistics 891 // 892 // Get the information about a party's running traded volume, and the rebate factor it earns them. 893 rpc GetVolumeRebateStats(GetVolumeRebateStatsRequest) returns (GetVolumeRebateStatsResponse) { 894 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Volume rebate program"}; 895 } 896 897 // Get current volume discount program 898 // 899 // Get the current volume discount program for the network. This program may not be active if it has ended 900 // and has not been replaced by another. 901 rpc GetCurrentVolumeDiscountProgram(GetCurrentVolumeDiscountProgramRequest) returns (GetCurrentVolumeDiscountProgramResponse) { 902 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Volume discount program"}; 903 } 904 905 // Get volume discount statistics 906 // 907 // Get the information about a party's running traded volume, and the discount factor it earns them. 908 rpc GetVolumeDiscountStats(GetVolumeDiscountStatsRequest) returns (GetVolumeDiscountStatsResponse) { 909 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Volume discount program"}; 910 } 911 912 // Get vesting balances summary 913 // 914 // Get information about a party's vesting and locked balances 915 rpc GetVestingBalancesSummary(GetVestingBalancesSummaryRequest) returns (GetVestingBalancesSummaryResponse) { 916 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Vesting"}; 917 } 918 919 // Get vesting balance statistics 920 // 921 // Get information about a party's vesting rewards 922 rpc GetPartyVestingStats(GetPartyVestingStatsRequest) returns (GetPartyVestingStatsResponse) { 923 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Vesting"}; 924 } 925 926 // Observe transaction results 927 // 928 // Subscribe to a stream of transaction results, optionally filtered by party/hash/status 929 rpc ObserveTransactionResults(ObserveTransactionResultsRequest) returns (stream ObserveTransactionResultsResponse) { 930 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Transaction results"}; 931 } 932 933 // Estimate transfer fee costs 934 // 935 // Estimate transfer fee costs with potential discount applied 936 rpc EstimateTransferFee(EstimateTransferFeeRequest) returns (EstimateTransferFeeResponse) { 937 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Transfers"}; 938 } 939 940 // Available transfer fee discount 941 // 942 // Returns available per party per asset transfer discount 943 rpc GetTotalTransferFeeDiscount(GetTotalTransferFeeDiscountRequest) returns (GetTotalTransferFeeDiscountResponse) { 944 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Transfers"}; 945 } 946 947 // List games 948 // 949 // Get a list of games and corresponding game data, given the provided filters 950 rpc ListGames(ListGamesRequest) returns (ListGamesResponse) { 951 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Games"}; 952 } 953 954 // List margin modes per party per market 955 // 956 // Get a list of all margin modes, or for a specific market ID, or party ID. 957 rpc ListPartyMarginModes(ListPartyMarginModesRequest) returns (ListPartyMarginModesResponse) { 958 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Margin"}; 959 } 960 961 // Get time weighted notional position 962 // 963 // Get the time weighted notional position for a given party and asset. The time weighted notional position 964 // is used to check if a party qualifies for a reward. 965 // If no epoch is specified, the final time weighted notional position from the end of the most recently completed epoch is returned. 966 // If an epoch is specified, the final time weighted notional position at that epoch is returned. 967 rpc GetTimeWeightedNotionalPosition(GetTimeWeightedNotionalPositionRequest) returns (GetTimeWeightedNotionalPositionResponse) { 968 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Positions"}; 969 } 970 971 // List AMMs 972 // 973 // Get a list of AMM or filter by market ID, party ID or AMM ID 974 rpc ListAMMs(ListAMMsRequest) returns (ListAMMsResponse) { 975 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "AMMs"}; 976 } 977 978 // Estimate AMM bounds 979 // 980 // Get a list of AMMs or filter by market ID, party ID or AMM ID 981 rpc EstimateAMMBounds(EstimateAMMBoundsRequest) returns (EstimateAMMBoundsResponse) { 982 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "AMMs"}; 983 } 984 985 // Get the fees and discounts a party is entitled to. 986 // 987 // Get the discount and reward tiers, and the fees and rebates for a party per market. 988 rpc GetPartyDiscountStats(GetPartyDiscountStatsRequest) returns (GetPartyDiscountStatsResponse) { 989 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Parties"}; 990 } 991 992 // Export network history as CSV 993 // 994 // Export CSV table data from network history between two block heights. 995 // 996 // The requested block heights must fall on network history segment boundaries, which can 997 // be discovered by calling the API to list all network history segments. By default 998 // segments contain 1000 blocks. In that case ranges such as (1, 1000), (1001, 2000), (1, 3000) 999 // would all fall on segment boundaries and be valid. 1000 // 1001 // The generated CSV file is compressed into a ZIP file and returned, with the file name 1002 // in the following format: `[chain id]-[table name]-[start block]-[end block].zip` 1003 // 1004 // In gRPC, results are returned in a chunked stream of base64 encoded data. 1005 // 1006 // Through the REST gateway, the base64 data chunks are decoded and streamed as a 1007 // `content-type: application/zip` HTTP response. 1008 // 1009 // The CSV exported data uses a comma as a DELIMITER between fields, and " for QUOTE-ing fields. 1010 // 1011 // If a value contains any of: DELIMITER, QUOTE, carriage return, or line feed then the whole 1012 // value is prefixed and suffixed by the QUOTE character and any occurrence within 1013 // the value of a QUOTE character preceded by another QUOTE. 1014 // 1015 // A NULL is output as the NULL parameter string and is not quoted, while a non-NULL value 1016 // matching the NULL parameter string is quoted. 1017 // 1018 // For example, with the default settings, a NULL is written as an unquoted empty string, 1019 // while an empty string data value is written with double quotes. 1020 // 1021 // Note that CSV files produced may contain quoted values containing embedded carriage returns and line feeds. 1022 // Thus the files are not strictly one line per table row like text-format files. 1023 // 1024 // The first row of the CSV file is a header that describes the contents of each column 1025 // in subsequent rows. 1026 // 1027 // Usually the ZIP file will contain only a single CSV file. However it is possible that 1028 // the (from_block, to_block) request spans over a range of blocks in which the underlying 1029 // schema of the database changes. For example, a column may have been added, removed, or renamed. 1030 // 1031 // If this happens, the CSV file will be split at the point of the schema change and the zip 1032 // file will contain multiple CSV files, with a potentially different set of headers. The 1033 // 'version' number of the database schema is part of the in the CSV filename: 1034 // 1035 // `[chain id]-[table name]-[schema version]-[start block]-[end block].zip` 1036 // 1037 // For example, a zip file might be called mainnet-sometable-000001-003000.zip 1038 // 1039 // And contain two CSV files: `mainnet-sometable-1-000001-002000.csv`: 1040 // 1041 // timestamp, value 1042 // 1, foo 1043 // 2, bar 1044 // 1045 // And `mainnet-sometable-2-002001-003000.csv`: 1046 // 1047 // timestamp, value, extra_value 1048 // 3, baz, apple 1049 // 1050 // It is worth noting that the schema will not change within a single network history segment. 1051 // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME 1052 // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE 1053 rpc ExportNetworkHistory(ExportNetworkHistoryRequest) returns (stream google.api.HttpBody) { 1054 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network history"}; 1055 } 1056 1057 // Ping 1058 // 1059 // Ping the data node 1060 rpc Ping(PingRequest) returns (PingResponse) { 1061 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Misc"}; 1062 } 1063 } 1064 1065 // -- Pagination -- 1066 1067 // All data returned from the API is ordered in a well-defined manner. 1068 // The specific columns and the order in which the sorting is performed 1069 // depend on the API endpoint being called. However, the primary sorting 1070 // column is usually the timestamp of the block in which the data was last updated. 1071 // 1072 // To prevent excessively large response messages and to avoid overloading 1073 // database resources, the API employs a cursor-based pagination mechanism. 1074 // 1075 // This Pagination message can be optionally provided as part of the request to specify: 1076 // - The starting point within the total result set for beginning the page 1077 // - The size of the returned page 1078 // - The ordering of the data within that page 1079 // 1080 // If no Pagination message is provided, the API will return the first page of 1081 // data using the default page size. The default page size is 1000. 1082 // 1083 // To retrieve subsequent pages, the caller must examine the PageInfo structure 1084 // returned in the response to find a cursor string that uniquely identifies the 1085 // last row of that page. This cursor should then be passed in the 'after' field 1086 // of the Pagination message in a subsequent request. 1087 // 1088 // For paging backward, take the cursor for the first row of the page from PageInfo 1089 // and pass it in the 'before' field of the Pagination message. 1090 // 1091 // Pagination message that uses both first/after and last/before is considered invalid. 1092 message Pagination { 1093 // Number of records to be returned that sort greater than row identified by cursor supplied in 'after'. 1094 optional int32 first = 1; 1095 // If paging forwards, the cursor string for the last row of the previous page. 1096 optional string after = 2; 1097 // Number of records to be returned that sort less than row identified by cursor supplied in 'before'. 1098 optional int32 last = 3; 1099 // If paging forwards, the cursor string for the first row of the previous page. 1100 optional string before = 4; 1101 // Whether to order the results with the newest records first. If not set, the default value is true. 1102 optional bool newest_first = 5; 1103 } 1104 1105 // Page information for cursor based pagination 1106 message PageInfo { 1107 // Indicator if there is a next page. 1108 bool has_next_page = 1; 1109 // Indicator if there is a previous page. 1110 bool has_previous_page = 2; 1111 // Start cursor. 1112 string start_cursor = 3; 1113 // End cursor. 1114 string end_cursor = 4; 1115 } 1116 1117 // Request sent to get statistics about the vesting rewards for a party 1118 message GetPartyVestingStatsRequest { 1119 // Party ID to query the vesting stats for. 1120 string party_id = 1 [(google.api.field_behavior) = REQUIRED]; 1121 } 1122 1123 // Vesting reward statistics for a given party 1124 message GetPartyVestingStatsResponse { 1125 // Party ID. 1126 string party_id = 1; 1127 // Reward bonus multiplier. 1128 string reward_bonus_multiplier = 2; 1129 // Epoch for which this information is valid. 1130 uint64 epoch_seq = 3; 1131 // The balance of the party, in quantum. 1132 string quantum_balance = 4; 1133 // Bonus multiplier applied on the reward, summed across all derived accounts. 1134 string summed_reward_bonus_multiplier = 5; 1135 // The balance of the party and derived keys, in quantum. 1136 string summed_quantum_balance = 6; 1137 } 1138 1139 // Request sent to list the vesting and locked balances for a party 1140 message GetVestingBalancesSummaryRequest { 1141 // Party ID to query vesting balances for. 1142 string party_id = 1 [(google.api.field_behavior) = REQUIRED]; 1143 // Optional asset ID, all asset balances returned if not set. 1144 optional string asset_id = 2; 1145 } 1146 1147 // List of vesting and locked balances for a party. 1148 message GetVestingBalancesSummaryResponse { 1149 // Party ID. 1150 string party_id = 1; 1151 // Epoch for which these balances are valid. 1152 optional uint64 epoch_seq = 2; 1153 // List of locked balances for the party. 1154 repeated vega.events.v1.PartyLockedBalance locked_balances = 3; 1155 // List of vesting balances for the party. 1156 repeated vega.events.v1.PartyVestingBalance vesting_balances = 4; 1157 } 1158 1159 // -- Accounts -- 1160 1161 // Represents the current balance of an account for an asset on Vega, for a particular owner or party 1162 message AccountBalance { 1163 // Party that owns the account. 1164 // Special values include `network` - represents the Vega network and is 1165 // most commonly seen during liquidation of a distressed trading position. 1166 string owner = 2; 1167 // Asset balance represented as an integer, for example `123456` is a correctly 1168 // formatted price of `1.23456` assuming market configured to 5 decimal places. 1169 // Balances cannot be negative. 1170 string balance = 3; 1171 // Asset ID for the account. 1172 string asset = 4; 1173 // Market ID for the account, this field will be empty if the asset is in a general account. 1174 string market_id = 5; 1175 // Account type of this account. 1176 vega.AccountType type = 6; 1177 // Parent party ID of the account. 1178 // This field is optional and is used in cases where the account is derived from another party's account. 1179 optional string parent_party_id = 7; 1180 } 1181 1182 // Request that is sent when listing accounts. 1183 message ListAccountsRequest { 1184 // Account filter contains all filter conditions and values that can be applied to the listing. 1185 AccountFilter filter = 1; 1186 // Optional pagination control. 1187 optional Pagination pagination = 2; 1188 // Whether to return all derived parties from AMMs for the given party. 1189 // If used, party ID is required. 1190 optional bool include_derived_parties = 3; 1191 } 1192 1193 // Response that is received from listing accounts query. 1194 message ListAccountsResponse { 1195 // Page of accounts data and corresponding page information. 1196 AccountsConnection accounts = 1; 1197 } 1198 1199 // Page of accounts data and corresponding page information. 1200 message AccountsConnection { 1201 // Page of accounts data and their corresponding cursors. 1202 repeated AccountEdge edges = 1; 1203 // Page information that is used for fetching further pages. 1204 PageInfo page_info = 2; 1205 } 1206 1207 // Account data item with the corresponding cursor. 1208 message AccountEdge { 1209 // Account balance data. 1210 AccountBalance node = 1; 1211 // Cursor that can be used to fetch further pages with reference to this account. 1212 string cursor = 2; 1213 } 1214 1215 // Request that is sent when getting a subscription to a stream of accounts. 1216 message ObserveAccountsRequest { 1217 // Market ID to filter accounts by. If empty, no markets will be filtered. 1218 string market_id = 1; 1219 // Party ID to filter accounts by. If empty, no parties will be filtered. 1220 string party_id = 2; 1221 // Asset ID to filter accounts by. If empty, no assets will be filtered. 1222 string asset = 3; 1223 // Account type to subscribe to, required field. 1224 vega.AccountType type = 4; 1225 // Whether to return all derived parties from AMMs for the given party. 1226 // If used, party ID is required. 1227 optional bool include_derived_parties = 5; 1228 } 1229 1230 // Response that is received when subscribing to a stream of accounts. 1231 message ObserveAccountsResponse { 1232 oneof response { 1233 // 'Initial image' snapshot containing current account balances. 1234 AccountSnapshotPage snapshot = 1; 1235 // List of account updates in the last block. 1236 AccountUpdates updates = 2; 1237 } 1238 } 1239 1240 // 'Initial image' snapshot containing current account balances - may be sent over several response messages 1241 message AccountSnapshotPage { 1242 // List of account balances. 1243 repeated AccountBalance accounts = 1; 1244 // Indicator if the current page is the last one or not. 1245 bool last_page = 2; 1246 } 1247 1248 // List of account updates in the last block 1249 message AccountUpdates { 1250 // List of account balances. 1251 repeated AccountBalance accounts = 1; 1252 } 1253 1254 // -- Data node information -- 1255 1256 // Request that is sent when querying node information 1257 message InfoRequest {} 1258 1259 // Response that is received from the node information query 1260 message InfoResponse { 1261 // Semver formatted version of the data node. 1262 string version = 1; 1263 // Commit hash from which the data node was built. 1264 string commit_hash = 2; 1265 } 1266 1267 // -- Orders -- 1268 1269 // Request that is sent when executing the query for getting a single order 1270 message GetOrderRequest { 1271 // Order ID to retrieve order information for. 1272 string order_id = 1 [(google.api.field_behavior) = REQUIRED]; 1273 // Historic version number of the order to return. If not set, the most current version will be returned. 1274 optional int32 version = 2; 1275 } 1276 1277 // Response received from the query for getting a single order 1278 message GetOrderResponse { 1279 // Order details, if one was found. 1280 vega.Order order = 1; 1281 } 1282 1283 // Order filter that contains all filtering conditions and values that are applied to the orders listing 1284 message OrderFilter { 1285 // Restrict orders to those with the given statuses. 1286 repeated vega.Order.Status statuses = 1; 1287 // Restrict orders to those with the given types. 1288 repeated vega.Order.Type types = 2; 1289 // Restrict orders to those with the given Time In Force. 1290 repeated vega.Order.TimeInForce time_in_forces = 3; 1291 // Indicator if liquidity provisions should be included or not in the list. 1292 bool exclude_liquidity = 4; 1293 // Restrict orders to those placed by the given party IDs. 1294 repeated string party_ids = 5; 1295 // Restrict orders to those placed on the given market IDs. 1296 repeated string market_ids = 6; 1297 // Restrict orders to those with the given reference. 1298 optional string reference = 7; 1299 // Restrict orders to those placed during the given date range. If not set, all orders will be returned. 1300 optional DateRange date_range = 8; 1301 // Restrict orders to those that are live. If not set, it is treated as being false. 1302 optional bool live_only = 9; 1303 } 1304 1305 // Request that is sent when executing a query for a list of orders 1306 message ListOrdersRequest { 1307 // Optional pagination control. 1308 optional Pagination pagination = 2; 1309 // Order filter contains all filtering conditions and values that are applied to the orders listing. 1310 optional OrderFilter filter = 5; 1311 } 1312 1313 // Response that is received from the query to list orders 1314 message ListOrdersResponse { 1315 // Page of orders data and corresponding page information. 1316 OrderConnection orders = 1; 1317 } 1318 1319 // Request that is sent when listing possible order versions 1320 message ListOrderVersionsRequest { 1321 // Order ID to list versions for. 1322 string order_id = 1 [(google.api.field_behavior) = REQUIRED]; 1323 1324 // Optional pagination control. 1325 optional Pagination pagination = 4; 1326 } 1327 1328 // Response that is received when listing possible order versions 1329 message ListOrderVersionsResponse { 1330 // Page of order versions and corresponding page information. 1331 OrderConnection orders = 1; 1332 } 1333 1334 // Request to subscribe to a stream of orders. 1335 // 1336 // Request fields market ID and party ID are both optional filters: 1337 // If omitted all orders, for all parties on all markets will be returned on the stream 1338 // Both filters can be combined 1339 message ObserveOrdersRequest { 1340 // Restrict orders to those placed on the given markets. 1341 repeated string market_ids = 1; 1342 // Restrict orders to those placed on the market by the given parties. 1343 repeated string party_ids = 2; 1344 // Whether liquidity orders should be excluded from the stream. If not set, liquidity orders will be included. 1345 optional bool exclude_liquidity = 3; 1346 } 1347 1348 // Response that is received from an orders subscription. 1349 message ObserveOrdersResponse { 1350 oneof response { 1351 // An 'initial image' snapshot containing current live orders. 1352 OrderSnapshotPage snapshot = 1; 1353 // List of order updates in the last block. 1354 OrderUpdates updates = 2; 1355 } 1356 } 1357 1358 // 'Initial image' of live orders, may be sent over multiple response messages. 1359 message OrderSnapshotPage { 1360 // List of order data parts. 1361 repeated vega.Order orders = 1; 1362 // Indicator if the last page is reached or not. 1363 bool last_page = 2; 1364 } 1365 1366 // List of order updates in the last block. 1367 message OrderUpdates { 1368 // List of orders data. 1369 repeated vega.Order orders = 1; 1370 } 1371 1372 // Request that is sent when executing the query for getting a single stop order. 1373 message GetStopOrderRequest { 1374 // Order ID to retrieve order information for. 1375 string order_id = 1 [(google.api.field_behavior) = REQUIRED]; 1376 } 1377 1378 // Response received from the query for getting a single stop order. 1379 message GetStopOrderResponse { 1380 // Order details, if one was found. 1381 vega.events.v1.StopOrderEvent order = 1; 1382 } 1383 1384 // Request that is sent when executing a query for a list of team game scores. 1385 message ListGameTeamScoresRequest { 1386 // Optional pagination control. 1387 optional Pagination pagination = 1; 1388 // Team games filter contains all filtering conditions and values that are applied to the team games score listing. 1389 optional GameTeamScoresFilter filter = 2; 1390 } 1391 1392 message GameTeamScoresFilter { 1393 // Restrict game scores to the given ones. 1394 repeated string game_ids = 1; 1395 // Restrict game scores to those for the given teams. 1396 repeated string team_ids = 2; 1397 // Restrict game scores to those from a given epoch. 1398 optional uint64 epoch_from = 3; 1399 // Restrict game scores to those up to a given epoch. 1400 optional uint64 epoch_to = 4; 1401 } 1402 1403 // Response received from the query for getting a list of game scores for teams. 1404 message ListGameTeamScoresResponse { 1405 // Page of team game scores data and corresponding page information. 1406 GameTeamScoresConnection team_scores = 1; 1407 } 1408 1409 // Page of team game scores data and corresponding page information. 1410 message GameTeamScoresConnection { 1411 // Page of orders and their corresponding cursors. 1412 repeated GameTeamScoresEdge edges = 1; 1413 // Page information that is used for fetching further pages. 1414 PageInfo page_info = 2; 1415 } 1416 1417 message GameTeamScoresEdge { 1418 // Data associated with an order submitted to a Vega node. 1419 vega.events.v1.GameTeamScore node = 1; 1420 // Cursor that can be used to fetch further pages. 1421 string cursor = 2; 1422 } 1423 1424 // Request that is sent when executing a query for a list of party game scores. 1425 message ListGamePartyScoresRequest { 1426 // Optional pagination control. 1427 optional Pagination pagination = 1; 1428 // Party games filter contains all filtering conditions and values that are applied to the party games score listing. 1429 optional GamePartyScoresFilter filter = 2; 1430 } 1431 1432 message GamePartyScoresFilter { 1433 // Restrict game scores to those in the given games. 1434 repeated string game_ids = 1; 1435 // Restrict game scores to the parties in the given teams. 1436 repeated string team_ids = 2; 1437 // Restrict game scores to those relating to the given parties. 1438 repeated string party_ids = 3; 1439 // Restrict game scores to those from a given epoch. 1440 optional uint64 epoch_from = 4; 1441 // Restrict game scores to those up to a given epoch. 1442 optional uint64 epoch_to = 5; 1443 } 1444 1445 // Response received from the query for getting a list of game scores for teams. 1446 message ListGamePartyScoresResponse { 1447 // Page of party game scores data and corresponding page information. 1448 GamePartyScoresConnection party_scores = 1; 1449 } 1450 1451 // Page of party game scores data and corresponding page information. 1452 message GamePartyScoresConnection { 1453 // Page of orders and their corresponding cursors. 1454 repeated GamePartyScoresEdge edges = 1; 1455 // Page information that is used for fetching further pages. 1456 PageInfo page_info = 2; 1457 } 1458 1459 message GamePartyScoresEdge { 1460 // Data associated with an order submitted to a Vega node. 1461 vega.events.v1.GamePartyScore node = 1; 1462 // Cursor that can be used to fetch further pages. 1463 string cursor = 2; 1464 } 1465 1466 // Request that is sent when executing a query for a list of stop orders. 1467 message ListStopOrdersRequest { 1468 // Optional pagination control. 1469 optional Pagination pagination = 2; 1470 // Order filter contains all filtering conditions and values that are applied to the orders listing. 1471 optional StopOrderFilter filter = 5; 1472 } 1473 1474 // Stop order filter 1475 // 1476 // Stop order filter that contains all filtering conditions and values that are applied to the stop orders listing. 1477 message StopOrderFilter { 1478 // Restrict orders to those with the given statuses. 1479 repeated vega.StopOrder.Status statuses = 1; 1480 // Restrict orders to those with the given expiry strategies. 1481 repeated vega.StopOrder.ExpiryStrategy expiry_strategies = 2; 1482 // Restrict orders to those placed during the given date range. If not set, all orders will be returned. 1483 optional DateRange date_range = 3; 1484 // Restrict orders to those placed by the given party IDs. 1485 repeated string party_ids = 4; 1486 // Restrict orders to those placed on the given market IDs. 1487 repeated string market_ids = 5; 1488 // Live stop orders only 1489 optional bool live_only = 6; 1490 } 1491 1492 // Order data with the corresponding cursor. 1493 message StopOrderEdge { 1494 // Data associated with an order submitted to a Vega node. 1495 vega.events.v1.StopOrderEvent node = 1; 1496 // Cursor that can be used to fetch further pages. 1497 string cursor = 2; 1498 } 1499 1500 // Page of stop orders data and corresponding page information. 1501 message StopOrderConnection { 1502 // Page of stop orders and their corresponding cursors. 1503 repeated StopOrderEdge edges = 1; 1504 // Page information that is used for fetching further pages. 1505 PageInfo page_info = 2; 1506 } 1507 1508 // Response that is received from the query to list stop orders. 1509 message ListStopOrdersResponse { 1510 // Page of stop orders data and corresponding page information. 1511 StopOrderConnection orders = 1; 1512 } 1513 1514 // -- Positions -- 1515 1516 // Request used to list all positions for a party. 1517 // Optionally, if a market ID is set, the results will be filtered for that market only. 1518 message ListPositionsRequest { 1519 option deprecated = true; 1520 // Party ID to list positions for, required field. 1521 string party_id = 1; 1522 // Market ID to filter for. If empty, no markets will be filtered. 1523 string market_id = 2; 1524 // Pagination controls. 1525 optional Pagination pagination = 3; 1526 } 1527 1528 // Response for a list of positions for a party 1529 message ListPositionsResponse { 1530 option deprecated = true; 1531 // Page of positions data and corresponding page information. 1532 PositionConnection positions = 1; 1533 } 1534 1535 // Filter to apply to the ListAllPositionsRequest 1536 message PositionsFilter { 1537 // Restrict positions to those related to the given parties. 1538 repeated string party_ids = 1; 1539 // Restrict positions to those on the given markets. 1540 repeated string market_ids = 2; 1541 // Whether to return all derived parties from AMMs for the given party. 1542 optional bool include_derived_parties = 3; 1543 } 1544 1545 // Request to list positions, given the position filter is supplied. 1546 message ListAllPositionsRequest { 1547 // Filter to apply to the positions. 1548 PositionsFilter filter = 1; 1549 // Pagination controls. 1550 optional Pagination pagination = 2; 1551 } 1552 1553 // Response to query for listing of positions, given the filter is supplied 1554 message ListAllPositionsResponse { 1555 // Page of positions data and corresponding page information. 1556 PositionConnection positions = 1; 1557 } 1558 1559 // Position data with the corresponding cursor. 1560 message PositionEdge { 1561 // Position data for a party on a market. 1562 vega.Position node = 1; 1563 // Cursor that can be used to fetch further pages. 1564 string cursor = 2; 1565 } 1566 1567 // Page of positions and corresponding page information 1568 message PositionConnection { 1569 // Page of positions data and their corresponding cursors. 1570 repeated PositionEdge edges = 1; 1571 // Page information that is used for fetching further pages. 1572 PageInfo page_info = 2; 1573 } 1574 1575 // Request that is used to subscribe to a stream of positions 1576 message ObservePositionsRequest { 1577 // Restrict position updates to those related to the given parties. 1578 optional string party_id = 1; 1579 // Restrict position updates to those related to the given markets. 1580 optional string market_id = 2; 1581 // Whether to return all derived parties from AMMs for the given party. 1582 // If used, party ID is required. 1583 optional bool include_derived_parties = 3; 1584 } 1585 1586 // Response received from a positions subscription request 1587 message ObservePositionsResponse { 1588 oneof response { 1589 // An 'initial image' snapshot containing current positions. 1590 PositionSnapshotPage snapshot = 1; 1591 // List of position updates in the last block. 1592 PositionUpdates updates = 2; 1593 } 1594 } 1595 1596 // 'Initial image' of current positions, may be sent over multiple response messages 1597 message PositionSnapshotPage { 1598 // List of positions data. 1599 repeated vega.Position positions = 1; 1600 // Indicator if last page is reached or not. 1601 bool last_page = 2; 1602 } 1603 1604 // List of position updates in the last block 1605 message PositionUpdates { 1606 // List of positions data. 1607 repeated vega.Position positions = 1; 1608 } 1609 1610 // Ledger entry filter sets filters on returned set of ledger entries. 1611 message LedgerEntryFilter { 1612 // Determines whether an entry must have accounts matching both the account_from_filter 1613 // and the account_to_filter. If set to 'true', entries must have matches in both filters. 1614 // If set to `false`, entries matching only the account_from_filter or the account_to_filter will also be included. 1615 bool close_on_account_filters = 1; 1616 // Used to set values for filtering sender accounts. Party must be provided in this filter or 'to' account filter, or both. 1617 AccountFilter from_account_filter = 2; 1618 // Used to set values for filtering receiver accounts. Party must be provided in this filter or 'from' account filter, or both. 1619 AccountFilter to_account_filter = 3; 1620 // List of transfer types that is used for filtering sender and receiver accounts. 1621 repeated vega.TransferType transfer_types = 5; 1622 // List ledger entries that are associated with a specific transfer ID. If provided, all other filters are ignored 1623 optional string transfer_id = 6; 1624 } 1625 1626 // List of fields for a ledger entry 1627 enum LedgerEntryField { 1628 LEDGER_ENTRY_FIELD_UNSPECIFIED = 0; 1629 LEDGER_ENTRY_FIELD_ACCOUNT_FROM_ID = 1; 1630 LEDGER_ENTRY_FIELD_ACCOUNT_TO_ID = 2; 1631 LEDGER_ENTRY_FIELD_TRANSFER_TYPE = 3; 1632 } 1633 1634 // Represents an aggregated view of ledger entry data, sender and receiver accounts, 1635 // details and balances for both sides after the transfer has been made 1636 message AggregatedLedgerEntry { 1637 // Removed ID field as it is not used, there is no ID for an aggregated ledger entry 1638 reserved 1; 1639 // Timestamp in Unix nanoseconds of the block in which the result is referring to. 1640 int64 timestamp = 2; 1641 // Amount of ledger entries for the set of requested accounts at the time above. 1642 string quantity = 3; 1643 // Transfer type. 1644 vega.TransferType transfer_type = 4; 1645 // Asset ID for the asset associated with the entry. 1646 optional string asset_id = 5; 1647 // Type of account sent from. 1648 vega.AccountType from_account_type = 6; 1649 // Type of account received to. 1650 vega.AccountType to_account_type = 7; 1651 // Sender's party ID. 1652 optional string from_account_party_id = 8; 1653 // Receiver's party ID. 1654 optional string to_account_party_id = 9; 1655 // Sender market ID. 1656 optional string from_account_market_id = 10; 1657 // Receiver market ID. 1658 optional string to_account_market_id = 11; 1659 // Sender account balance after the transfer. 1660 string from_account_balance = 12; 1661 // Receiver account balance after the transfer. 1662 string to_account_balance = 13; 1663 // Transfer ID associated with the ledger entry. 1664 string transfer_id = 14; 1665 } 1666 1667 // -- LedgerEntries -- 1668 1669 // Request that is sent when listing ledger entries. 1670 message ListLedgerEntriesRequest { 1671 // Ledger entry filter that contains all values and conditions according to which 1672 // the listing of ledger entries is filtered.You must provide at least one party in 1673 // 'from' account filter, or 'to' account filter. 1674 LedgerEntryFilter filter = 1; 1675 // Optional pagination control. 1676 optional Pagination pagination = 2; 1677 // Date range for which to list ledger entries. 1678 // If not set, the date range is restricted to the last 5 days. 1679 // If a start and end date is provided, but the range is more than 5 days, the end date will be restricted to 5 days from the start. 1680 // If a start date is provided, but no end date, the end date will be set to 5 days from the start. 1681 // If an end date is provided, but no start date, the start date will be set to 5 days before the end. 1682 optional DateRange date_range = 3; 1683 } 1684 1685 // Request that is sent when exporting ledger entries to csv 1686 message ExportLedgerEntriesRequest { 1687 // Restrict exported ledger entries to those relating to the given party ID. 1688 string party_id = 1 [(google.api.field_behavior) = REQUIRED]; 1689 // Restrict exported ledger entries to those relating to the given asset ID. 1690 optional string asset_id = 2; 1691 // Date range to export ledger entries for. 1692 optional DateRange date_range = 4; 1693 } 1694 1695 // Response that is received when listing ledger entries 1696 message ListLedgerEntriesResponse { 1697 // Page of aggregated ledger entries data and corresponding page information. 1698 AggregatedLedgerEntriesConnection ledger_entries = 1; 1699 } 1700 1701 // Represents the aggregated ledger entry data with corresponding cursor for it 1702 message AggregatedLedgerEntriesEdge { 1703 // 'AggregatedLedgerEntry' data. 1704 AggregatedLedgerEntry node = 1; 1705 // Cursor that can be used to fetch further pages. 1706 string cursor = 2; 1707 } 1708 1709 // Page of aggregated ledger entries data and corresponding page information. 1710 message AggregatedLedgerEntriesConnection { 1711 // Page of 'AggregatedLedgerEntry' data and their corresponding cursors. 1712 repeated AggregatedLedgerEntriesEdge edges = 1; 1713 // Page information that is used for fetching further pages. 1714 PageInfo page_info = 2; 1715 } 1716 1717 // Request to use when querying balances changes. 1718 message ListBalanceChangesRequest { 1719 // Limit the accounts considered according to the filter supplied. 1720 AccountFilter filter = 1; 1721 // Pagination controls. 1722 optional Pagination pagination = 5; 1723 // Date range over which to query. If a cursor is not provided in the pagination controls, 1724 // the date range must be provided with a start or end date, or both. 1725 // The date range is inclusive of the start date and exclusive of the end date. 1726 // The date range must be no more than 1 year in duration. 1727 // Dates before 2020-01-01 will not be accepted. 1728 optional DateRange date_range = 6; 1729 } 1730 1731 // Response that is received from querying balances changes. 1732 message ListBalanceChangesResponse { 1733 // Page of aggregated balances data and corresponding page information. 1734 AggregatedBalanceConnection balances = 1; 1735 } 1736 1737 // -- Balances -- 1738 1739 // Request that is used when querying balance history 1740 message GetBalanceHistoryRequest { 1741 // Account filter contains values that can be set in order to limit balance history data to them. 1742 AccountFilter filter = 1; 1743 // By default the net balances of all the accounts specified by the filter are returned. 1744 // If a list of fields is given in group_by, split out those balances by the supplied criteria. 1745 repeated AccountField group_by = 2; 1746 optional Pagination pagination = 3; 1747 optional DateRange date_range = 4; 1748 } 1749 1750 // Response that is received when querying for balance history 1751 message GetBalanceHistoryResponse { 1752 // Page of aggregated balances with the corresponding page information. 1753 AggregatedBalanceConnection balances = 1; 1754 } 1755 1756 // Aggregated balance data with the corresponding cursor. 1757 message AggregatedBalanceEdge { 1758 // Balance of the set of requested accounts. 1759 AggregatedBalance node = 1; 1760 // Cursor that can be used to fetch further pages. 1761 string cursor = 2; 1762 } 1763 1764 // Page of aggregated balance objects and corresponding page information 1765 message AggregatedBalanceConnection { 1766 // Page of aggregated balance data and their corresponding cursors. 1767 repeated AggregatedBalanceEdge edges = 1; 1768 // Page information that is used for fetching further pages. 1769 PageInfo page_info = 2; 1770 } 1771 1772 // Account filter is used to filter account data. 1773 // 1774 // An account is defined as a set of asset ID, type, party ID, and market ID. 1775 // - Every account has an associated asset and type. 1776 // - Certain account types such as the global reward pool for example, do not have an associated party. 1777 // These are denoted by the special party ID 'network'. 1778 // - Certain account types do not have an associated market such as the general party accounts, for example. 1779 // These are denoted by the special market ID '' (an empty string). 1780 message AccountFilter { 1781 // Restrict accounts to those holding balances in this asset ID. 1782 string asset_id = 1; 1783 // Restrict accounts to those owned by the parties in this list. Pass an empty list for no filter. 1784 repeated string party_ids = 2; 1785 // Restrict accounts to those connected to the markets in this list. Pass an empty list for no filter. 1786 repeated string market_ids = 3; 1787 // Restrict accounts to those connected to any of the types in this list. Pass an empty list for no filter. 1788 repeated vega.AccountType account_types = 4; 1789 } 1790 1791 // List of the properties of an account, used for grouping 1792 enum AccountField { 1793 ACCOUNT_FIELD_UNSPECIFIED = 0; 1794 ACCOUNT_FIELD_ID = 1; 1795 ACCOUNT_FIELD_PARTY_ID = 2; 1796 ACCOUNT_FIELD_ASSET_ID = 3; 1797 ACCOUNT_FIELD_MARKET_ID = 4; 1798 ACCOUNT_FIELD_TYPE = 5; 1799 } 1800 1801 // AggregatedBalance data contains the balance of the set of requested accounts combined with corresponding 1802 // party ID, market ID and account type details 1803 message AggregatedBalance { 1804 // Timestamp in Unix nanoseconds of the block in which the balance exists. 1805 int64 timestamp = 1; 1806 // Balance of the set of requested accounts at the time above. 1807 string balance = 2; 1808 // If grouping by party, the party ID. 1809 optional string party_id = 4; 1810 // If grouping by asset, the asset ID. 1811 optional string asset_id = 5; 1812 // If grouping by market, the market ID 1813 optional string market_id = 6; 1814 // If grouping by account type, the account type. 1815 optional vega.AccountType account_type = 7; 1816 } 1817 1818 // -- Market Data -- 1819 1820 // Request that is sent to get market depth subscription 1821 message ObserveMarketsDepthRequest { 1822 // Restrict market depth data by the given market IDs. 1823 repeated string market_ids = 1; 1824 } 1825 1826 // Response that is received for MarketDepth subscription. 1827 message ObserveMarketsDepthResponse { 1828 // List of market depth data. 1829 repeated vega.MarketDepth market_depth = 1; 1830 } 1831 1832 // Request that is sent for market depth update subscription 1833 message ObserveMarketsDepthUpdatesRequest { 1834 // Restrict updates to market depth by the given market IDs. 1835 repeated string market_ids = 1; 1836 } 1837 1838 // Response that is received for market depth update subscription 1839 message ObserveMarketsDepthUpdatesResponse { 1840 // List of market depth update data. 1841 repeated vega.MarketDepthUpdate update = 1; 1842 } 1843 1844 // Request that is sent for market data subscription 1845 message ObserveMarketsDataRequest { 1846 // Restrict updates to market data by the given market IDs. 1847 repeated string market_ids = 1; 1848 } 1849 1850 // Response that is received for market data subscription 1851 message ObserveMarketsDataResponse { 1852 // List of market data. 1853 repeated vega.MarketData market_data = 1; 1854 } 1855 1856 // Request that is sent when requesting latest market depth data 1857 message GetLatestMarketDepthRequest { 1858 // Market ID to request market depth for, required field. 1859 string market_id = 1 [(google.api.field_behavior) = REQUIRED]; 1860 // Maximum market depth. 1861 optional uint64 max_depth = 2; 1862 } 1863 1864 // Response that is received when latest market depth data is queried 1865 message GetLatestMarketDepthResponse { 1866 // Market ID of the depth levels returned. 1867 string market_id = 1; 1868 // Zero or more price levels for the buy side of the market depth data. 1869 repeated vega.PriceLevel buy = 2; 1870 // Zero or more price levels for the sell side of the market depth data. 1871 repeated vega.PriceLevel sell = 3; 1872 // Last trade recorded on Vega. 1873 vega.Trade last_trade = 4; 1874 // Sequence number incremented after each update. 1875 uint64 sequence_number = 5; 1876 } 1877 1878 // Request that is sent when listing the latest market data for every market 1879 message ListLatestMarketDataRequest {} 1880 1881 // Response that is received when listing the latest market data for every market 1882 message ListLatestMarketDataResponse { 1883 repeated vega.MarketData markets_data = 1; 1884 } 1885 1886 // Request that is sent when listing the latest market data for a given market 1887 message GetLatestMarketDataRequest { 1888 // Market ID to retrieve market data for. 1889 string market_id = 1 [(google.api.field_behavior) = REQUIRED]; 1890 } 1891 1892 // Response that is received when listing the latest market data for a given market 1893 message GetLatestMarketDataResponse { 1894 // Market data that was requested. 1895 vega.MarketData market_data = 1; 1896 } 1897 1898 // Request that is sent for getting Market Data History 1899 message GetMarketDataHistoryByIDRequest { 1900 reserved 5; 1901 1902 // Market ID to request data history for. 1903 string market_id = 1 [(google.api.field_behavior) = REQUIRED]; 1904 // Timestamp in Unix nanoseconds indicating the start of the date range. 1905 optional int64 start_timestamp = 2; 1906 // Timestamp in Unix nanoseconds indicating the end of the date range. 1907 optional int64 end_timestamp = 3; 1908 // Pagination control. 1909 optional Pagination pagination = 4; 1910 } 1911 1912 // Response that is received when querying Market Data History 1913 message GetMarketDataHistoryByIDResponse { 1914 // Page of market data history with the corresponding page information. 1915 MarketDataConnection market_data = 1; 1916 } 1917 1918 // Market data with the corresponding cursor. 1919 message MarketDataEdge { 1920 // Data generated by a market when open. 1921 vega.MarketData node = 1; 1922 // Cursor that can be used to fetch further pages. 1923 string cursor = 2; 1924 } 1925 1926 // Page of market data items and corresponding page information 1927 message MarketDataConnection { 1928 // Page of market data items and their corresponding cursors. 1929 repeated MarketDataEdge edges = 1; 1930 // Page information that is used for fetching further pages. 1931 PageInfo page_info = 2; 1932 } 1933 1934 // -- Transfers -- 1935 1936 // Direction of a transfer 1937 enum TransferDirection { 1938 TRANSFER_DIRECTION_UNSPECIFIED = 0; 1939 TRANSFER_DIRECTION_TRANSFER_FROM = 1; 1940 TRANSFER_DIRECTION_TRANSFER_TO = 2; 1941 TRANSFER_DIRECTION_TRANSFER_TO_OR_FROM = 3; 1942 } 1943 1944 // Request that is sent to list transfers 1945 message ListTransfersRequest { 1946 // Restrict transfer to those where the given public key is a sender or receiver. 1947 optional string pubkey = 1; 1948 // Restrict transfers to those in the given direction from the supplied public key. 1949 // When is_reward is true, and pubkey is set, then direction MUST be TRANSFER_DIRECTION_DIRECTION_FROM. 1950 TransferDirection direction = 2; 1951 // Pagination controls. 1952 optional Pagination pagination = 3; 1953 // Restrict transfers to those related to reward transfers. 1954 optional bool is_reward = 4; 1955 // Epoch to filter from (included). If omitted, the range goes from the oldest epoch to the `to epoch`. 1956 optional uint64 from_epoch = 5; 1957 // Epoch to filter to (included). If omitted, the range goes from `from epoch` to the most recent epoch. 1958 optional uint64 to_epoch = 6; 1959 // Status to filter on. 1960 optional vega.events.v1.Transfer.Status status = 7; 1961 // Dispatch strategy's scope to filter for. 1962 optional Scope scope = 8; 1963 // Game ID to filter on 1964 optional string game_id = 9; 1965 // Account type to filter on for transfers from account 1966 optional vega.AccountType from_account_type = 10; 1967 // Account type to filter on for transfers to account 1968 optional vega.AccountType to_account_type = 11; 1969 1970 // Defines the types of a dispatch strategy's scope the API can filter on. 1971 enum Scope { 1972 SCOPE_UNSPECIFIED = 0; 1973 // Matches transfers that have dispatch strategy scope of individual set. 1974 SCOPE_INDIVIDUAL = 1; 1975 // Matches transfers that have dispatch strategy scope of team set. 1976 SCOPE_TEAM = 2; 1977 } 1978 } 1979 1980 // Response that is received when listing transfers 1981 message ListTransfersResponse { 1982 // Page of transfers data and corresponding page information. 1983 TransferConnection transfers = 1; 1984 } 1985 1986 message TransferNode { 1987 // Data relating to a transfer that has been made. 1988 vega.events.v1.Transfer transfer = 1; 1989 // Fees paid for this transfer. 1990 repeated vega.events.v1.TransferFees fees = 2; 1991 } 1992 1993 // Transfers data with the corresponding cursor. 1994 message TransferEdge { 1995 // Data relating to a transfer that has been made. 1996 TransferNode node = 1; 1997 // Cursor that can be used to fetch further pages. 1998 string cursor = 2; 1999 } 2000 2001 // Page of transfers data items and corresponding page information 2002 message TransferConnection { 2003 // Page of transfers data and their corresponding cursors. 2004 repeated TransferEdge edges = 1; 2005 // Page information that is used for fetching further pages. 2006 PageInfo page_info = 2; 2007 } 2008 2009 // Request that is sent for getting a transfer by ID 2010 message GetTransferRequest { 2011 // Transfer ID to request data for. 2012 string transfer_id = 1 [(google.api.field_behavior) = REQUIRED]; 2013 } 2014 2015 // Response that is received when querying transfers by ID 2016 message GetTransferResponse { 2017 // Transfer and its fees requested by ID. 2018 TransferNode transfer_node = 1; 2019 } 2020 2021 // -- Network Limits -- 2022 2023 // Request that is used to query current network limits 2024 message GetNetworkLimitsRequest {} 2025 2026 // Response received when querying the current network limits 2027 message GetNetworkLimitsResponse { 2028 // List of received network limits. 2029 vega.NetworkLimits limits = 1; 2030 } 2031 2032 // -- Candles -- 2033 2034 // Request that is used to fetch a list of supported intervals for the given market along with the corresponding candle ID 2035 message ListCandleIntervalsRequest { 2036 // Unique ID for the market to list candle intervals for. 2037 string market_id = 1 [(google.api.field_behavior) = REQUIRED]; 2038 } 2039 2040 // Maps an interval for a given market to its corresponding candle ID 2041 message IntervalToCandleId { 2042 // Interval for the candle. 2043 string interval = 1; 2044 // Unique ID of the candle. 2045 string candle_id = 2; 2046 } 2047 2048 // List of mapped pairs `interval` -> `candle ID` for a given market 2049 message ListCandleIntervalsResponse { 2050 // List of the mappings. 2051 repeated IntervalToCandleId interval_to_candle_id = 1; 2052 } 2053 2054 // Represents the high, low, open, and closing prices for an interval of trading, 2055 // referred to commonly as a candlestick or candle 2056 message Candle { 2057 // Timestamp in Unix nanoseconds for the point in time when the candle was initially created/opened. 2058 int64 start = 1; 2059 // Timestamp in Unix nanoseconds for the point in time when the candle was last updated. 2060 int64 last_update = 2; 2061 // Highest price for trading during the candle interval. 2062 string high = 3; 2063 // Lowest price for trading during the candle interval. 2064 string low = 4; 2065 // Open trade price. 2066 string open = 5; 2067 // Closing trade price. 2068 string close = 6; 2069 // Total trading volume during the candle interval. 2070 uint64 volume = 7; 2071 // Total notional value traded during the candle interval. This value is determined by multiplying price, using market decimal places, by size, using position decimal places. 2072 // The number of decimal places needed to convert this value to a decimal is market decimal places plus position decimal places. 2073 uint64 notional = 8; 2074 } 2075 2076 // Request that is used to subscribe to a stream of candles 2077 message ObserveCandleDataRequest { 2078 // Unique ID for the candle. 2079 string candle_id = 1 [(google.api.field_behavior) = REQUIRED]; 2080 } 2081 2082 // Response that is received when subscribing to a stream of candles 2083 message ObserveCandleDataResponse { 2084 // Candle data. 2085 Candle candle = 1; 2086 } 2087 2088 // Request that is used when listing candles for a market at an interval 2089 message ListCandleDataRequest { 2090 reserved 4; 2091 // Candle ID to retrieve candle data for. 2092 string candle_id = 1 [(google.api.field_behavior) = REQUIRED]; 2093 // Timestamp in Unix nanoseconds to retrieve candles from. 2094 int64 from_timestamp = 2; 2095 // Timestamp in Unix nanoseconds to retrieve candles to. 2096 int64 to_timestamp = 3; 2097 // Pagination controls. 2098 optional Pagination pagination = 5; 2099 } 2100 2101 // Response for list of candles for a market at an interval 2102 message ListCandleDataResponse { 2103 // Page of candle data and corresponding page information. 2104 CandleDataConnection candles = 1; 2105 } 2106 2107 // Candle data with the corresponding cursor. 2108 message CandleEdge { 2109 // Candlestick data, i.e. high, low, open, and closing prices for an interval of trading. 2110 Candle node = 1; 2111 // Cursor that can be used to fetch further pages. 2112 string cursor = 2; 2113 } 2114 2115 // Page of candles data and corresponding page information 2116 message CandleDataConnection { 2117 // Page of candle data items and their corresponding cursors. 2118 repeated CandleEdge edges = 1; 2119 // Page information that is used for fetching further pages. 2120 PageInfo page_info = 2; 2121 } 2122 2123 // -- Votes -- 2124 2125 // Request that is used to list governance votes 2126 message ListVotesRequest { 2127 // Party for which the votes are requested. 2128 optional string party_id = 1; 2129 // Proposal ID to list votes for. 2130 optional string proposal_id = 2; 2131 2132 // Optional pagination control. 2133 optional Pagination pagination = 3; 2134 } 2135 2136 // Response that is received when listing Votes 2137 message ListVotesResponse { 2138 // Page of votes data received and corresponding page information. 2139 VoteConnection votes = 1; 2140 } 2141 2142 // Votes data with the corresponding cursor. 2143 message VoteEdge { 2144 // Data associated with a governance vote. 2145 vega.Vote node = 1; 2146 // Cursor that can be used to fetch further pages. 2147 string cursor = 2; 2148 } 2149 2150 // Page of vote data items and corresponding page information 2151 message VoteConnection { 2152 // Page of vote data and their corresponding cursors. 2153 repeated VoteEdge edges = 1; 2154 // Page information that is used for fetching further pages. 2155 PageInfo page_info = 2; 2156 } 2157 2158 // Request that is sent to subscribe to votes 2159 message ObserveVotesRequest { 2160 // Restrict vote updates to those made by the given party. 2161 optional string party_id = 1; 2162 // Restrict vote updates to those made on the given proposal. 2163 optional string proposal_id = 2; 2164 } 2165 2166 // Response that is received from votes subscription 2167 message ObserveVotesResponse { 2168 // Data associated with governance votes that are published to the stream. 2169 vega.Vote vote = 1; 2170 } 2171 2172 // Request for adding a signature bundle to the signer list of a multisig contract for a particular validator 2173 message ListERC20MultiSigSignerAddedBundlesRequest { 2174 // Node ID of the validator for which a signature bundle is required. 2175 string node_id = 1; 2176 // Ethereum address of the validator that will submit the bundle. 2177 string submitter = 2; 2178 // Epoch in which the bundle was generated, i.e. the epoch in which the node was promoted to consensus validator. 2179 string epoch_seq = 3; 2180 // Pagination controls. 2181 Pagination pagination = 4; 2182 // Filter signature bundles to those related to the contract on the given chain ID. 2183 optional string chain_id = 5; 2184 } 2185 2186 // Response from adding a signature bundle to the signer list of a multisig contract for a particular validator 2187 message ListERC20MultiSigSignerAddedBundlesResponse { 2188 // Page of bundles for that validator - it may have been added multiple times if removed in between - and corresponding page information. 2189 ERC20MultiSigSignerAddedConnection bundles = 1; 2190 } 2191 2192 // Signature data that is to be added with the corresponding cursor. 2193 message ERC20MultiSigSignerAddedEdge { 2194 // Signature data to be added. 2195 vega.events.v1.ERC20MultiSigSignerAdded node = 1; 2196 // Cursor that can be used to fetch further pages. 2197 string cursor = 2; 2198 } 2199 2200 // Signature bundle data that is to be added with the corresponding cursor. 2201 message ERC20MultiSigSignerAddedBundleEdge { 2202 // Signature bundle data to be added. 2203 ERC20MultiSigSignerAddedBundle node = 1; 2204 // Cursor that can be used to fetch further pages. 2205 string cursor = 2; 2206 } 2207 2208 // Page of signature data items to be added and corresponding page information 2209 message ERC20MultiSigSignerAddedConnection { 2210 // Page of signature bundle data and their corresponding cursors. 2211 repeated ERC20MultiSigSignerAddedBundleEdge edges = 1; 2212 // Page information that is used for fetching further pages. 2213 PageInfo page_info = 2; 2214 } 2215 2216 // Signature bundle data to be added 2217 message ERC20MultiSigSignerAddedBundle { 2218 // Ethereum address of the signer to be removed. 2219 string new_signer = 1; 2220 // Ethereum address of the submitter. 2221 string submitter = 2; 2222 // Nonce used in the signing operation. 2223 string nonce = 4; 2224 // Unixnano timestamp for when the validator was added. 2225 int64 timestamp = 5; 2226 // Bundle of signatures from current validators to sign in the new signer. 2227 string signatures = 6; 2228 // Epoch in which the validator was added. 2229 string epoch_seq = 3; 2230 // ID of the EVM chain this signature bundle is valid for. 2231 string chain_id = 7; 2232 } 2233 2234 // Request for removing a signature bundle from the signer list of the multisig contract for a particular validator 2235 message ListERC20MultiSigSignerRemovedBundlesRequest { 2236 // Node ID of the validator of which a signature bundle is required. 2237 string node_id = 1; 2238 // Ethereum address of the validator that will submit the bundle. 2239 string submitter = 2; 2240 // Epoch in which the bundle was generated, i.e. the epoch in which the node was demoted from a consensus validator. 2241 string epoch_seq = 3; 2242 // Pagination controls. 2243 Pagination pagination = 4; 2244 // Filter signature bundles to those related to the contract on the given chain ID. 2245 optional string chain_id = 5; 2246 } 2247 2248 // Response when removing a signature bundle from the signer list of the multisig contract for a particular validator 2249 message ListERC20MultiSigSignerRemovedBundlesResponse { 2250 // Page of signer bundle data items for that validator and corresponding page information. 2251 ERC20MultiSigSignerRemovedConnection bundles = 1; 2252 } 2253 2254 // Signature data to be removed with the corresponding cursor. 2255 message ERC20MultiSigSignerRemovedEdge { 2256 // Signature data to be removed. 2257 vega.events.v1.ERC20MultiSigSignerRemoved node = 1; 2258 // Cursor that can be used to fetch further pages. 2259 string cursor = 2; 2260 } 2261 2262 // Signature bundle data to be removed, with the corresponding cursor. 2263 message ERC20MultiSigSignerRemovedBundleEdge { 2264 // Signature bundle data to be added. 2265 ERC20MultiSigSignerRemovedBundle node = 1; 2266 // Cursor that can be used to fetch further pages. 2267 string cursor = 2; 2268 } 2269 2270 // Page of signature data items to be removed and corresponding page information. 2271 message ERC20MultiSigSignerRemovedConnection { 2272 // Page of signature bundle data and their corresponding cursors. 2273 repeated ERC20MultiSigSignerRemovedBundleEdge edges = 1; 2274 // Page information that is used for fetching further pages. 2275 PageInfo page_info = 2; 2276 } 2277 2278 // Signature bundle data to be removed 2279 message ERC20MultiSigSignerRemovedBundle { 2280 // Ethereum address of the signer to be removed. 2281 string old_signer = 1; 2282 // Ethereum address of the submitter. 2283 string submitter = 2; 2284 // Nonce used in the signing operation. 2285 string nonce = 4; 2286 // Unixnano timestamp for when the validator was added. 2287 int64 timestamp = 5; 2288 // Bundle of signatures from current validators to sign in the new signer. 2289 string signatures = 6; 2290 // Epoch in which the validator was removed. 2291 string epoch_seq = 7; 2292 // ID of the EVM chain this signature bundle is valid for. 2293 string chain_id = 8; 2294 } 2295 2296 // Request for listing the signature bundle to an ERC-20 token in the collateral bridge 2297 message GetERC20ListAssetBundleRequest { 2298 // Asset ID of the asset bundle requested. 2299 string asset_id = 1 [(google.api.field_behavior) = REQUIRED]; 2300 } 2301 2302 // Response from listing the signature bundle to an ERC-20 token in the collateral bridge 2303 message GetERC20ListAssetBundleResponse { 2304 // Address of the asset on Ethereum. 2305 string asset_source = 1; 2306 // Asset ID for the underlying Vega asset. 2307 string vega_asset_id = 2; 2308 // Nonce that uniquely identifies this signature bundle and prevents resubmission. 2309 string nonce = 3; 2310 // Signatures bundle as hex encoded data, prefixed with `0x` 2311 // e.g: `0x + sig1 + sig2 + ... + sixN`. 2312 string signatures = 4; 2313 } 2314 2315 // 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 2316 message GetERC20SetAssetLimitsBundleRequest { 2317 // Proposal ID of the asset update proposal. 2318 string proposal_id = 1 [(google.api.field_behavior) = REQUIRED]; 2319 } 2320 2321 // 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 2322 message GetERC20SetAssetLimitsBundleResponse { 2323 // Address of the asset on Ethereum. 2324 string asset_source = 1; 2325 // Asset ID for the underlying Vega asset. 2326 string vega_asset_id = 2; 2327 // Nonce that uniquely identifies this signature bundle and prevents resubmission. 2328 string nonce = 3; 2329 // Lifetime limit deposit for this asset. 2330 string lifetime_limit = 4; 2331 // Withdrawal threshold for this asset. 2332 string threshold = 5; 2333 // Signatures bundle as hex encoded data, prefixed with `0x` 2334 // e.g: `0x + sig1 + sig2 + ... + sixN`. 2335 string signatures = 6; 2336 } 2337 2338 // Request to get all information required to bundle the call to finalise the withdrawal on the erc20 bridge 2339 message GetERC20WithdrawalApprovalRequest { 2340 // Withdrawal ID to retrieve. 2341 string withdrawal_id = 1 [(google.api.field_behavior) = REQUIRED]; 2342 } 2343 2344 // Response with all information required to bundle the call to finalise the withdrawal on the erc20 bridge 2345 // function withdraw_asset(address asset_source, uint256 asset_id, uint256 amount, uint256 expiry, uint256 nonce, bytes memory signatures) 2346 message GetERC20WithdrawalApprovalResponse { 2347 reserved 3; 2348 // Address of asset on the bridged EVM chain. 2349 string asset_source = 1; 2350 // Amount to be withdrawn. 2351 string amount = 2; 2352 // Nonce that uniquely identifies this signature bundle and prevents resubmission. 2353 string nonce = 4; 2354 // Signatures bundle as hex encoded data, prefixed with `0x` 2355 // e.g: 0x + sig1 + sig2 + ... + sixN. 2356 string signatures = 5; 2357 // Address, prefixed with `0x`, that will receive the withdrawn assets. 2358 string target_address = 6; 2359 // Creation timestamps. 2360 int64 creation = 7; 2361 // Chain ID of the bridged EVM chain. 2362 string source_chain_id = 8; 2363 } 2364 2365 // -- Trades -- 2366 2367 // Request for the latest trade that occurred on Vega for a given market 2368 message GetLastTradeRequest { 2369 // Market ID to retrieve the last trade for. 2370 string market_id = 1 [(google.api.field_behavior) = REQUIRED]; 2371 } 2372 2373 // Response for the latest trade that occurred on Vega for a given market 2374 message GetLastTradeResponse { 2375 // Information about the trade, if one is found. 2376 vega.Trade trade = 1; 2377 } 2378 2379 // Request to list trades 2380 message ListTradesRequest { 2381 // Restrict trades to those that occurred on the given markets. 2382 repeated string market_ids = 1; 2383 // Restrict trades to those that were caused by the given orders. 2384 repeated string order_ids = 2; 2385 // Restrict trades to those that were caused by orders placed by the given parties. 2386 repeated string party_ids = 3; 2387 // Pagination control. 2388 optional Pagination pagination = 4; 2389 // Restrict trades to those made during the given date range. If not set, all trades will be returned. 2390 optional DateRange date_range = 5; 2391 } 2392 2393 // Response from listing trades 2394 message ListTradesResponse { 2395 // Page of trades data and corresponding page information. 2396 TradeConnection trades = 1; 2397 } 2398 2399 // Page of trades and corresponding page information 2400 message TradeConnection { 2401 // Page of trades and their corresponding cursors. 2402 repeated TradeEdge edges = 1; 2403 // Page information that is used for fetching further pages. 2404 PageInfo page_info = 2; 2405 } 2406 2407 // Trade data item with the corresponding cursor.. 2408 message TradeEdge { 2409 // Data associated with a trade that has been executed. 2410 vega.Trade node = 1; 2411 // Cursor that can be used to fetch further pages. 2412 string cursor = 2; 2413 } 2414 2415 // Request to subscribe to a stream of trades 2416 message ObserveTradesRequest { 2417 // Request fields market ID and party ID are both optional filters: 2418 // If omitted all trades, for all parties on all markets will be returned on the stream 2419 // If market ID is given, trades from that market will be returned on the stream 2420 // If party ID is given, trades from that party will be returned on the stream 2421 // Both filters can be combined. 2422 2423 // Restrict the trades streamed to those made on the given markets. 2424 repeated string market_ids = 1; 2425 // Restrict the trades streamed to those made by the given parties. 2426 repeated string party_ids = 2; 2427 } 2428 2429 // Stream of trades 2430 message ObserveTradesResponse { 2431 // List of 0 or more trades. 2432 repeated vega.Trade trades = 1; 2433 } 2434 2435 // -- Oracles -- 2436 2437 // Request to get a specific oracle spec by its ID 2438 message GetOracleSpecRequest { 2439 // Oracle spec ID to request data for. 2440 string oracle_spec_id = 1 [(google.api.field_behavior) = REQUIRED]; 2441 } 2442 2443 // Response for a oracle spec 2444 message GetOracleSpecResponse { 2445 // External data spec matching the ID. 2446 vega.OracleSpec oracle_spec = 1; 2447 } 2448 2449 // Request to get all active oracle specs 2450 message ListOracleSpecsRequest { 2451 // Pagination controls. 2452 optional Pagination pagination = 2; 2453 } 2454 2455 // Response to get all active oracle specs 2456 message ListOracleSpecsResponse { 2457 // Page of active oracle specs and corresponding page information. 2458 OracleSpecsConnection oracle_specs = 1; 2459 } 2460 2461 // Request to get all seen oracle data 2462 message ListOracleDataRequest { 2463 // Oracle spec ID to list data for. 2464 optional string oracle_spec_id = 1; 2465 // Pagination controls. 2466 optional Pagination pagination = 2; 2467 } 2468 2469 // Response to get all seen oracle data 2470 message ListOracleDataResponse { 2471 // Page of seen oracle data and corresponding page information. 2472 OracleDataConnection oracle_data = 1; 2473 } 2474 2475 // Oracle specs data item with the corresponding cursor. 2476 message OracleSpecEdge { 2477 // External spec data that satisfies the list request. 2478 vega.OracleSpec node = 1; 2479 // Cursor that can be used to fetch further pages. 2480 string cursor = 2; 2481 } 2482 2483 // Page of oracle specs and corresponding page information 2484 message OracleSpecsConnection { 2485 // Page of oracle specs data and their corresponding cursors. 2486 repeated OracleSpecEdge edges = 1; 2487 // Page information that is used for fetching further pages. 2488 PageInfo page_info = 2; 2489 } 2490 2491 // Oracle data item with the corresponding cursor. 2492 message OracleDataEdge { 2493 // Data that was received from an external oracle. 2494 vega.OracleData node = 1; 2495 // Cursor that can be used to fetch further pages. 2496 string cursor = 2; 2497 } 2498 2499 // Page of oracle data and corresponding page information. 2500 message OracleDataConnection { 2501 // Page of oracle data and their corresponding cursors. 2502 repeated OracleDataEdge edges = 1; 2503 // Page information that is used for fetching further pages. 2504 PageInfo page_info = 2; 2505 } 2506 2507 // -- Markets -- 2508 2509 // Request for getting a market by ID 2510 message GetMarketRequest { 2511 // Market ID of the market to retrieve data for. 2512 string market_id = 1 [(google.api.field_behavior) = REQUIRED]; 2513 } 2514 2515 // Response from getting a market by ID 2516 message GetMarketResponse { 2517 // Information about the market requested. 2518 vega.Market market = 1; 2519 } 2520 2521 // Request for listing markets 2522 message ListMarketsRequest { 2523 // Pagination control. 2524 optional Pagination pagination = 2; 2525 // Whether to include settled markets. If not set, settled markets will be included. 2526 optional bool include_settled = 3; 2527 } 2528 2529 // Response from listing markets 2530 message ListMarketsResponse { 2531 // Page of markets and corresponding page information. 2532 MarketConnection markets = 1; 2533 } 2534 2535 // Market information with the corresponding cursor. 2536 message MarketEdge { 2537 // Information about the market. 2538 vega.Market node = 1; 2539 // Cursor that can be used to fetch further pages. 2540 string cursor = 2; 2541 } 2542 2543 // Page of markets and corresponding page information. 2544 message MarketConnection { 2545 // Page of markets and their corresponding cursors. 2546 repeated MarketEdge edges = 1; 2547 // Page information that is used for fetching further pages. 2548 PageInfo page_info = 2; 2549 } 2550 2551 // Request for listing successor markets. 2552 message ListSuccessorMarketsRequest { 2553 // Market ID that is a member of the succession line. This can be the original market 2554 // or any subsequent child market that succeeded it. 2555 string market_id = 1 [(google.api.field_behavior) = REQUIRED]; 2556 // Flag to indicate whether or not to include the full succession line, or only list 2557 // the children of the given market ID. If true, the full succession line is included. 2558 bool include_full_history = 2; 2559 // Pagination control. 2560 Pagination pagination = 3; 2561 } 2562 2563 // Successor market information includes the market that is a member of the succession line 2564 // and any governance data that is associated with proposals for child markets 2565 // whether enacted or not. 2566 message SuccessorMarket { 2567 // The market that is a member of the succession line. 2568 vega.Market market = 1; 2569 // All proposals for child markets that have the market as a parent. 2570 repeated vega.GovernanceData proposals = 2; 2571 } 2572 2573 // Successor market record with the corresponding cursor for paginated results 2574 message SuccessorMarketEdge { 2575 // Successor market record. 2576 SuccessorMarket node = 1; 2577 // Cursor identifying the record for pagination control. 2578 string cursor = 2; 2579 } 2580 2581 // Page of successor market records and corresponding page information. 2582 message SuccessorMarketConnection { 2583 // Page of successor markets and their cursors. 2584 repeated SuccessorMarketEdge edges = 1; 2585 // Page information for pagination control. 2586 PageInfo page_info = 2; 2587 } 2588 2589 // Response from a list successor markets request. 2590 message ListSuccessorMarketsResponse { 2591 // List of markets in the succession line. 2592 SuccessorMarketConnection successor_markets = 1; 2593 } 2594 2595 // -- Parties -- 2596 2597 // Request to get party by ID 2598 message GetPartyRequest { 2599 // Party ID to retrieve party information for. 2600 string party_id = 1 [(google.api.field_behavior) = REQUIRED]; 2601 } 2602 2603 // Response from getting party by ID 2604 message GetPartyResponse { 2605 // Data for the party requested. 2606 vega.Party party = 1; 2607 } 2608 2609 // Request to list parties by ID 2610 message ListPartiesRequest { 2611 // Restrict the returned party to only the given party ID. If not set, all parties will be returned. 2612 string party_id = 1; 2613 // Pagination control. 2614 Pagination pagination = 2; 2615 } 2616 2617 // Response from listing parties 2618 message ListPartiesResponse { 2619 // Page of parties data and corresponding page information. 2620 PartyConnection parties = 1; 2621 } 2622 2623 // Party data with the corresponding cursor. 2624 message PartyEdge { 2625 // Data associated with a party. 2626 vega.Party node = 1; 2627 // Cursor that can be used to fetch further pages. 2628 string cursor = 2; 2629 } 2630 2631 // Page of parties data and corresponding page information. 2632 message PartyConnection { 2633 // Page of parties and their corresponding cursors. 2634 repeated PartyEdge edges = 1; 2635 // Page information that is used for fetching further pages. 2636 PageInfo page_info = 2; 2637 } 2638 2639 // Request to list profiles by party ID. 2640 message ListPartiesProfilesRequest { 2641 // Restrict the returned profiles to only the given party IDs. If not set, 2642 // all parties' profiles will be returned. 2643 repeated string parties = 1; 2644 // Pagination control. 2645 Pagination pagination = 2; 2646 } 2647 2648 // Response from listing parties' profiles. 2649 message ListPartiesProfilesResponse { 2650 // Page of profile data and corresponding page information. 2651 PartiesProfilesConnection profiles = 1; 2652 } 2653 2654 // Party's profile data with the corresponding cursor. 2655 message PartyProfileEdge { 2656 // Data associated with a party's profile. 2657 vega.PartyProfile node = 1; 2658 // Cursor that can be used to fetch further pages. 2659 string cursor = 2; 2660 } 2661 2662 // Page of profile data per party and corresponding page information. 2663 message PartiesProfilesConnection { 2664 // Page of profiles and their corresponding cursors. 2665 repeated PartyProfileEdge edges = 1; 2666 // Page information that is used for fetching further pages. 2667 PageInfo page_info = 2; 2668 } 2669 2670 // Order data with the corresponding cursor. 2671 message OrderEdge { 2672 // Data associated with an order submitted to a Vega node. 2673 vega.Order node = 1; 2674 // Cursor that can be used to fetch further pages. 2675 string cursor = 2; 2676 } 2677 2678 // Request for listing margin levels 2679 message ListMarginLevelsRequest { 2680 // Party ID for which to list the margin levels 2681 string party_id = 1; 2682 // Market ID for which to list the margin levels 2683 string market_id = 2; 2684 // Pagination control 2685 Pagination pagination = 3; 2686 } 2687 2688 // Response from listing margin levels 2689 message ListMarginLevelsResponse { 2690 // Page of margin levels data and corresponding page information. 2691 MarginConnection margin_levels = 1; 2692 } 2693 2694 // Request to subscribe to a stream of MarginLevels data. 2695 // If a party ID is provided, the stream will contain margin levels for that party only. 2696 // Optionally, the list can be additionally filtered by market 2697 message ObserveMarginLevelsRequest { 2698 // Restrict margin level updates to those relating to the given party. 2699 string party_id = 1; 2700 // Restrict margin level updates to those relating to the given market. 2701 optional string market_id = 2; 2702 } 2703 2704 // Response from subscribing to margin levels data 2705 message ObserveMarginLevelsResponse { 2706 // Margin levels data that match the subscription request filters. 2707 vega.MarginLevels margin_levels = 1; 2708 } 2709 2710 // Page of orders data and corresponding page information. 2711 message OrderConnection { 2712 // Page of orders and their corresponding cursors. 2713 repeated OrderEdge edges = 1; 2714 // Page information that is used for fetching further pages. 2715 PageInfo page_info = 2; 2716 } 2717 2718 // Margin data with the corresponding cursor. 2719 message MarginEdge { 2720 // Margin levels data that satisfy a list margin levels request. 2721 vega.MarginLevels node = 1; 2722 // Cursor that can be used to fetch further pages. 2723 string cursor = 2; 2724 } 2725 2726 // Page of margins data and corresponding page information. 2727 message MarginConnection { 2728 // Page of margins data and their corresponding cursors. 2729 repeated MarginEdge edges = 1; 2730 // Page information that is used for fetching further pages. 2731 PageInfo page_info = 2; 2732 } 2733 2734 // Request to get reward details for a party 2735 message ListRewardsRequest { 2736 // Restrict rewards data to those that were received by the given party. 2737 string party_id = 1; 2738 // Restrict rewards data to those that were paid with the given asset ID. 2739 optional string asset_id = 2; 2740 // Pagination control. 2741 optional Pagination pagination = 3; 2742 // Restrict rewards data to those that were paid after and including the given epoch ID. 2743 optional uint64 from_epoch = 4; 2744 // Restrict rewards data to those that were paid up to and including the given epoch ID. 2745 optional uint64 to_epoch = 5; 2746 // Filter for rewards paid if the party is a member of the given team 2747 optional string team_id = 6; 2748 // Filter for rewards paid if the party participated in the given game 2749 optional string game_id = 7; 2750 // Whether to return all derived parties from AMMs for the given party. 2751 optional bool include_derived_parties = 8; 2752 // Filter the rewards by market ID. 2753 optional string market_id = 9; 2754 } 2755 2756 // Response for listing reward details for a single party 2757 message ListRewardsResponse { 2758 // Page of rewards data and corresponding page information. 2759 RewardsConnection rewards = 1; 2760 } 2761 2762 // Rewards data with the corresponding cursor. 2763 message RewardEdge { 2764 // Details for a single reward payment. 2765 vega.Reward node = 1; 2766 // Cursor that can be used to fetch further pages. 2767 string cursor = 2; 2768 } 2769 2770 // Page of rewards data and corresponding page information. 2771 message RewardsConnection { 2772 // Page of rewards data items and their corresponding cursors. 2773 repeated RewardEdge edges = 1; 2774 // Page information that is used for fetching further pages. 2775 PageInfo page_info = 2; 2776 } 2777 2778 // Request to get reward details for a party 2779 message ListRewardSummariesRequest { 2780 // Restrict the reward summary to rewards paid to the given parties. 2781 optional string party_id = 1; 2782 // Restrict the reward summary to rewards paid in the given assets. 2783 optional string asset_id = 2; 2784 // Pagination controls. 2785 optional Pagination pagination = 3; 2786 // Whether to return rewards for all derived parties from AMMs for the given party. 2787 // If used, party ID is required. 2788 optional bool include_derived_parties = 8; 2789 } 2790 2791 // Response from listing reward details in for a single party 2792 message ListRewardSummariesResponse { 2793 // Page of rewards details data and corresponding page information. 2794 repeated vega.RewardSummary summaries = 1; 2795 } 2796 2797 // Filter to restrict the results returned by the ListEpochRewardSummaries 2798 message RewardSummaryFilter { 2799 // Restrict reward summaries to those connected to the assets in the given list. 2800 repeated string asset_ids = 1; 2801 // Restrict reward summaries to those connected to the markets in the given list. 2802 repeated string market_ids = 2; 2803 // Restrict rewards summaries to those that were paid after and including the given epoch ID. 2804 optional uint64 from_epoch = 3; 2805 // Restrict rewards summaries to those that were paid up to and including the given epoch ID. 2806 optional uint64 to_epoch = 4; 2807 } 2808 2809 // Request to get summary of reward per epoch for a given range of epochs 2810 message ListEpochRewardSummariesRequest { 2811 // Limit the results considered according to the filter supplied. 2812 RewardSummaryFilter filter = 1; 2813 // Optional pagination information to limit the data that is returned. 2814 optional Pagination pagination = 4; 2815 } 2816 2817 // Return message with reward details in for a single party 2818 message ListEpochRewardSummariesResponse { 2819 // Page of rewards details for a single party and corresponding page information. 2820 EpochRewardSummaryConnection summaries = 1; 2821 } 2822 2823 // Page of rewards summary data for epoch and corresponding page information 2824 message EpochRewardSummaryConnection { 2825 // Page of rewards summary data for epochs and their corresponding cursors. 2826 repeated EpochRewardSummaryEdge edges = 1; 2827 // Page information that is used for fetching further pages. 2828 PageInfo page_info = 2; 2829 } 2830 2831 // Rewards summary data for epoch with the corresponding cursor. 2832 message EpochRewardSummaryEdge { 2833 // Rewards summary data for epoch. 2834 vega.EpochRewardSummary node = 1; 2835 // Cursor that can be used to fetch further pages. 2836 string cursor = 2; 2837 } 2838 2839 // Request sent for subscribing to rewards 2840 message ObserveRewardsRequest { 2841 // Asset ID to get rewards data for, if provided. 2842 optional string asset_id = 1; 2843 // Party ID to get rewards data for, if provided. 2844 optional string party_id = 2; 2845 } 2846 2847 // Response that is received from subscribing to rewards data 2848 message ObserveRewardsResponse { 2849 // Rewards data received. 2850 vega.Reward reward = 1; 2851 } 2852 2853 // -- Deposits -- 2854 2855 // Request to get data about a specific deposit by ID 2856 message GetDepositRequest { 2857 // Deposit ID to return data for. 2858 string id = 1 [(google.api.field_behavior) = REQUIRED]; 2859 } 2860 2861 // Response that is received from getting deposit data 2862 message GetDepositResponse { 2863 // Deposit matching the ID from the request. 2864 vega.Deposit deposit = 1; 2865 } 2866 2867 // Request to list all deposits for a given party 2868 message ListDepositsRequest { 2869 // Restrict deposits to those made by the given party ID. 2870 string party_id = 1; 2871 // Pagination controls. 2872 optional Pagination pagination = 2; 2873 // Date range of the requested data, if provided. 2874 optional DateRange date_range = 3; 2875 } 2876 2877 // Response from listing deposits 2878 message ListDepositsResponse { 2879 // Page of deposits data and corresponding page information. 2880 DepositsConnection deposits = 1; 2881 } 2882 2883 // Deposits data with the corresponding cursor. 2884 message DepositEdge { 2885 // Data associated with a single deposit made on the Vega network. 2886 vega.Deposit node = 1; 2887 // Cursor that can be used to fetch further pages. 2888 string cursor = 2; 2889 } 2890 2891 // Page of deposits data received and corresponding page information 2892 message DepositsConnection { 2893 // Page of deposits data and their corresponding cursors. 2894 repeated DepositEdge edges = 1; 2895 // Page information that is used for fetching further pages. 2896 PageInfo page_info = 2; 2897 } 2898 2899 // -- Withdrawals -- 2900 2901 // Request to get a specific withdrawal by ID 2902 message GetWithdrawalRequest { 2903 // Withdrawal ID to retrieve data for. 2904 string id = 1 [(google.api.field_behavior) = REQUIRED]; 2905 } 2906 2907 // Response for a withdrawal request 2908 message GetWithdrawalResponse { 2909 // Withdrawal matching the ID from the request. 2910 vega.Withdrawal withdrawal = 1; 2911 } 2912 2913 // List all withdrawals for a given party 2914 message ListWithdrawalsRequest { 2915 // Restrict withdrawals to those made by this party ID. 2916 string party_id = 1; 2917 // Pagination controls. 2918 optional Pagination pagination = 2; 2919 // Date range of the requested data, if provided. 2920 optional DateRange date_range = 3; 2921 } 2922 2923 // Response from listing withdrawals data 2924 message ListWithdrawalsResponse { 2925 // Page of withdrawals data and corresponding page information. 2926 WithdrawalsConnection withdrawals = 1; 2927 } 2928 2929 // Withdrawals data with the corresponding cursor. 2930 message WithdrawalEdge { 2931 // Data associated with a single withdrawal made from the Vega network. 2932 vega.Withdrawal node = 1; 2933 // Cursor that can be used to fetch further pages. 2934 string cursor = 2; 2935 } 2936 2937 // Page of withdrawals data and corresponding page information 2938 message WithdrawalsConnection { 2939 // Page of withdrawals data and their corresponding cursors. 2940 repeated WithdrawalEdge edges = 1; 2941 // Page information that is used for fetching further pages. 2942 PageInfo page_info = 2; 2943 } 2944 2945 // -- Assets -- 2946 2947 // Request for obtaining asset 2948 message GetAssetRequest { 2949 // Asset ID to get data for. 2950 string asset_id = 1 [(google.api.field_behavior) = REQUIRED]; 2951 } 2952 2953 // Response from getting an asset 2954 message GetAssetResponse { 2955 // Asset information that is returned. 2956 vega.Asset asset = 1; 2957 } 2958 2959 // Request for listing assets data 2960 message ListAssetsRequest { 2961 // Optional asset ID to list data for. 2962 optional string asset_id = 1; 2963 // Optional pagination information to limit the data that is returned. 2964 optional Pagination pagination = 2; 2965 } 2966 2967 // Response from listing assets 2968 message ListAssetsResponse { 2969 // Page of assets data and corresponding page information. 2970 AssetsConnection assets = 1; 2971 } 2972 2973 // Assets data with the corresponding cursor. 2974 message AssetEdge { 2975 // Asset data returned. 2976 vega.Asset node = 1; 2977 // Cursor that can be used to fetch further pages. 2978 string cursor = 2; 2979 } 2980 2981 // Page of asset data and corresponding page information 2982 message AssetsConnection { 2983 // Page of assets data and their corresponding cursors. 2984 repeated AssetEdge edges = 1; 2985 // Page information that is used for fetching further pages. 2986 PageInfo page_info = 2; 2987 } 2988 2989 // -- Liquidity Provisions -- 2990 2991 // Request for listing liquidity provisions 2992 message ListLiquidityProvisionsRequest { 2993 // Restrict liquidity provisions to those placed on the given market. 2994 optional string market_id = 1; 2995 // Restrict liquidity provisions to those placed by the given party. 2996 optional string party_id = 2; 2997 // Restrict liquidity provisions to those with the given order reference. 2998 optional string reference = 3; 2999 // Whether to include live liquidity provisions. If not set, live orders will not be included. 3000 optional bool live = 4; 3001 // Pagination controls. 3002 optional Pagination pagination = 5; 3003 } 3004 3005 // Request for listing liquidity provisions 3006 message ListAllLiquidityProvisionsRequest { 3007 // Restrict liquidity provisions to those placed on the given market. 3008 optional string market_id = 1; 3009 // Restrict liquidity provisions to those placed by the given party. 3010 optional string party_id = 2; 3011 // Restrict liquidity provisions to those with the given order reference. 3012 optional string reference = 3; 3013 // Whether to include live liquidity provisions. If not set, live orders will not be included. 3014 optional bool live = 4; 3015 // Pagination controls. 3016 optional Pagination pagination = 5; 3017 } 3018 3019 // Response from listing liquidity provisions 3020 message ListLiquidityProvisionsResponse { 3021 // Page of liquidity provisions data and corresponding page information. 3022 LiquidityProvisionsConnection liquidity_provisions = 1; 3023 } 3024 3025 // Response from listing liquidity provisions 3026 message ListAllLiquidityProvisionsResponse { 3027 // Page of liquidity provisions data and corresponding page information. 3028 LiquidityProvisionsWithPendingConnection liquidity_provisions = 1; 3029 } 3030 3031 // Liquidity provider commitment. For API purposes this can report a pending liquidity provision, 3032 // the current live provision or both in the event that an update has been accepted on the network, but has yet 3033 // to go live and thus there is still a pending provision that will become active in the next epoch. 3034 message LiquidityProvision { 3035 // Liquidity provision that is currently live. 3036 vega.LiquidityProvision current = 1; 3037 // Liquidity provision that is currently pending and will go live in the next epoch. 3038 optional vega.LiquidityProvision pending = 2; 3039 } 3040 3041 // Liquidity provision data with the corresponding cursor. 3042 message LiquidityProvisionsEdge { 3043 // Data corresponding to a liquidity provider's commitment. 3044 vega.LiquidityProvision node = 1; 3045 // Cursor that can be used to fetch further pages. 3046 string cursor = 2; 3047 } 3048 3049 // Liquidity provision data with the corresponding cursor. 3050 message LiquidityProvisionWithPendingEdge { 3051 // Data corresponding to a liquidity provider's commitment. 3052 LiquidityProvision node = 1; 3053 // Cursor that can be used to fetch further pages. 3054 string cursor = 2; 3055 } 3056 3057 // Page of liquidity provisions data and corresponding page information 3058 message LiquidityProvisionsConnection { 3059 // Page of liquidity provisions data and their corresponding cursors. 3060 repeated LiquidityProvisionsEdge edges = 1; 3061 // Page information that is used for fetching further pages. 3062 PageInfo page_info = 2; 3063 } 3064 3065 // Page of liquidity provisions data and corresponding page information 3066 message LiquidityProvisionsWithPendingConnection { 3067 // Page of liquidity provisions data and their corresponding cursors. 3068 repeated LiquidityProvisionWithPendingEdge edges = 1; 3069 // Page information that is used to fetch further pages. 3070 PageInfo page_info = 2; 3071 } 3072 3073 // Request sent to subscribe to liquidity provisions 3074 message ObserveLiquidityProvisionsRequest { 3075 // Target market to observe for liquidity provisions. 3076 optional string market_id = 1; 3077 // Target party to observe for submitted liquidity provisions. 3078 optional string party_id = 2; 3079 } 3080 3081 // Response from liquidity provisions subscription 3082 message ObserveLiquidityProvisionsResponse { 3083 repeated vega.LiquidityProvision liquidity_provisions = 1; 3084 } 3085 3086 // Request for listing active liquidity providers for a given market. 3087 // Either market ID or party ID or both, must be provided. 3088 message ListLiquidityProvidersRequest { 3089 // Market ID to retrieve liquidity providers for. If omitted, you must provide a party ID. 3090 optional string market_id = 1; 3091 // Party ID to retrieve data for. If omitted, you must provide a market ID. 3092 optional string party_id = 2; 3093 // Pagination controls. 3094 optional Pagination pagination = 3; 3095 } 3096 3097 // Liquidity provider information. 3098 message LiquidityProvider { 3099 // Party ID of the liquidity provider. 3100 string party_id = 1; 3101 // ID of the market the liquidity provider is active in. 3102 string market_id = 2; 3103 // Information used for calculating an LP's fee share, such as the equity like share, 3104 // average entry valuation and liquidity score for the liquidity provider for the specified market. 3105 vega.LiquidityProviderFeeShare fee_share = 3; 3106 // Information about LP's SLA performance. 3107 vega.LiquidityProviderSLA sla = 4; 3108 } 3109 3110 // Liquidity provider data with the corresponding cursor. 3111 message LiquidityProviderEdge { 3112 // Liquidity provider information returned by the API. 3113 LiquidityProvider node = 1; 3114 // Cursor that can be used to fetch further data. 3115 string cursor = 2; 3116 } 3117 3118 // Page of liquidity provider data and corresponding page information. 3119 message LiquidityProviderConnection { 3120 // Page of liquidity provider data. 3121 repeated LiquidityProviderEdge edges = 1; 3122 // Page information that is used for fetching further pages. 3123 PageInfo page_info = 2; 3124 } 3125 3126 // Response for listing liquidity providers. 3127 message ListLiquidityProvidersResponse { 3128 // Page of liquidity providers and corresponding page information. 3129 LiquidityProviderConnection liquidity_providers = 1; 3130 } 3131 3132 // Paid liquidity fees request. 3133 message ListPaidLiquidityFeesRequest { 3134 // Restrict fee data to those fees generated in the given market. 3135 optional string market_id = 1; 3136 // Restrict fee statistics to those paid in the given asset. 3137 optional string asset_id = 2; 3138 // Epoch to get paid liquidity fee statistics for. If omitted, the last complete epoch is used. 3139 optional uint64 epoch_seq = 3; 3140 // Restrict fee data to those fees paid to the given parties. 3141 repeated string party_ids = 4; 3142 // Pagination controls. 3143 optional Pagination pagination = 5; 3144 // Whether to return all derived parties from AMMs for the given party. If used, party ID is required. 3145 optional bool include_derived_parties = 6; 3146 // Restrict paid liquidity fees to those from a given epoch. 3147 optional uint64 epoch_from = 7; 3148 // Restrict paid liquidity fees to those up to a given epoch. 3149 optional uint64 epoch_to = 8; 3150 } 3151 3152 // Paid liquidity fees response. 3153 message ListPaidLiquidityFeesResponse { 3154 // Page of paid liquidity fees and corresponding page information. 3155 PaidLiquidityFeesConnection paid_liquidity_fees = 1; 3156 } 3157 3158 // Paid liquidity fees data with the corresponding cursor. 3159 message PaidLiquidityFeesEdge { 3160 // Paid liquidity fees data returned by the API. 3161 vega.events.v1.PaidLiquidityFeesStats node = 1; 3162 // Cursor that can be used to fetch further data. 3163 string cursor = 2; 3164 } 3165 3166 // Paid liquidity fees data and corresponding page information. 3167 message PaidLiquidityFeesConnection { 3168 // Page of paid liquidity fees data. 3169 repeated PaidLiquidityFeesEdge edges = 1; 3170 // Page information that is used for fetching further pages. 3171 PageInfo page_info = 2; 3172 } 3173 3174 // -- Governance Data -- 3175 3176 // Request to get governance data 3177 message GetGovernanceDataRequest { 3178 // Proposal ID to get governance data for, if provided. 3179 optional string proposal_id = 1; 3180 // Reference to get proposal data for, if provided. 3181 optional string reference = 2; 3182 } 3183 3184 // Response from getting governance data 3185 message GetGovernanceDataResponse { 3186 // Governance data content, i.e. proposal and votes for and against. 3187 vega.GovernanceData data = 1; 3188 } 3189 3190 // Request to list governance data 3191 message ListGovernanceDataRequest { 3192 // Filter for the types of governance proposals to view 3193 enum Type { 3194 TYPE_UNSPECIFIED = 0; 3195 // List all proposals 3196 TYPE_ALL = 1; 3197 // List new market proposals 3198 TYPE_NEW_MARKET = 2; 3199 // List update market proposals 3200 TYPE_UPDATE_MARKET = 3; 3201 // List change Vega network parameter proposals 3202 TYPE_NETWORK_PARAMETERS = 4; 3203 // New asset proposals 3204 TYPE_NEW_ASSET = 5; 3205 // Proposals for creating a new free form proposal 3206 TYPE_NEW_FREE_FORM = 6; 3207 // Update asset proposals 3208 TYPE_UPDATE_ASSET = 7; 3209 // Propose a new spot market 3210 TYPE_NEW_SPOT_MARKET = 8; 3211 // Update an existing spot market 3212 TYPE_UPDATE_SPOT_MARKET = 9; 3213 // Propose a new transfer 3214 TYPE_NEW_TRANSFER = 10; 3215 // Proposal to cancel a transfer 3216 TYPE_CANCEL_TRANSFER = 11; 3217 // Proposal for updating the state of a market 3218 TYPE_UPDATE_MARKET_STATE = 12; 3219 // Proposal to update the referral program 3220 TYPE_UPDATE_REFERRAL_PROGRAM = 13; 3221 // Proposal to update the volume discount program 3222 TYPE_UPDATE_VOLUME_DISCOUNT_PROGRAM = 14; 3223 // Proposal for new automated purchase auction 3224 TYPE_NEW_AUTOMATED_PURCHASE = 15; 3225 } 3226 // Restrict proposals to those with the given state. 3227 optional vega.Proposal.State proposal_state = 1; 3228 // Restrict proposals to those with the given type. 3229 optional Type proposal_type = 2; 3230 // Restrict proposals to those proposed by the given party ID. 3231 optional string proposer_party_id = 3; 3232 // Restrict proposals to those with the given reference. 3233 optional string proposal_reference = 4; 3234 // Pagination controls. 3235 optional Pagination pagination = 5; 3236 } 3237 3238 // Response from listing governance data 3239 message ListGovernanceDataResponse { 3240 // Page of governance data and corresponding page information. 3241 GovernanceDataConnection connection = 1; 3242 } 3243 3244 // Governance data with the corresponding cursor. 3245 message GovernanceDataEdge { 3246 // Governance data content, i.e. proposal and votes for and against. 3247 vega.GovernanceData node = 1; 3248 // Cursor that can be used to fetch further pages. 3249 string cursor = 2; 3250 } 3251 3252 // Page of governance data and corresponding page information 3253 message GovernanceDataConnection { 3254 // Page of governance data and their corresponding cursors. 3255 repeated GovernanceDataEdge edges = 1; 3256 // Page information that is used for fetching further pages. 3257 PageInfo page_info = 2; 3258 } 3259 3260 // Request for governance subscription 3261 message ObserveGovernanceRequest { 3262 // Restrict proposal updates to those proposed by the given party ID. 3263 optional string party_id = 1; 3264 } 3265 3266 // Response from governance subscription 3267 message ObserveGovernanceResponse { 3268 // Governance data, i.e. proposal and votes for and against. 3269 vega.GovernanceData data = 1; 3270 } 3271 3272 // Request for listing delegations 3273 message ListDelegationsRequest { 3274 // Restrict delegations to those made by the given party ID. 3275 optional string party_id = 1; 3276 // Restrict delegations to those made to the given node ID. 3277 optional string node_id = 2; 3278 // Return delegations made in the given epoch. If not set, delegations for the current epoch will be returned. 3279 optional string epoch_id = 3; 3280 // Pagination controls. 3281 optional Pagination pagination = 4; 3282 } 3283 3284 // Response from listing delegations 3285 message ListDelegationsResponse { 3286 // Page of delegations data and corresponding page information. 3287 DelegationsConnection delegations = 1; 3288 } 3289 3290 // Delegation data with the corresponding cursor. 3291 message DelegationEdge { 3292 // How much a party is delegating to a node and when. 3293 vega.Delegation node = 1; 3294 // Cursor that can be used to fetch further pages. 3295 string cursor = 2; 3296 } 3297 3298 // Page of delegations data and corresponding page information 3299 message DelegationsConnection { 3300 // Page of delegations data and their corresponding cursors. 3301 repeated DelegationEdge edges = 1; 3302 // Page information that is used for fetching further pages. 3303 PageInfo page_info = 2; 3304 } 3305 3306 // Request to subscribe to all event related to delegations, with the given filters 3307 message ObserveDelegationsRequest { 3308 // Party ID to get delegations for, if provided. 3309 optional string party_id = 1; 3310 // Node ID to get delegations for, if provided. 3311 optional string node_id = 2; 3312 } 3313 3314 // Response with all events related to delegations, with the given filters 3315 message ObserveDelegationsResponse { 3316 // How much a party is delegating to a node and when. 3317 vega.Delegation delegation = 1; 3318 } 3319 3320 // -- Nodes -- 3321 3322 // Represents a basic node without any epoch specific details like delegations, staking, rewards etc. 3323 message NodeBasic { 3324 // Unique ID identifying the node. 3325 string id = 1; 3326 // Node operator's public key. 3327 string pub_key = 2; 3328 // Tendermint public key of the node. 3329 string tm_pub_key = 3; 3330 // Ethereum public key of the node. 3331 string ethereum_address = 4; 3332 // URL that provides more information about the node. 3333 string info_url = 5; 3334 // Country code for the location of the node. 3335 string location = 6; 3336 // Node status. 3337 vega.NodeStatus status = 13; 3338 // Node name. 3339 string name = 17; 3340 // Avatar URL. 3341 string avatar_url = 18; 3342 } 3343 3344 // Request to get network data 3345 message GetNetworkDataRequest {} 3346 3347 // Response from getting network data 3348 message GetNetworkDataResponse { 3349 // Summary of information with respect to nodes on the Vega network. 3350 vega.NodeData node_data = 1; 3351 } 3352 3353 // Request to get node data 3354 message GetNodeRequest { 3355 // Node ID to get data for. 3356 string id = 1 [(google.api.field_behavior) = REQUIRED]; 3357 } 3358 3359 // Response from getting node 3360 message GetNodeResponse { 3361 // Data specific to a single node on the Vega network. 3362 vega.Node node = 1; 3363 } 3364 3365 // Request to list nodes 3366 message ListNodesRequest { 3367 // Return the node list for the given epoch. If not set, the node list for the current epoch will be returned. 3368 optional uint64 epoch_seq = 1; 3369 // Pagination controls. 3370 optional Pagination pagination = 2; 3371 } 3372 3373 // Response from listing nodes 3374 message ListNodesResponse { 3375 // Page of node data and corresponding page information. 3376 NodesConnection nodes = 1; 3377 } 3378 3379 // Node data with the corresponding cursor. 3380 message NodeEdge { 3381 // Data specific to a single node on the Vega network. 3382 vega.Node node = 1; 3383 // Cursor that can be used to fetch further pages. 3384 string cursor = 2; 3385 } 3386 3387 // Page of node data and corresponding page information 3388 message NodesConnection { 3389 // Page of node data and their corresponding cursors. 3390 repeated NodeEdge edges = 1; 3391 // Page information that is used for fetching further pages. 3392 PageInfo page_info = 2; 3393 } 3394 3395 // Request to specify the ID of the resource to retrieve aggregated signatures for 3396 message ListNodeSignaturesRequest { 3397 // Resource ID to list signatures for. 3398 string id = 1 [(google.api.field_behavior) = REQUIRED]; 3399 // Optional pagination information to limit the data that is returned. 3400 optional Pagination pagination = 2; 3401 } 3402 3403 // Response to specify the ID of the resource to retrieve aggregated signatures for 3404 message ListNodeSignaturesResponse { 3405 // Page of nodes signatures and corresponding page information. 3406 NodeSignaturesConnection signatures = 1; 3407 } 3408 3409 // Nodes signature edge with the corresponding cursor. 3410 message NodeSignatureEdge { 3411 // Node signature data. 3412 vega.commands.v1.NodeSignature node = 1; 3413 // Cursor that can be used to fetch further pages. 3414 string cursor = 2; 3415 } 3416 3417 // Page of node signatures and corresponding page information. 3418 message NodeSignaturesConnection { 3419 // Page of node signatures and their corresponding cursors. 3420 repeated NodeSignatureEdge edges = 1; 3421 // Page information that is used for fetching further pages. 3422 PageInfo page_info = 2; 3423 } 3424 3425 // -- Epochs -- 3426 3427 // Request to fetch epoch data 3428 // Provide either the epoch ID or the block height to get the epoch for. If both are provided, the epoch ID will be used. 3429 // If both are omitted, the current epoch will be returned. 3430 message GetEpochRequest { 3431 // Epoch ID. If provided, returns the epoch with the given ID. 3432 optional uint64 id = 1; 3433 // Block height. If provided, returns the epoch that the given block is in. 3434 optional uint64 block = 2; 3435 } 3436 3437 // Response from getting epoch 3438 message GetEpochResponse { 3439 // Data specific to a single epoch on the Vega network. This includes the epoch number, 3440 // start and end times, and the nodes that participated in the epoch. 3441 vega.Epoch epoch = 1; 3442 } 3443 3444 // -- Estimates -- 3445 3446 // Request to fetch the estimated fee if an order were to trade immediately 3447 message EstimateFeeRequest { 3448 // Market ID, used to specify the fee factors. 3449 string market_id = 1 [(google.api.field_behavior) = REQUIRED]; 3450 // Price at which the potential order is expected to trade. 3451 string price = 2 [(google.api.field_behavior) = REQUIRED]; 3452 // Size at which the potential order is expected to trade. 3453 uint64 size = 3 [(google.api.field_behavior) = REQUIRED]; 3454 // Party ID, used to get discount details. 3455 optional string party = 4; 3456 } 3457 3458 // Response that is received from EstimateFeeRequest, contains the estimated fees for a given order 3459 message EstimateFeeResponse { 3460 // Summary of the estimated fees for this order if it were to trade now. 3461 vega.Fee fee = 2; 3462 } 3463 3464 // Request to fetch the estimated MarginLevels if an order were to trade immediately 3465 message EstimateMarginRequest { 3466 option deprecated = true; 3467 // Market ID for the order. 3468 string market_id = 1 [(google.api.field_behavior) = REQUIRED]; 3469 // Party ID of the order. 3470 string party_id = 2 [(google.api.field_behavior) = REQUIRED]; 3471 // Order side - indicator for Seller or Buyer side. 3472 vega.Side side = 3 [(google.api.field_behavior) = REQUIRED]; 3473 // Type of the order. 3474 vega.Order.Type type = 4 [(google.api.field_behavior) = REQUIRED]; 3475 // Size of order. 3476 uint64 size = 5 [(google.api.field_behavior) = REQUIRED]; 3477 // Price of the asset. 3478 string price = 6 [(google.api.field_behavior) = REQUIRED]; 3479 } 3480 3481 // Response to an estimate margin request, containing the estimated margin levels for a given order 3482 message EstimateMarginResponse { 3483 option deprecated = true; 3484 // Summary of the estimated margins for this order if it were to trade now. 3485 vega.MarginLevels margin_levels = 2; 3486 } 3487 3488 // Message requesting for the list of all network parameters 3489 message ListNetworkParametersRequest { 3490 // Optional pagination information to limit the data that is returned. 3491 optional Pagination pagination = 1; 3492 } 3493 3494 // Response containing all of the Vega network parameters 3495 message ListNetworkParametersResponse { 3496 // Page of network parameters and corresponding page information. 3497 NetworkParameterConnection network_parameters = 1; 3498 } 3499 3500 // Request for a single network parameter 3501 message GetNetworkParameterRequest { 3502 // Key identifying the network parameter. 3503 string key = 1 [(google.api.field_behavior) = REQUIRED]; 3504 } 3505 3506 // Response that is received when getting a network parameter 3507 message GetNetworkParameterResponse { 3508 // Network parameter key and value. 3509 vega.NetworkParameter network_parameter = 1; 3510 } 3511 3512 // Network parameter with the corresponding cursor. 3513 message NetworkParameterEdge { 3514 // Name and associated value of a network parameter. 3515 vega.NetworkParameter node = 1; 3516 // Cursor that can be used to fetch further pages. 3517 string cursor = 2; 3518 } 3519 3520 // Page of network parameters and corresponding page information 3521 message NetworkParameterConnection { 3522 // Page of network parameters data and their corresponding cursors. 3523 repeated NetworkParameterEdge edges = 1; 3524 // Page information that is used for fetching further pages. 3525 PageInfo page_info = 2; 3526 } 3527 3528 // -- Checkpoints -- 3529 3530 // Actual data regarding a checkpoint 3531 message Checkpoint { 3532 // Hash of the checkpoint. 3533 string hash = 1; 3534 // Block hash at which the checkpoint is made. 3535 string block_hash = 2; 3536 // Block number at which the checkpoint is made. 3537 uint64 at_block = 3; 3538 } 3539 3540 // Request to get all checkpoints. Currently no fields, probably will be expanded to allow filtering data 3541 message ListCheckpointsRequest { 3542 // Optional pagination information to limit the data that is returned. 3543 optional Pagination pagination = 1; 3544 } 3545 3546 // Response message containing all checkpoints requested 3547 message ListCheckpointsResponse { 3548 // Page of checkpoints data and corresponding page information. 3549 CheckpointsConnection checkpoints = 1; 3550 } 3551 3552 // Checkpoint data with the corresponding cursor. 3553 message CheckpointEdge { 3554 // Data relating to a single checkpoint generated by the Vega network. 3555 Checkpoint node = 1; 3556 // Cursor that can be used to fetch further pages. 3557 string cursor = 2; 3558 } 3559 3560 // Page of checkpoints data and corresponding page information 3561 message CheckpointsConnection { 3562 // Page of checkpoints data and their corresponding cursors. 3563 repeated CheckpointEdge edges = 1; 3564 // Page information that is used for fetching further pages. 3565 PageInfo page_info = 2; 3566 } 3567 3568 // Request to get stake 3569 message GetStakeRequest { 3570 // Party ID for which the stake information is requested. 3571 string party_id = 1 [(google.api.field_behavior) = REQUIRED]; 3572 // Optional pagination information to limit the data that is returned. 3573 optional Pagination pagination = 2; 3574 } 3575 3576 // Response that is received from requesting stake information 3577 message GetStakeResponse { 3578 // Current stake available information. 3579 string current_stake_available = 1; 3580 // Paged list of stake data with corresponding page information. 3581 StakesConnection stake_linkings = 2; 3582 } 3583 3584 // Stake linking data with the corresponding cursor. 3585 message StakeLinkingEdge { 3586 // Stake linking representing the intent from a party to deposit. 3587 vega.events.v1.StakeLinking node = 1; 3588 // Cursor that can be used to fetch further pages. 3589 string cursor = 2; 3590 } 3591 3592 // Page of stake data and corresponding page information. 3593 message StakesConnection { 3594 // Page of stake data and their corresponding cursors. 3595 repeated StakeLinkingEdge edges = 1; 3596 // Page information that is used for fetching further pages. 3597 PageInfo page_info = 2; 3598 } 3599 3600 // Request to get risk factor 3601 message GetRiskFactorsRequest { 3602 // Market ID to get the risk factor for. 3603 string market_id = 1 [(google.api.field_behavior) = REQUIRED]; 3604 } 3605 3606 // Response that is received from getting a risk factor 3607 message GetRiskFactorsResponse { 3608 // Risk factor emitted by the risk model for a given market. 3609 vega.RiskFactor risk_factor = 1; 3610 } 3611 3612 // -- EventBus -- 3613 3614 // Request to subscribe to a stream of one or more event types from the Vega event bus 3615 message ObserveEventBusRequest { 3616 // One or more types of event, required field. 3617 repeated vega.events.v1.BusEventType type = 1; 3618 // Market ID to filter for, optional field. If empty, no markets will be excluded from the stream. 3619 string market_id = 2; 3620 // Party ID to filter for, optional field. If empty, no parties will be excluded from the stream. 3621 string party_id = 3; 3622 // Batch size, 3623 // If not specified, any events received will be sent immediately. If the client is not ready 3624 // for the next data-set, data may be dropped a number of times, and eventually the stream is closed. 3625 // if specified, the first batch will be sent when ready. To receive the next set of events, the client 3626 // must write an `ObserveEventBatch` message on the stream to flush the buffer. 3627 // If no message is received in 5 seconds, the stream is closed. 3628 // Default: 0, send any and all events when they are available. 3629 int64 batch_size = 4; 3630 } 3631 3632 // Response to a subscribed stream of events from the Vega event bus 3633 message ObserveEventBusResponse { 3634 // List of events that occurred on the Vega event bus. 3635 repeated vega.events.v1.BusEvent events = 1; 3636 } 3637 3638 // -- Transfer Responses -- 3639 3640 // Request to subscribe to ledger movements 3641 message ObserveLedgerMovementsRequest {} 3642 3643 // Response from ledger movements subscription 3644 message ObserveLedgerMovementsResponse { 3645 // Ledger movements data with list of ledger entries and post-transfer balances. 3646 vega.LedgerMovement ledger_movement = 1; 3647 } 3648 3649 // -- Key rotations -- 3650 3651 // Request to list all key rotations 3652 message ListKeyRotationsRequest { 3653 // Node ID to get key rotations for, if provided. 3654 optional string node_id = 1; 3655 // Optional pagination information to limit the data that is returned. 3656 optional Pagination pagination = 2; 3657 } 3658 3659 // Response message containing Vega key rotations 3660 message ListKeyRotationsResponse { 3661 // Page of key rotations data and corresponding page information. 3662 KeyRotationConnection rotations = 1; 3663 } 3664 3665 // Key rotation data with the corresponding cursor. 3666 message KeyRotationEdge { 3667 // Data relating to a key rotation that was performed by a node on the Vega network. 3668 vega.events.v1.KeyRotation node = 1; 3669 // Cursor that can be used to fetch further pages. 3670 string cursor = 2; 3671 } 3672 3673 // Page of key rotations data and corresponding page information 3674 message KeyRotationConnection { 3675 // Page of key rotation data and their corresponding cursors. 3676 repeated KeyRotationEdge edges = 1; 3677 // Page information that is used for fetching further pages. 3678 PageInfo page_info = 2; 3679 } 3680 3681 // -- Ethereum key rotations -- 3682 3683 // Request to list ethereum key rotations for nodes, optionally filtered by node 3684 message ListEthereumKeyRotationsRequest { 3685 // Node ID to get the rotation for, if provided. 3686 optional string node_id = 1; 3687 // Optional pagination information to limit the data that is returned. 3688 optional Pagination pagination = 2; 3689 } 3690 3691 // Response message containing Ethereum key rotations 3692 message ListEthereumKeyRotationsResponse { 3693 // Page of Ethereum key rotations data and corresponding page information. 3694 EthereumKeyRotationsConnection key_rotations = 1; 3695 } 3696 3697 // Page of Ethereum key rotations data and corresponding page information 3698 message EthereumKeyRotationsConnection { 3699 // Page of Ethereum key rotations data and their corresponding cursors. 3700 repeated EthereumKeyRotationEdge edges = 1; 3701 // Page information that is used for fetching further pages. 3702 PageInfo page_info = 2; 3703 } 3704 3705 // Ethereum key rotation data with the corresponding cursor. 3706 message EthereumKeyRotationEdge { 3707 // Data relating to an Ethereum key rotation performed by a node on the Vega network. 3708 vega.events.v1.EthereumKeyRotation node = 1; 3709 // Cursor that can be used to fetch further pages. 3710 string cursor = 2; 3711 } 3712 3713 // -- Vega Time -- 3714 3715 // Request to get the current time of the Vega network 3716 message GetVegaTimeRequest {} 3717 3718 // Response for the current consensus coordinated time on the Vega network, referred to as "VegaTime" 3719 message GetVegaTimeResponse { 3720 // Timestamp representation of current VegaTime as represented in Unix nanoseconds, for example 3721 // `1580473859111222333` corresponds to `2020-01-31T12:30:59.111222333Z`. 3722 int64 timestamp = 1; 3723 } 3724 3725 // Date range for queries that can return historical data 3726 // Timestamps should be provided as unix time in Unix nanoseconds and are inclusive. 3727 message DateRange { 3728 // Timestamp in Unix nanoseconds indicating the start of the date range. 3729 optional int64 start_timestamp = 1; 3730 // Timestamp in Unix nanoseconds indicating the end of the date range. 3731 optional int64 end_timestamp = 2; 3732 } 3733 3734 // Request to get protocol upgrade status 3735 message GetProtocolUpgradeStatusRequest {} 3736 3737 // Response from getting protocol upgrade status 3738 message GetProtocolUpgradeStatusResponse { 3739 // Indicator if the upgrade is ready or not. 3740 bool ready = 1; 3741 } 3742 3743 // Request type for ListProtocolUpgradeProposals; fetches a paginated list of protocol upgrade proposals 3744 message ListProtocolUpgradeProposalsRequest { 3745 // Restrict protocol upgrade proposals to those with the given status. 3746 optional vega.events.v1.ProtocolUpgradeProposalStatus status = 1; 3747 // Restrict protocol upgrade proposals to those approved by the given node ID. 3748 optional string approved_by = 2; 3749 // Pagination controls. 3750 optional Pagination pagination = 3; 3751 } 3752 3753 // Response type from a ListProtocolUpgradeProposals RPC call; a paginated list of protocol upgrade proposals 3754 message ListProtocolUpgradeProposalsResponse { 3755 // Page of protocol upgrade proposals and corresponding page information. 3756 ProtocolUpgradeProposalConnection protocol_upgrade_proposals = 1; 3757 } 3758 3759 // Page of protocol upgrade proposals and corresponding page information 3760 message ProtocolUpgradeProposalConnection { 3761 // Page of protocol upgrade proposals data and their corresponding cursors. 3762 repeated ProtocolUpgradeProposalEdge edges = 1; 3763 // Page information that is used for fetching further pages. 3764 PageInfo page_info = 2; 3765 } 3766 3767 // Protocol upgrade proposal data with the corresponding cursor. 3768 message ProtocolUpgradeProposalEdge { 3769 // Protocol upgrade proposal data. 3770 vega.events.v1.ProtocolUpgradeEvent node = 1; 3771 // Cursor that can be used to fetch further pages. 3772 string cursor = 2; 3773 } 3774 3775 // Request type for ListCoreSnapshots; fetches a paginated list of the core snapshots. 3776 message ListCoreSnapshotsRequest { 3777 // Optional pagination information to limit the data that is returned. 3778 optional Pagination pagination = 1; 3779 } 3780 3781 // Response from a ListCoreSnapshots RPC call; a paginated list of the core snapshots. 3782 message ListCoreSnapshotsResponse { 3783 // Page of core snapshot data and corresponding page information. 3784 CoreSnapshotConnection core_snapshots = 1; 3785 } 3786 3787 // Page of core snapshot data and corresponding page information. 3788 message CoreSnapshotConnection { 3789 // Page of core snapshot data and their corresponding cursors. 3790 repeated CoreSnapshotEdge edges = 1; 3791 // Page information that is used for fetching further pages. 3792 PageInfo page_info = 2; 3793 } 3794 3795 // Core snapshot data with the corresponding cursor. 3796 message CoreSnapshotEdge { 3797 // Core snapshot data. 3798 vega.events.v1.CoreSnapshotData node = 1; 3799 // Cursor that can be used to fetch further pages. 3800 string cursor = 2; 3801 } 3802 3803 // -- Network History -- 3804 // Network History allows the data node to reach out to peer nodes to fetch the most recent history, as well as 3805 // older history if desired, such that it can quickly get itself up to the latest block height of the network and start 3806 // to consume events for the latest block from the Vega core. 3807 // See https://github.com/vegaprotocol/vega/tree/develop/datanode/networkhistory/README.md for a full description of Network History 3808 3809 // Describes a network history segment 3810 message HistorySegment { 3811 // Starting height of the history segment. 3812 int64 from_height = 1; 3813 // Ending height of the history segment. 3814 int64 to_height = 2; 3815 // History segment ID. 3816 string history_segment_id = 3; 3817 // Previous history segment ID. 3818 string previous_history_segment_id = 4; 3819 // Database schema version of the history segment. 3820 int64 database_version = 5; 3821 // Chain ID of the history segment. 3822 string chain_id = 6; 3823 } 3824 3825 // Request to get the most recent history segment 3826 message GetMostRecentNetworkHistorySegmentRequest {} 3827 3828 // Response from getting most recent history segment 3829 message GetMostRecentNetworkHistorySegmentResponse { 3830 // Data relating to a history segment created by a Vega data node. 3831 HistorySegment segment = 1; 3832 // Key seed for the swarm section. 3833 string swarm_key_seed = 2; 3834 } 3835 3836 // Request to list all the nodes history segments 3837 message ListAllNetworkHistorySegmentsRequest {} 3838 3839 // Response with a list of all the nodes history segments 3840 message ListAllNetworkHistorySegmentsResponse { 3841 // Page of history segments data and corresponding page information. 3842 repeated HistorySegment segments = 1; 3843 } 3844 3845 // Request to get the addresses of active network history peers 3846 message GetActiveNetworkHistoryPeerAddressesRequest {} 3847 3848 // Response containing the addresses of active network history peers 3849 message GetActiveNetworkHistoryPeerAddressesResponse { 3850 // List of IP addresses for the active peers. 3851 repeated string ip_addresses = 1; 3852 } 3853 3854 // Request to get the status of network history 3855 message GetNetworkHistoryStatusRequest {} 3856 3857 // Response containing the status of network history 3858 message GetNetworkHistoryStatusResponse { 3859 // IPFS address of the data node currently connected to. 3860 string ipfs_address = 1; 3861 // Swarm key used by the IPFS swarm. 3862 string swarm_key = 2; 3863 // Swarm key seed used by the IPFS swarm. 3864 string swarm_key_seed = 3; 3865 // List of peers connected to the IPFS swarm. 3866 repeated string connected_peers = 5; 3867 } 3868 3869 // Request to get the nodes network history bootstrap peers 3870 message GetNetworkHistoryBootstrapPeersRequest {} 3871 3872 // Response containing the nodes network history bootstrap peers 3873 message GetNetworkHistoryBootstrapPeersResponse { 3874 // List of peers that can be used to bootstrap a Vega data node. 3875 repeated string bootstrap_peers = 1; 3876 } 3877 3878 enum Table { 3879 TABLE_UNSPECIFIED = 0; 3880 TABLE_BALANCES = 1; 3881 TABLE_CHECKPOINTS = 2; 3882 TABLE_DELEGATIONS = 3; 3883 TABLE_LEDGER = 4; 3884 TABLE_ORDERS = 5; 3885 TABLE_TRADES = 6; 3886 TABLE_MARKET_DATA = 7; 3887 TABLE_MARGIN_LEVELS = 8; 3888 TABLE_POSITIONS = 9; 3889 TABLE_LIQUIDITY_PROVISIONS = 10; 3890 TABLE_MARKETS = 11; 3891 TABLE_DEPOSITS = 12; 3892 TABLE_WITHDRAWALS = 13; 3893 TABLE_BLOCKS = 14; 3894 TABLE_REWARDS = 15; 3895 } 3896 3897 // Request to export network history data in CSV format 3898 message ExportNetworkHistoryRequest { 3899 // Block to begin exporting from. Must be the first block of a history segment, 3900 // which by default are 1000 blocks each; in that case - 1, 1001, 2001 etc. are valid values. 3901 // This can be checked by first calling the API to list all network history segments. 3902 int64 from_block = 1; 3903 // Last block to export up to and including. Must be the last block of a history segment 3904 // which by default are 1000 blocks each; in that case - 1000, 2000, 3000 etc. are valid values. 3905 // This can be checked by first calling the API to list all network history segments. 3906 int64 to_block = 2; 3907 // Table to export data from. 3908 Table table = 3; 3909 } 3910 3911 // Request to list all entities that were created by the given transaction hash 3912 message ListEntitiesRequest { 3913 // Transaction hash to match against 3914 string transaction_hash = 1 [(google.api.field_behavior) = REQUIRED]; 3915 } 3916 3917 // Response from listing entities that were created for a given transaction hash 3918 message ListEntitiesResponse { 3919 repeated vega.Account accounts = 1; 3920 repeated vega.Order orders = 2; 3921 repeated vega.Position positions = 3; 3922 repeated vega.LedgerEntry ledger_entries = 4; 3923 repeated AccountBalance balance_changes = 5; 3924 repeated vega.events.v1.Transfer transfers = 6; 3925 repeated vega.Vote votes = 7; 3926 repeated ERC20MultiSigSignerAddedBundle erc20_multi_sig_signer_added_bundles = 8; 3927 repeated ERC20MultiSigSignerRemovedBundle erc20_multi_sig_signer_removed_bundles = 9; 3928 repeated vega.Trade trades = 10; 3929 repeated vega.OracleSpec oracle_specs = 11; 3930 repeated vega.OracleData oracle_data = 12; 3931 repeated vega.Market markets = 13; 3932 repeated vega.Party parties = 14; 3933 repeated vega.MarginLevels margin_levels = 15; 3934 repeated vega.Reward rewards = 16; 3935 repeated vega.Deposit deposits = 17; 3936 repeated vega.Withdrawal withdrawals = 18; 3937 repeated vega.Asset assets = 19; 3938 repeated vega.LiquidityProvision liquidity_provisions = 20; 3939 repeated vega.Proposal proposals = 21; 3940 repeated vega.Delegation delegations = 22; 3941 repeated NodeBasic nodes = 23; 3942 repeated vega.commands.v1.NodeSignature node_signatures = 24; 3943 repeated vega.NetworkParameter network_parameters = 25; 3944 repeated vega.events.v1.KeyRotation key_rotations = 26; 3945 repeated vega.events.v1.EthereumKeyRotation ethereum_key_rotations = 27; 3946 repeated vega.events.v1.ProtocolUpgradeEvent protocol_upgrade_proposals = 28; 3947 } 3948 3949 // Request to get a party's activity streaks across epochs 3950 message GetPartyActivityStreakRequest { 3951 // Party ID to get the activity streak for. 3952 string party_id = 1 [(google.api.field_behavior) = REQUIRED]; 3953 // Epoch to get the activity streak for. If not set, the last complete epoch is used. 3954 optional uint64 epoch = 2; 3955 } 3956 3957 // Response when getting a party's activity streaks across epochs 3958 message GetPartyActivityStreakResponse { 3959 // Party's activity streak in a given epoch. 3960 vega.events.v1.PartyActivityStreak activity_streak = 1; 3961 } 3962 3963 // A funding payment for a party on a perpetual market 3964 message FundingPayment { 3965 // Party that received the funding payment. 3966 string party_id = 1; 3967 // Market that produced the funding payment. 3968 string market_id = 2; 3969 // Funding period sequence this payment was calculated from. 3970 uint64 funding_period_seq = 3; 3971 // Timestamp, in Unix nanoseconds, at which this funding payment occurred. 3972 int64 timestamp = 4; 3973 // Funding payment amount, where a positive value indicates an earned payment received and a negative value a loss. 3974 string amount = 5; 3975 // Amount missed out on due to loss socialization. 3976 string loss_amount = 6; 3977 } 3978 3979 // Request to list a a party's funding payments 3980 message ListFundingPaymentsRequest { 3981 // Party ID to get funding payment for. 3982 string party_id = 1 [(google.api.field_behavior) = REQUIRED]; 3983 // Restrict funding payments returned to those generated by the given market. 3984 optional string market_id = 2; 3985 // Pagination controls. 3986 optional Pagination pagination = 3; 3987 } 3988 3989 // Funding payment data with the corresponding cursor. 3990 message FundingPaymentEdge { 3991 // Funding payment data. 3992 FundingPayment node = 1; 3993 // Cursor that can be used to fetch further pages. 3994 string cursor = 2; 3995 } 3996 3997 // Page of funding payment data and corresponding page information. 3998 message FundingPaymentConnection { 3999 // Page of funding payment data and their corresponding cursors. 4000 repeated FundingPaymentEdge edges = 1; 4001 // Page information that is used for fetching further pages. 4002 PageInfo page_info = 2; 4003 } 4004 4005 // Response from listing funding payments 4006 message ListFundingPaymentsResponse { 4007 // Page of funding period data and corresponding page information. 4008 FundingPaymentConnection funding_payments = 1; 4009 } 4010 4011 // Request to list a perpetual market's funding periods 4012 message ListFundingPeriodsRequest { 4013 // Market ID to get funding periods for. 4014 string market_id = 1 [(google.api.field_behavior) = REQUIRED]; 4015 // Restrict the funding periods to those within the given date range. 4016 optional DateRange date_range = 2; 4017 // Pagination controls. 4018 optional Pagination pagination = 3; 4019 } 4020 4021 // Funding period data with the corresponding cursor. 4022 message FundingPeriodEdge { 4023 // Funding period data. 4024 vega.events.v1.FundingPeriod node = 1; 4025 // Cursor that can be used to fetch further pages. 4026 string cursor = 2; 4027 } 4028 4029 // Page of funding period data and corresponding page information. 4030 message FundingPeriodConnection { 4031 // Page of funding period data and their corresponding cursors. 4032 repeated FundingPeriodEdge edges = 1; 4033 // Page information that is used for fetching further pages. 4034 PageInfo page_info = 2; 4035 } 4036 4037 // Response from listing funding periods 4038 message ListFundingPeriodsResponse { 4039 // Page of funding period data and corresponding page information. 4040 FundingPeriodConnection funding_periods = 1; 4041 } 4042 4043 message ListFundingPeriodDataPointsRequest { 4044 // Market ID to get funding period data points for. 4045 string market_id = 1 [(google.api.field_behavior) = REQUIRED]; 4046 // Restrict the data points to those within the given date range. 4047 optional DateRange date_range = 2; 4048 // Restrict the data points to those with the given source type. 4049 optional vega.events.v1.FundingPeriodDataPoint.Source source = 3; 4050 // Restrict the data points to those that contributed to the given funding period sequence. 4051 optional uint64 seq = 4; 4052 // Pagination controls. 4053 optional Pagination pagination = 5; 4054 } 4055 4056 // Funding period data point with the corresponding cursor. 4057 message FundingPeriodDataPointEdge { 4058 // Funding period data point. 4059 vega.events.v1.FundingPeriodDataPoint node = 1; 4060 // Cursor that can be used to fetch further pages. 4061 string cursor = 2; 4062 } 4063 4064 // Page of funding period data points and corresponding page information. 4065 message FundingPeriodDataPointConnection { 4066 // Page of funding period data points and their corresponding cursors. 4067 repeated FundingPeriodDataPointEdge edges = 1; 4068 // Page information that is used for fetching further pages. 4069 PageInfo page_info = 2; 4070 } 4071 4072 // Response from listing funding period data points. 4073 message ListFundingPeriodDataPointsResponse { 4074 // Page of funding period data points and corresponding page information. 4075 FundingPeriodDataPointConnection funding_period_data_points = 1; 4076 } 4077 4078 // Request to ping the data node 4079 message PingRequest {} 4080 4081 // Ping response from the data node 4082 message PingResponse {} 4083 4084 // Basic description of an order. 4085 message OrderInfo { 4086 // Side for the order, e.g. buy or sell. 4087 vega.Side side = 1 [(google.api.field_behavior) = REQUIRED]; 4088 // Price for the order. The price is an unsigned integer. For example `123456` is a correctly 4089 // formatted price of `1.23456` assuming market configured to 5 decimal places. 4090 string price = 2 [(google.api.field_behavior) = REQUIRED]; 4091 // Size remaining. 4092 uint64 remaining = 3 [(google.api.field_behavior) = REQUIRED]; 4093 // Boolean that indicates if it is a market order. 4094 bool is_market_order = 4 [(google.api.field_behavior) = REQUIRED]; 4095 } 4096 4097 // Request for the estimated margin level, margin account balance change, and liquidation price for the specified position. 4098 message EstimatePositionRequest { 4099 // Market ID to estimate position for. 4100 string market_id = 1 [(google.api.field_behavior) = REQUIRED]; 4101 // Open volume. This field is a signed integer scaled to the market's position decimal places. 4102 // A negative number denotes a short position. 4103 int64 open_volume = 2 [(google.api.field_behavior) = REQUIRED]; 4104 // Average entry price corresponding to the open volume. The price is an unsigned integer. For example `123456` is a correctly 4105 // formatted price of `1.23456` assuming market configured to 5 decimal places. 4106 string average_entry_price = 3 [(google.api.field_behavior) = REQUIRED]; 4107 // Open and/or hypothetical orders. 4108 repeated OrderInfo orders = 4; 4109 // Margin account balance. Needs to scaled by asset decimal places. 4110 string margin_account_balance = 5 [(google.api.field_behavior) = REQUIRED]; 4111 // General account balance. Needs to scaled by asset decimal places. 4112 string general_account_balance = 6 [(google.api.field_behavior) = REQUIRED]; 4113 // Order margin account balance. Needs to be scaled by asset decimal places. 4114 string order_margin_account_balance = 7 [(google.api.field_behavior) = REQUIRED]; 4115 // Margin mode for the party, cross margin or isolated margin. 4116 vega.MarginMode margin_mode = 8 [(google.api.field_behavior) = REQUIRED]; 4117 // Margin factor to be used along with isolated margin mode 4118 optional string margin_factor = 9; 4119 // Whether the estimated position margin increase should be included in available collateral for liquidation price calculation in isolated margin mode. 4120 optional bool include_required_position_margin_in_available_collateral = 10; 4121 // Whether the liquidation price estimates should be scaled to market decimal places or by asset decimal places. If not set, asset decimal places are used. 4122 optional bool scale_liquidation_price_to_market_decimals = 11; 4123 } 4124 4125 // Response for the estimated margin level, margin account balance change, and liquidation price for the specified position. 4126 message EstimatePositionResponse { 4127 // Margin level range estimate for the specified position. 4128 MarginEstimate margin = 1; 4129 // Estimated margin account balance increase. 4130 CollateralIncreaseEstimate collateral_increase_estimate = 2; 4131 // Liquidation price range estimate for the specified position. Only populated if available collateral was specified in the request. 4132 LiquidationEstimate liquidation = 3; 4133 } 4134 4135 // Estimates the additional funds needed to support the specified position 4136 message CollateralIncreaseEstimate { 4137 // Estimate assuming slippage cap is applied 4138 string worst_case = 1; 4139 // Estimate assuming no slippage 4140 string best_case = 2; 4141 } 4142 4143 // Margin level estimate for both worst and best case possible. 4144 message MarginEstimate { 4145 // Margin level estimate assuming slippage cap is applied. 4146 vega.MarginLevels worst_case = 1; 4147 // Margin level estimate assuming no slippage. 4148 vega.MarginLevels best_case = 2; 4149 } 4150 4151 // Liquidation estimate for both worst and best case possible. 4152 message LiquidationEstimate { 4153 // Liquidation price estimate assuming slippage cap is applied. 4154 LiquidationPrice worst_case = 1; 4155 // Liquidation price estimate assuming no slippage. 4156 LiquidationPrice best_case = 2; 4157 } 4158 4159 // 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. 4160 message LiquidationPrice { 4161 // Liquidation price for current open volume ignoring any active orders. 4162 string open_volume_only = 1; 4163 // Liquidation price assuming buy orders start getting filled. 4164 string including_buy_orders = 2; 4165 // Liquidation price assuming sell orders start getting filled. 4166 string including_sell_orders = 3; 4167 } 4168 4169 // Request to get the current referral program 4170 message GetCurrentReferralProgramRequest {} 4171 4172 // Response containing the current referral program 4173 message GetCurrentReferralProgramResponse { 4174 // Referral program currently activated on the network. 4175 ReferralProgram current_referral_program = 1; 4176 } 4177 4178 // Referral program details. 4179 message ReferralProgram { 4180 // Incremental version of the program. It is incremented after each program 4181 // update. 4182 uint64 version = 1; 4183 // Unique ID generated from the proposal that created this program. 4184 string id = 2; 4185 // Defined tiers in increasing order. First element will give Tier 1, second 4186 // element will give Tier 2, and so on. 4187 repeated vega.BenefitTier benefit_tiers = 3; 4188 // Timestamp in Unix nanoseconds, after which when the current epoch ends, the 4189 // program will end and benefits will be disabled. 4190 int64 end_of_program_timestamp = 4; 4191 // Number of epochs over which the referral set's running volume is evaluated. 4192 uint64 window_length = 5; 4193 // Defined benefit tiers ordered by increasing reward multiplier. Determines the level of 4194 // benefit a party can expect based on their staking. 4195 repeated vega.StakingTier staking_tiers = 6; 4196 // Timestamp, in Unix nanoseconds, when the program ended. 4197 optional int64 ended_at = 7; 4198 } 4199 4200 // Data relating to a referral set. 4201 message ReferralSet { 4202 // Unique ID of the created set. 4203 string id = 1; 4204 // Party that created the set. 4205 string referrer = 2; 4206 // Timestamp, in Unix nanoseconds, when the set was created. 4207 int64 created_at = 3; 4208 // Timestamp, in Unix nanoseconds, when the set was updated. 4209 int64 updated_at = 4; 4210 // Current number of members in the referral set. 4211 uint64 total_members = 5; 4212 } 4213 4214 // Referral set data with the corresponding cursor. 4215 message ReferralSetEdge { 4216 // Referral set data. 4217 ReferralSet node = 1; 4218 // Cursor that can be used to fetch further pages. 4219 string cursor = 2; 4220 } 4221 4222 // Page of referral set data and corresponding page information. 4223 message ReferralSetConnection { 4224 // Page of referral set data and their corresponding cursors. 4225 repeated ReferralSetEdge edges = 1; 4226 // Page information that is used for fetching further pages. 4227 PageInfo page_info = 2; 4228 } 4229 4230 // Request to retrieve information about a referral set or sets 4231 message ListReferralSetsRequest { 4232 // Referral set ID to retrieve information for 4233 optional string referral_set_id = 1; 4234 // Pagination controls. 4235 optional Pagination pagination = 2; 4236 // Referrer to filter by. If referrer set ID is provided, this field is ignored. 4237 optional string referrer = 3; 4238 // Referee to filter by. If referrer set ID or referrer is provided, this field is ignored. 4239 optional string referee = 4; 4240 } 4241 4242 // Response containing information about a referral set or sets 4243 message ListReferralSetsResponse { 4244 // Page of referral set data and corresponding page information. 4245 ReferralSetConnection referral_sets = 1; 4246 } 4247 4248 // Data relating to referees that have joined a referral set 4249 message ReferralSetReferee { 4250 // Unique ID of the referral set the referee joined. 4251 string referral_set_id = 1; 4252 // Party that joined the set. 4253 string referee = 2; 4254 // Timestamp, in Unix nanoseconds, when the party joined the set. 4255 int64 joined_at = 3; 4256 // Epoch at which the party joined the set. 4257 uint64 at_epoch = 4; 4258 // Total notional volume of the referee's aggressive trades over the aggregation period. 4259 string total_referee_notional_taker_volume = 5; 4260 // Total rewards generated by the referee over the aggregation period. 4261 string total_referee_generated_rewards = 6; 4262 } 4263 4264 // Data about the Referral set's referees with the corresponding cursor. 4265 message ReferralSetRefereeEdge { 4266 // Referral set referee data. 4267 ReferralSetReferee node = 1; 4268 // Cursor that can be used to fetch further pages. 4269 string cursor = 2; 4270 } 4271 4272 // Page of data about the referral set's referees and corresponding page information. 4273 message ReferralSetRefereeConnection { 4274 // Page of referral set referee data and their corresponding cursors. 4275 repeated ReferralSetRefereeEdge edges = 1; 4276 // Page information that is used for fetching further pages. 4277 PageInfo page_info = 2; 4278 } 4279 4280 // Request to retrieve information about a referral set's referees 4281 message ListReferralSetRefereesRequest { 4282 // Referral set ID to retrieve information for 4283 optional string referral_set_id = 1; 4284 // Pagination controls. 4285 optional Pagination pagination = 2; 4286 // Referrer to filter by. If referrer set ID is provided, this field is ignored. 4287 optional string referrer = 3; 4288 // Referee to filter by. If referrer set ID or referrer is provided, this field is ignored. 4289 optional string referee = 4; 4290 // Epochs to aggregate party volume and rewards over. If omitted, 30 epochs will be used. 4291 optional uint32 aggregation_epochs = 5; 4292 } 4293 4294 // Response containing information about a referral set's referees 4295 message ListReferralSetRefereesResponse { 4296 // Page of referral set referee data and corresponding page information. 4297 ReferralSetRefereeConnection referral_set_referees = 1; 4298 } 4299 4300 // Request to get a referral set's stats 4301 message GetReferralSetStatsRequest { 4302 // Restrict referral set statistics to those for the given referral set. 4303 optional string referral_set_id = 1; 4304 // Epoch to get referral set statistics for. If not set, the last complete epoch is used. 4305 optional uint64 at_epoch = 2; 4306 // Restrict referral set statistics to those for the given referee. 4307 optional string referee = 3; 4308 // Pagination controls. 4309 optional Pagination pagination = 4; 4310 } 4311 4312 // Response containing the volume discount statistics for the given epoch. 4313 message GetReferralSetStatsResponse { 4314 // Referral set statistics for the epoch. 4315 ReferralSetStatsConnection stats = 1; 4316 } 4317 4318 // Page of volume discount stats data and corresponding page information. 4319 message ReferralSetStatsConnection { 4320 // Page of volume discount statistics data and their corresponding cursors. 4321 repeated ReferralSetStatsEdge edges = 1; 4322 // Page information that is used for fetching further pages. 4323 PageInfo page_info = 2; 4324 } 4325 4326 // Referral set stats data with the corresponding cursor. 4327 message ReferralSetStatsEdge { 4328 // Referral set stats data. 4329 ReferralSetStats node = 1; 4330 // Cursor that can be used to fetch further pages. 4331 string cursor = 2; 4332 } 4333 4334 // Referral set statistics for a given epoch for a party. 4335 message ReferralSetStats { 4336 // Epoch at which the set's statistics were updated. 4337 uint64 at_epoch = 1; 4338 // Running volume for the set based on the window length of the current 4339 // referral program. 4340 string referral_set_running_notional_taker_volume = 2; 4341 // Party ID. 4342 string party_id = 3; 4343 // deprecated 4344 string discount_factor = 4; 4345 // deprecated 4346 string reward_factor = 5; 4347 // Current referee notional taker volume. 4348 string epoch_notional_taker_volume = 6; 4349 // Multiplier applied to the referral reward factor when calculating referral rewards due to the referrer. 4350 string rewards_multiplier = 7; 4351 // deprecated 4352 string rewards_factor_multiplier = 8; 4353 // Indicates if the referral set was eligible to be part of the referral program. 4354 bool was_eligible = 9; 4355 // Referrer's taker volume 4356 string referrer_taker_volume = 10; 4357 // Discount factors applied to the party. 4358 vega.DiscountFactors discount_factors = 11; 4359 // Reward factors applied to the party. 4360 vega.RewardFactors reward_factors = 12; 4361 // Proportion of the referee's taker fees to be rewarded to the referrer. 4362 vega.RewardFactors rewards_factors_multiplier = 13; 4363 } 4364 4365 // Team record containing the team information. 4366 message Team { 4367 // ID of the created team. 4368 string team_id = 1; 4369 // Party ID that created the team. 4370 string referrer = 2; 4371 // Name of the team. 4372 string name = 3; 4373 // Link to the team's homepage. 4374 optional string team_url = 4; 4375 // Link to an image of the team's avatar. 4376 optional string avatar_url = 5; 4377 // Timestamp in Unix nanoseconds when the team was created. 4378 int64 created_at = 6; 4379 // Whether or not the team is closed to new party members. When closed, only parties specified in the allow list can 4380 // join the team. 4381 bool closed = 7; 4382 // Epoch at which the team was created. 4383 uint64 created_at_epoch = 8; 4384 // List of public keys that are allowed to join the team. 4385 // Only applicable to closed teams. 4386 repeated string allow_list = 9; 4387 // Current number of members in the team. 4388 uint64 total_members = 10; 4389 } 4390 4391 // Team data item with the corresponding cursor. 4392 message TeamEdge { 4393 // Team data. 4394 Team node = 1; 4395 // Cursor that can be used to fetch further pages. 4396 string cursor = 2; 4397 } 4398 4399 // Page of team data and corresponding page information. 4400 message TeamConnection { 4401 // Page of team data and their corresponding cursors. 4402 repeated TeamEdge edges = 1; 4403 // Page information that is used for fetching further pages. 4404 PageInfo page_info = 2; 4405 } 4406 4407 // Request to list all teams 4408 message ListTeamsRequest { 4409 // Restrict teams to those with the given team ID. 4410 optional string team_id = 1; 4411 // Restrict teams to those where the given party is a referrer or a referee. 4412 optional string party_id = 2; 4413 // Pagination controls. 4414 optional Pagination pagination = 3; 4415 } 4416 4417 // Response for the list teams request containing the team information. 4418 message ListTeamsResponse { 4419 // Page of team data and corresponding page information. 4420 TeamConnection teams = 1; 4421 } 4422 4423 // Request to list all teams' statistics. 4424 message ListTeamsStatisticsRequest { 4425 // Restrict team statistics to those with the given team ID. 4426 optional string team_id = 1; 4427 // Defines the number of past epochs to aggregate data from. By default, it takes 4428 // the last 10 epochs. 4429 optional uint64 aggregation_epochs = 2; 4430 // Pagination controls. 4431 optional Pagination pagination = 3; 4432 } 4433 4434 // Response for the list teams' statistics request containing the statistics. 4435 message ListTeamsStatisticsResponse { 4436 // Page of teams' statistics data and corresponding page information. 4437 TeamsStatisticsConnection statistics = 1; 4438 } 4439 4440 // Page of teams' statistics and corresponding page information. 4441 message TeamsStatisticsConnection { 4442 // Page of team data and their corresponding cursors. 4443 repeated TeamStatisticsEdge edges = 1; 4444 // Page information that is used for fetching further pages. 4445 PageInfo page_info = 2; 4446 } 4447 4448 // Team data item with the corresponding cursor. 4449 message TeamStatisticsEdge { 4450 // Team's statistics data. 4451 TeamStatistics node = 1; 4452 // Cursor that can be used to fetch further pages. 4453 string cursor = 2; 4454 } 4455 4456 // Team's statistics record containing the team information. 4457 message TeamStatistics { 4458 // Team ID the statistics are related to. 4459 string team_id = 1; 4460 // Total of volume accumulated over the requested epoch period, expressed in 4461 // quantum value. 4462 string total_quantum_volume = 2; 4463 // Total of rewards accumulated over the requested epoch period, expressed in 4464 // quantum value. 4465 string total_quantum_rewards = 3; 4466 // List of rewards over the requested epoch period, expressed in quantum 4467 // value for each epoch. 4468 repeated QuantumRewardsPerEpoch quantum_rewards = 4; 4469 // Total of games played. 4470 uint64 total_games_played = 5; 4471 // List of games played over the requested epoch period. 4472 repeated string games_played = 6; 4473 // List of volumes over the requested epoch period, expressed in quantum 4474 // value for each epoch. 4475 repeated QuantumVolumesPerEpoch quantum_volumes = 7; 4476 } 4477 4478 message QuantumRewardsPerEpoch { 4479 // Epoch for which this information is valid. 4480 uint64 epoch = 1; 4481 // Total rewards accumulated over the epoch period, expressed in quantum value. 4482 string total_quantum_rewards = 2; 4483 } 4484 4485 message QuantumVolumesPerEpoch { 4486 // Epoch for which this information is valid. 4487 uint64 epoch = 1; 4488 // Total volumes accumulated over the epoch period, expressed in quantum value. 4489 string total_quantum_volumes = 2; 4490 } 4491 4492 // Request to list all team members' statistics. 4493 message ListTeamMembersStatisticsRequest { 4494 // Restrict team statistics to those with the given team ID. 4495 string team_id = 1; 4496 // Restrict team members' statistics to those with the given party ID. 4497 optional string party_id = 2; 4498 // Defines the number of past epochs to aggregate data from. By default, it takes 4499 // the last 10 epochs. 4500 optional uint64 aggregation_epochs = 3; 4501 // Pagination controls. 4502 optional Pagination pagination = 4; 4503 } 4504 4505 // Response for the list team members' statistics request containing the statistics. 4506 message ListTeamMembersStatisticsResponse { 4507 // Page of team members' statistics data and corresponding page information. 4508 TeamMembersStatisticsConnection statistics = 1; 4509 } 4510 4511 // Page of team members' statistics and corresponding page information. 4512 message TeamMembersStatisticsConnection { 4513 // Page of team member data and their corresponding cursors. 4514 repeated TeamMemberStatisticsEdge edges = 1; 4515 // Page information that is used for fetching further pages. 4516 PageInfo page_info = 2; 4517 } 4518 4519 // Team member data item with the corresponding cursor. 4520 message TeamMemberStatisticsEdge { 4521 // Team member's statistics data. 4522 TeamMemberStatistics node = 1; 4523 // Cursor that can be used to fetch further pages. 4524 string cursor = 2; 4525 } 4526 4527 // Team member's statistics record containing the team member's information. 4528 message TeamMemberStatistics { 4529 // Party ID the statistics are related to. 4530 string party_id = 1; 4531 // Total of volume accumulated over the requested epoch period, expressed in 4532 // quantum value. 4533 string total_quantum_volume = 2; 4534 // Total of rewards accumulated over the requested epoch period, expressed in 4535 // quantum value. 4536 string total_quantum_rewards = 3; 4537 // List of rewards over the requested epoch period, expressed in quantum 4538 // value for each epoch. 4539 repeated QuantumRewardsPerEpoch quantum_rewards = 4; 4540 // Total number of games played. 4541 uint64 total_games_played = 5; 4542 // List of games played over the requested epoch period. 4543 repeated string games_played = 6; 4544 // List of volumes over the requested epoch period, expressed in quantum 4545 // value for each epoch. 4546 repeated QuantumVolumesPerEpoch quantum_volumes = 7; 4547 } 4548 4549 // Request that is sent when listing the referees for a given team. 4550 message ListTeamRefereesRequest { 4551 // Team ID to list referees for. 4552 string team_id = 1 [(google.api.field_behavior) = REQUIRED]; 4553 // Pagination controls. 4554 optional Pagination pagination = 2; 4555 } 4556 4557 // A team's referee info 4558 message TeamReferee { 4559 // ID of the team the referee joined. 4560 string team_id = 1; 4561 // Party that joined the team. 4562 string referee = 2; 4563 // Timestamp in Unix nanoseconds when the party joined the team. 4564 int64 joined_at = 3; 4565 // Epoch at which the party joined the team. 4566 uint64 joined_at_epoch = 4; 4567 } 4568 4569 // Team referee data item with the corresponding cursor. 4570 message TeamRefereeEdge { 4571 // Team referee data. 4572 TeamReferee node = 1; 4573 // Cursor that can be used to fetch further pages. 4574 string cursor = 2; 4575 } 4576 4577 // Page of team referee data and corresponding page information. 4578 message TeamRefereeConnection { 4579 // Page of team referee data and their corresponding cursors. 4580 repeated TeamRefereeEdge edges = 1; 4581 // Page information that is used for fetching further pages. 4582 PageInfo page_info = 2; 4583 } 4584 4585 // Response that is sent when listing the referees for a given team. 4586 message ListTeamRefereesResponse { 4587 // Page of team referee data and corresponding page information. 4588 TeamRefereeConnection team_referees = 1; 4589 } 4590 4591 // A referee's team change information 4592 message TeamRefereeHistory { 4593 // ID of the team the referee joined. 4594 string team_id = 1; 4595 // Timestamp in Unix nanoseconds when the party joined the team. 4596 int64 joined_at = 2; 4597 // Epoch at which the party joined the team. 4598 uint64 joined_at_epoch = 3; 4599 } 4600 4601 // Team referee history data item with the corresponding cursor. 4602 message TeamRefereeHistoryEdge { 4603 // Team referee data. 4604 TeamRefereeHistory node = 1; 4605 // Cursor that can be used to fetch further pages. 4606 string cursor = 2; 4607 } 4608 4609 // Page of history data about a referee's team membership and corresponding page information. 4610 message TeamRefereeHistoryConnection { 4611 // Page of team referee history data and their corresponding cursors. 4612 repeated TeamRefereeHistoryEdge edges = 1; 4613 // Page information that is used for fetching further pages. 4614 PageInfo page_info = 2; 4615 } 4616 4617 // Request that is sent when listing the referee history for a given team. 4618 message ListTeamRefereeHistoryRequest { 4619 // Party ID to list referee history for. 4620 string referee = 1 [(google.api.field_behavior) = REQUIRED]; 4621 // Pagination controls. 4622 optional Pagination pagination = 2; 4623 } 4624 4625 // Response that is sent when listing the referee history for a given team. 4626 message ListTeamRefereeHistoryResponse { 4627 // Page of team referee history data and corresponding page information. 4628 TeamRefereeHistoryConnection team_referee_history = 1; 4629 } 4630 4631 // Request that is sent to retrieve fees statistics. 4632 message GetFeesStatsRequest { 4633 // Restrict fee statistics to those related to the given market. 4634 optional string market_id = 1; 4635 // Restrict fee statistics to those related to the given asset. 4636 optional string asset_id = 2; 4637 // Epoch to get referral fee statistics for. If not set, the last complete epoch is used. 4638 optional uint64 epoch_seq = 3; 4639 // Restrict fee statistics to those for the given party. 4640 optional string party_id = 4; 4641 // Restrict fee statistics to epoch range starting with epoch from. 4642 optional uint64 epoch_from = 5; 4643 // Restrict fee statistics to epoch range ending with epoch to. 4644 optional uint64 epoch_to = 6; 4645 } 4646 4647 // Response that is sent when requesting fees statistics. 4648 message GetFeesStatsResponse { 4649 // Fees statistics for the given request. 4650 vega.events.v1.FeesStats fees_stats = 1; 4651 } 4652 4653 // Request that is sent to retrieve fees statistics for a given party. 4654 message GetFeesStatsForPartyRequest { 4655 // Restrict fees statistics to those for the given party. 4656 string party_id = 1; 4657 // Restrict fees statistics to those related to the given asset. 4658 optional string asset_id = 2; 4659 // Epoch to filter from (included). If omitted, the range goes from the oldest epoch to the `to epoch`. 4660 optional uint64 from_epoch = 3; 4661 // Epoch to filter to (included). If omitted, the range goes from `from epoch` to the most recent epoch. 4662 optional uint64 to_epoch = 4; 4663 } 4664 4665 // Response that is sent when requesting fees statistics for a given party. 4666 message GetFeesStatsForPartyResponse { 4667 // Fees statistics for the given request. 4668 repeated FeesStatsForParty fees_stats_for_party = 1; 4669 } 4670 4671 // Request to get the current referral program 4672 message GetCurrentVolumeDiscountProgramRequest {} 4673 4674 // Response containing the current referral program 4675 message GetCurrentVolumeDiscountProgramResponse { 4676 // Volume discount program currently activated on the network. 4677 VolumeDiscountProgram current_volume_discount_program = 1; 4678 } 4679 4680 // Request to get the volume discount statistics for a given epoch. 4681 message GetVolumeDiscountStatsRequest { 4682 // Epoch to get volume discount statistics for. If not set, last epoch is used. 4683 optional uint64 at_epoch = 1; 4684 // Restrict volume discount statistics to those for the given party. 4685 optional string party_id = 2; 4686 // Pagination controls. 4687 optional Pagination pagination = 3; 4688 } 4689 4690 // Response containing the volume discount statistics for the given epoch. 4691 message GetVolumeDiscountStatsResponse { 4692 // Volume discount statistics for an epoch. 4693 VolumeDiscountStatsConnection stats = 1; 4694 } 4695 4696 // Page of volume discount stats data and corresponding page information. 4697 message VolumeDiscountStatsConnection { 4698 // Page of volume discount statistics data and their corresponding cursors. 4699 repeated VolumeDiscountStatsEdge edges = 1; 4700 // Page information that is used for fetching further pages. 4701 PageInfo page_info = 2; 4702 } 4703 4704 // Volume discount stats data with the corresponding cursor. 4705 message VolumeDiscountStatsEdge { 4706 // Volume discount stats data. 4707 VolumeDiscountStats node = 1; 4708 // Cursor that can be used to fetch further pages. 4709 string cursor = 2; 4710 } 4711 4712 // Volume discount statistics for a given epoch for all parties. 4713 message VolumeDiscountStats { 4714 // Epoch at which the statistics apply. 4715 uint64 at_epoch = 1; 4716 // Party ID for which the statistics apply. 4717 string party_id = 2; 4718 // deprecated 4719 string discount_factor = 3; 4720 // The party's running volume. 4721 string running_volume = 4; 4722 // Discount factor applied given the party's running volume. 4723 vega.DiscountFactors discount_factors = 5; 4724 } 4725 4726 // Volume discount program details. 4727 message VolumeDiscountProgram { 4728 // Incremental version of the program. It is incremented after each program 4729 // update. 4730 uint64 version = 1; 4731 // Unique ID generated from the proposal that created this program. 4732 string id = 2; 4733 // Defined benefit tiers ordered by increasing discounts. Determines the level of 4734 // benefit a party can expect based on performance criteria. 4735 repeated vega.VolumeBenefitTier benefit_tiers = 3; 4736 // Timestamp in Unix nanoseconds, after which when the current epoch 4737 // ends, the program will end and benefits will be disabled. 4738 int64 end_of_program_timestamp = 4; 4739 // Number of epochs over which a volume discount statistics' running volume is evaluated. 4740 uint64 window_length = 5; 4741 // Timestamp in Unix nanoseconds, at which the program ended. 4742 optional int64 ended_at = 6; 4743 } 4744 4745 message FeesStatsForParty { 4746 // Settlement asset of the market. 4747 string asset_id = 1; 4748 // Total referral rewards received by referrer of the referral set. 4749 string total_rewards_received = 2; 4750 // Total referral discounts applied to referee fees. 4751 string referees_discount_applied = 3; 4752 // Total volume discounts applied to referee fees. 4753 string volume_discount_applied = 4; 4754 // Total maker fees received by the maker side. 4755 string total_maker_fees_received = 5; 4756 } 4757 4758 // Request to subscribe to a stream of users' transaction results 4759 message ObserveTransactionResultsRequest { 4760 // Request fields party ID, hash and status are all optional filters: 4761 // If omitted all transaction results, for all parties with all hashes and states will be returned on the stream 4762 // If party ID is given, transaction results from that party will be returned on the stream 4763 // If hash is given, transaction result with that hash will be returned on the stream 4764 // If status is given, transaction result with that status (true/false - success failure) will be returned on the stream 4765 // All filters can be combined. 4766 4767 // Restrict the transaction results streamed to those made by the given parties. 4768 repeated string party_ids = 1; 4769 // Restrict the transaction results streamed to those with given hashes. 4770 repeated string hashes = 2; 4771 // Restrict the transaction results streamed to those with given status true/false (success/failure). 4772 optional bool status = 3; 4773 } 4774 4775 // Stream of transaction results 4776 message ObserveTransactionResultsResponse { 4777 // List of 0 or more transaction results. 4778 repeated vega.events.v1.TransactionResult transaction_results = 1; 4779 } 4780 4781 // Request an estimation of transfer fee and discount 4782 message EstimateTransferFeeRequest { 4783 // Sender's ID. 4784 string from_account = 1; 4785 // Type of account sent from. 4786 vega.AccountType from_account_type = 2; 4787 // Receiver's ID. 4788 string to_account = 3; 4789 // Amount to be transferred. 4790 string amount = 4; 4791 // Asset ID for the asset associated with the transaction. 4792 string asset_id = 5; 4793 // AMM public key, if assets are being transferred from an AMM key to the AMM owner's public key. 4794 // The `from_account` must be the owner of this AMM key. 4795 optional string from_amm_key = 6; 4796 } 4797 4798 // Results of estimation of transfer fee and the fee discount 4799 message EstimateTransferFeeResponse { 4800 // Estimated fee for the transfer. 4801 string fee = 1; 4802 // Discount applied to the fee. 4803 string discount = 2; 4804 } 4805 4806 // Get total transfer fee discount available 4807 message GetTotalTransferFeeDiscountRequest { 4808 // ID of party eligible for the discount. 4809 string party_id = 1; 4810 // ID of asset associated with the discount. 4811 string asset_id = 5; 4812 } 4813 4814 // Returns total transfer fee discount available 4815 message GetTotalTransferFeeDiscountResponse { 4816 // Total per party per asset discount available. 4817 string total_discount = 2; 4818 } 4819 4820 // Request to retrieve games data. 4821 message ListGamesRequest { 4822 // Game ID to filter for. 4823 optional string game_id = 1; 4824 // Oldest epoch to retrieve game data from, inclusive. The maximum range of epochs that can be fetched at once is 30. 4825 // If not provided, defaults to the 'to' epoch minus 29, or the first epoch available if not enough epochs have passed. 4826 // If the 'to' epoch is not specified, it will be set to the chosen 'from' epoch + 29. 4827 optional uint64 epoch_from = 2; 4828 // Most recent epoch to retrieve game data to, inclusive. If not provided, defaults to the latest epoch. The maximum range of epochs that can be fetched at once is 30. 4829 // If no 'from' epoch is provided, or the 'from' epoch is out of range, i.e., the 'to' epoch - 'from' epoch > 29, 4830 // the 'from' epoch will be set to the 'to' epoch - 29. 4831 optional uint64 epoch_to = 3; 4832 // Entity scope to filter games for, i.e. team games or individual games only 4833 optional vega.EntityScope entity_scope = 4; 4834 // Pagination controls. 4835 optional Pagination pagination = 5; 4836 // Team ID to filter for. This filter will only be applied if entity scope is not specified 4837 // in the request, or the entity scope is set to teams. 4838 optional string team_id = 6; 4839 // Party ID to filter for. This filter will apply regardless of the entity scope. 4840 // If the entity scope filter is teams, then the party ID filter will apply to team members. 4841 optional string party_id = 7; 4842 } 4843 4844 // Response containing games data. 4845 message ListGamesResponse { 4846 // Page of games data and corresponding page information. 4847 GamesConnection games = 1; 4848 } 4849 4850 // Page of games data and corresponding page information. 4851 message GamesConnection { 4852 // Page of games data and their corresponding cursors. 4853 repeated GameEdge edges = 1; 4854 // Page information that is used for fetching further pages. 4855 PageInfo page_info = 2; 4856 } 4857 4858 // Game information and corresponding cursor. 4859 message GameEdge { 4860 // Game data. 4861 Game node = 1; 4862 // Cursor that can be used to fetch further pages. 4863 string cursor = 2; 4864 } 4865 4866 // Data relating to a game. 4867 message Game { 4868 // Unique ID of the game 4869 string id = 1; 4870 // Epoch at which the last game metrics were captured. 4871 uint64 epoch = 2; 4872 // The number of participants in the game. 4873 uint64 participants = 3; 4874 // Entities participating in a game and their corresponding metrics. 4875 oneof entities { 4876 // Team entities that are participating in the game 4877 TeamGameEntities team = 4; 4878 // Individual entities that are participating in the game 4879 IndividualGameEntities individual = 5; 4880 } 4881 // ID of the asset rewarded for involvement in the game. 4882 string reward_asset_id = 6; 4883 } 4884 4885 // List of teams that are participating in a game 4886 message TeamGameEntities { 4887 // List of teams, the participant members of a team, and the metrics associated with each participant. 4888 repeated TeamGameEntity team = 1; 4889 } 4890 4891 // List of individuals that are participating in a game 4892 message IndividualGameEntities { 4893 // List of individual party IDs, and the metrics associated with each participant. 4894 repeated IndividualGameEntity individual = 1; 4895 } 4896 4897 // Data relating to a team participating in a game. 4898 message TeamGameEntity { 4899 // Team participation breakdown 4900 TeamGameParticipation team = 1; 4901 // Rank of the team in the game 4902 uint64 rank = 2; 4903 // Volume traded by the team 4904 string volume = 3; 4905 // Reward metric applied to the team 4906 vega.DispatchMetric reward_metric = 4; 4907 // Reward earned by the team 4908 string reward_earned = 5; 4909 // Total rewards earned by the individual for the team 4910 string total_rewards_earned = 6; 4911 // Rewards earned by the team in quantum value 4912 string reward_earned_quantum = 7; 4913 // Total rewards earned by the team in quantum value 4914 string total_rewards_earned_quantum = 8; 4915 } 4916 4917 // Breakdown of a team's participation in a game. 4918 message TeamGameParticipation { 4919 // ID of the team participating 4920 string team_id = 1; 4921 // Individual team member metrics for their participation in the game 4922 repeated IndividualGameEntity members_participating = 2; 4923 } 4924 4925 // Data relating to an individual participating in a game. 4926 // This can be used for both team members who are participating in a team game, 4927 // or individuals participating in an individual entity game. 4928 message IndividualGameEntity { 4929 // Party ID of the individual participating 4930 string individual = 1; 4931 // Rank of the individual either in the game or within their team. 4932 uint64 rank = 2; 4933 // Volume traded by the individual 4934 string volume = 3; 4935 // Reward metric applied to the individual 4936 vega.DispatchMetric reward_metric = 4; 4937 // Reward earned by the individual during the epoch 4938 string reward_earned = 5; 4939 // Total rewards earned by the individual for the game 4940 string total_rewards_earned = 6; 4941 // Rewards earned by the individual in quantum value 4942 string reward_earned_quantum = 7; 4943 // Total rewards earned by the individual in quantum value 4944 string total_rewards_earned_quantum = 8; 4945 } 4946 4947 // Request to retrieve party margin modes. 4948 message ListPartyMarginModesRequest { 4949 // Market ID to filter for. 4950 optional string market_id = 1; 4951 // Party ID to filter for. 4952 optional string party_id = 2; 4953 // Pagination controls. 4954 optional Pagination pagination = 5; 4955 } 4956 4957 // Response containing party margin modes. 4958 message ListPartyMarginModesResponse { 4959 // Page of party margin modes data and corresponding page information. 4960 PartyMarginModesConnection party_margin_modes = 1; 4961 } 4962 4963 // Page of party margin modes data and corresponding page information. 4964 message PartyMarginModesConnection { 4965 // Page of party margin modes data and their corresponding cursors. 4966 repeated PartyMarginModeEdge edges = 1; 4967 // Page information that is used for fetching further pages. 4968 PageInfo page_info = 2; 4969 } 4970 4971 // Party margin mode information and corresponding cursor. 4972 message PartyMarginModeEdge { 4973 // Party margin mode data. 4974 PartyMarginMode node = 1; 4975 // Cursor that can be used to fetch further pages. 4976 string cursor = 2; 4977 } 4978 4979 // Margin mode selected for the given party and market. 4980 message PartyMarginMode { 4981 // Unique ID of the market. 4982 string market_id = 1; 4983 // Unique ID of the party. 4984 string party_id = 2; 4985 // Selected margin mode. 4986 vega.MarginMode margin_mode = 3; 4987 // Margin factor for the market. Isolated mode only. 4988 optional string margin_factor = 4; 4989 // Minimum theoretical margin factor for the market. Isolated mode only. 4990 optional string min_theoretical_margin_factor = 5; 4991 // Maximum theoretical leverage for the market. Isolated mode only. 4992 optional string max_theoretical_leverage = 6; 4993 // Epoch at which the update happened. 4994 uint64 at_epoch = 7; 4995 } 4996 4997 // Time weighted notional position for a party and asset at a given epoch. It is used as a metric to calculate whether 4998 // the party is eligible for receiving a reward. 4999 message TimeWeightedNotionalPosition { 5000 // Asset ID for the settlement asset associated with the position. 5001 string asset_id = 1; 5002 // Party ID for the party associated with the position. 5003 string party_id = 2; 5004 // Game ID for the game associated with the position. 5005 string game_id = 3; 5006 // Epoch at which the time weighted notional position is calculated. 5007 uint64 at_epoch = 4; 5008 // Time weighted notional position for the party and asset. 5009 string time_weighted_notional_position = 5; 5010 // Vega time of the block in which the last position update occurred. 5011 int64 last_updated = 6; 5012 } 5013 5014 // Request to retrieve the time weighted notional position for a party and asset. 5015 // If no epoch is given, the time weighted notional position at the end of the most recently completed epoch will be returned. 5016 // If an epoch is given, the time weighted notional position achieved by the end of the given epoch will be returned. 5017 message GetTimeWeightedNotionalPositionRequest { 5018 // Asset ID to filter for. 5019 string asset_id = 1; 5020 // Party ID to filter for. 5021 string party_id = 2; 5022 // Game ID to filter for. 5023 string game_id = 3; 5024 // Epoch to filter for. 5025 optional uint64 at_epoch = 4; 5026 } 5027 5028 // Response containing the time weighted notional position for a party and asset. 5029 message GetTimeWeightedNotionalPositionResponse { 5030 // Time weighted notional position for the party and asset. 5031 TimeWeightedNotionalPosition time_weighted_notional_position = 1; 5032 } 5033 5034 message ListAMMsRequest { 5035 // AMM ID to filter for. If party ID or market ID is provided, the ID filter is ignored. 5036 optional string id = 1; 5037 // Party ID to filter for. 5038 optional string party_id = 2; 5039 // Market ID to filter for. If party ID is provided, the market filter is ignored 5040 optional string market_id = 3; 5041 // Party's underlying AMM sub-account to filter for. A party's AMM sub-account will remain the 5042 // same regardless of the AMM. 5043 optional string amm_party_id = 4; 5044 // Filter for AMMs with the given status. This filter will be ignored if any of the other 5045 // filters have been set. 5046 optional vega.events.v1.AMM.Status status = 5; 5047 // Pagination controls. 5048 optional Pagination pagination = 6; 5049 // Restrict AMMs to those that are actively trading. If not set, it is treated as being false. 5050 optional bool live_only = 7; 5051 } 5052 5053 message ListAMMsResponse { 5054 // Page of AMM data and corresponding page information. 5055 AMMConnection amms = 1; 5056 } 5057 5058 message AMMConnection { 5059 // Page of AMM data and the corresponding cursors. 5060 repeated AMMEdge edges = 1; 5061 // Page information that is used for fetching further pages. 5062 PageInfo page_info = 2; 5063 } 5064 5065 message AMMEdge { 5066 // AMM pool data. 5067 vega.events.v1.AMM node = 1; 5068 // Cursor that can be used to fetch further pages. 5069 string cursor = 2; 5070 } 5071 5072 message EstimateAMMBoundsRequest { 5073 // Base price of the AMM pool, the price is an integer, for example `123456` is a correctly 5074 // formatted price of `1.23456` assuming market configured to 5 decimal places. 5075 string base_price = 1; 5076 // Upper price of the AMM pool, the price is an integer, for example `123456` is a correctly 5077 // formatted price of `1.23456` assuming market configured to 5 decimal places. 5078 optional string upper_price = 2; 5079 // Lower price of the AMM pool, the price is an integer, for example `123456` is a correctly 5080 // formatted price of `1.23456` assuming market configured to 5 decimal places. 5081 optional string lower_price = 3; 5082 // Leverage at the upper price of the AMM pool. 5083 optional string leverage_at_upper_price = 4; 5084 // Leverage at the lower price of the AMM pool. 5085 optional string leverage_at_lower_price = 5; 5086 // Amount of the asset that the party is willing to commit to the AMM pool. 5087 string commitment_amount = 6; 5088 // Market ID to estimate the AMM for. 5089 string market_id = 7; 5090 } 5091 5092 message EstimateAMMBoundsResponse { 5093 enum AMMError { 5094 AMM_ERROR_UNSPECIFIED = 0; 5095 // Commitment is below the global limit set by the network parameter `market.amm.minCommitmentQuantum`. 5096 AMM_ERROR_COMMITMENT_BELOW_MINIMUM = 1; 5097 // AMM's lower price is too far from the base price for the given commitment resulting in too many zero volume price levels. 5098 AMM_ERROR_LOWER_BOUND_TOO_WIDE = 2; 5099 // AMM's upper price is too far from the base price for the given commitment resulting in too many zero volume price levels. 5100 AMM_ERROR_UPPER_BOUND_TOO_WIDE = 3; 5101 // AMM bounds are too wide for the given commitment resulting in too many zero volume price levels. 5102 AMM_ERROR_BOTH_BOUNDS_TOO_WIDE = 4; 5103 } 5104 5105 // Theoretical volume at the top of the upper bound. 5106 string position_size_at_upper = 1; 5107 // Theoretical volume at the top of the lower bound. 5108 string position_size_at_lower = 2; 5109 // Loss of commitment at the upper bound. 5110 string loss_on_commitment_at_upper = 3; 5111 // Loss of commitment at the lower bound. 5112 string loss_on_commitment_at_lower = 4; 5113 // Estimated price above upper bound at which the commitment will be lost. 5114 string liquidation_price_at_upper = 5; 5115 // Estimated price below the lower bound at which the commitment will be lost. 5116 string liquidation_price_at_lower = 6; 5117 // If populated the bounds could be calculated but the AMM is invalid for other reasons. 5118 optional AMMError amm_error = 7; 5119 } 5120 5121 // Request to get the current volume rebate program 5122 message GetCurrentVolumeRebateProgramRequest {} 5123 5124 // Response containing the current volume rebate program 5125 message GetCurrentVolumeRebateProgramResponse { 5126 // Volume discount program currently activated on the network. 5127 VolumeRebateProgram current_volume_rebate_program = 1; 5128 } 5129 5130 // Request to get the volume rebate statistics for a given epoch. 5131 message GetVolumeRebateStatsRequest { 5132 // Epoch to get volume rebate statistics for. If not set, last epoch is used. 5133 optional uint64 at_epoch = 1; 5134 // Restrict volume discount statistics to those for the given party. 5135 optional string party_id = 2; 5136 // Pagination controls. 5137 optional Pagination pagination = 3; 5138 } 5139 5140 // Response containing the volume rebate statistics for the given epoch. 5141 message GetVolumeRebateStatsResponse { 5142 // Volume rebate statistics for an epoch. 5143 VolumeRebateStatsConnection stats = 1; 5144 } 5145 5146 // Page of volume rebate stats data and corresponding page information. 5147 message VolumeRebateStatsConnection { 5148 // Page of volume rebate statistics data and their corresponding cursors. 5149 repeated VolumeRebateStatsEdge edges = 1; 5150 // Page information that is used for fetching further pages. 5151 PageInfo page_info = 2; 5152 } 5153 5154 // Volume rebate stats data with the corresponding cursor. 5155 message VolumeRebateStatsEdge { 5156 // Volume rebate stats data. 5157 VolumeRebateStats node = 1; 5158 // Cursor that can be used to fetch further pages. 5159 string cursor = 2; 5160 } 5161 5162 // Volume discount statistics for a given epoch for all parties. 5163 message VolumeRebateStats { 5164 // Epoch at which the statistics apply. 5165 uint64 at_epoch = 1; 5166 // Party ID for which the statistics apply. 5167 string party_id = 2; 5168 // Rebate factor applied given the party's running volume fracation. 5169 string additional_maker_rebate = 3; 5170 // The party's volume fraction. 5171 string maker_volume_fraction = 4; 5172 // The party's total maker fees received over the relevant window. 5173 string maker_fees_received = 5; 5174 } 5175 5176 // Volume rebate program details. 5177 message VolumeRebateProgram { 5178 // Incremental version of the program. It is incremented after each program 5179 // update. 5180 uint64 version = 1; 5181 // Unique ID generated from the proposal that created this program. 5182 string id = 2; 5183 // Defined benefit tiers ordered by increasing discounts. Determines the level of 5184 // benefit a party can expect based on performance criteria. 5185 repeated vega.VolumeRebateBenefitTier benefit_tiers = 3; 5186 // Timestamp in Unix nanoseconds, after which when the current epoch 5187 // ends, the program will end and benefits will be disabled. 5188 int64 end_of_program_timestamp = 4; 5189 // Number of epochs over which a volume discount statistics' running volume is evaluated. 5190 uint64 window_length = 5; 5191 // Timestamp in Unix nanoseconds, at which the program ended. 5192 optional int64 ended_at = 6; 5193 } 5194 5195 message GetPartyDiscountStatsRequest { 5196 // The party ID. 5197 string party_id = 1; 5198 // list of market IDs to include in the response. 5199 repeated string market_ids = 2; 5200 } 5201 5202 message GetPartyDiscountStatsResponse { 5203 // The tier number for the volume discount program the party is in. 5204 uint64 volume_discount_tier = 1; 5205 // The tier number for referencing the current volume rebate tier. 5206 uint64 volume_rebate_tier = 2; 5207 // The Tier number indicating the current referral discount program. 5208 uint64 referral_discount_tier = 3; 5209 // The fees and rebate per market, with and without the discounts applied. 5210 repeated MarketFees party_market_fees = 4; 5211 } 5212 5213 message MarketFees { 5214 // The market ID. 5215 string market_id = 1; 5216 // Undiscounted fees to be paid on the market. 5217 string undiscounted_taker_fee = 2; 5218 // The taker fees the party will have to pay, discounts applied. 5219 string discounted_taker_fee = 3; 5220 // Maker rebate without rewards. 5221 string base_maker_rebate = 4; 5222 // Maker rebate with the party rewards included. 5223 string user_maker_rebate = 5; 5224 }