/
trading_data.proto
4846 lines (4267 loc) · 182 KB
/
trading_data.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
syntax = "proto3";
package datanode.api.v2;
import "google/api/field_behavior.proto";
import "google/api/httpbody.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
import "vega/assets.proto";
import "vega/commands/v1/validator_commands.proto";
import "vega/events/v1/events.proto";
import "vega/governance.proto";
import "vega/markets.proto";
import "vega/oracle.proto";
import "vega/vega.proto";
option go_package = "code.vegaprotocol.io/vega/protos/data-node/api/v2";
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "Vega data node APIs";
version: "v0.76.0-dev";
}
schemes: [
HTTP,
HTTPS
];
host: "https://api.testnet.vega.xyz";
consumes: "application/json";
responses: {// can add more keys here to specify common errors between all endpoints, can also be overwritten per rpc call
key: "500";
value: {
description: "An internal server error";
schema: {
json_schema: {ref: ".google.rpc.Status"}
}
}
}
};
service TradingDataService {
// List accounts
//
// Get a list of accounts matching the supplied filter, including their current balances.
// If a given account has never had a balance, it will be absent from the list.
rpc ListAccounts(ListAccountsRequest) returns (ListAccountsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Accounts"};
}
// Accounts subscription
//
// Subscribe to a stream of accounts
rpc ObserveAccounts(ObserveAccountsRequest) returns (stream ObserveAccountsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Accounts"};
}
// Data node information
//
// Get information about the data node.
// Response contains a semver formatted version of the data node and the commit hash, from which the data node was built
rpc Info(InfoRequest) returns (InfoResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Node information"};
}
// Get order
//
// 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
rpc GetOrder(GetOrderRequest) returns (GetOrderResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Orders"};
}
// List orders
//
// Get a list of orders that match the given filters
rpc ListOrders(ListOrdersRequest) returns (ListOrdersResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Orders"};
}
// List order versions
//
// Get a list of all versions of an order in the order history
rpc ListOrderVersions(ListOrderVersionsRequest) returns (ListOrderVersionsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Orders"};
}
// Observe orders
//
// Subscribe to a stream of orders
rpc ObserveOrders(ObserveOrdersRequest) returns (stream ObserveOrdersResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Orders"};
}
// Get stop order
//
// 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.
// 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.
rpc GetStopOrder(GetStopOrderRequest) returns (GetStopOrderResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Orders"};
}
// List stop orders
//
// Get a list of stop orders that match the given filters
rpc ListStopOrders(ListStopOrdersRequest) returns (ListStopOrdersResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Orders"};
}
// Deprecated: List positions
//
// Get a list of positions by party's public key using cursor based pagination
// Deprecated: use ListAllPositions instead
rpc ListPositions(ListPositionsRequest) returns (ListPositionsResponse) {
option deprecated = true;
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Positions"};
}
// List positions
//
// Get a list of all of a party's positions
rpc ListAllPositions(ListAllPositionsRequest) returns (ListAllPositionsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Positions"};
}
// Observe positions
//
// Subscribe to a stream of position updates. The first messages sent through the stream will contain
// information about current positions, followed by updates to those positions.
rpc ObservePositions(ObservePositionsRequest) returns (stream ObservePositionsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Positions"};
}
// List ledger entries
//
// Get a list of ledger entries within the given date range. The date range is restricted to a maximum of 5 days.
// This query requests and sums the number of ledger entries from a given subset of accounts, specified via the 'filter' argument.
// It returns a time series - implemented as a list of AggregateLedgerEntry structs - with a row for every time
// the summed ledger entries of the set of specified accounts changes.
// Each account filter must contain no more than one party ID.
// At least one party ID must be specified in the from or to account filter.
//
// Entries can be filtered by:
// - the sending account (market ID, asset ID, account type)
// - receiving account (market ID, asset ID, account type)
// - sending AND receiving account
// - transfer type either in addition to the above filters or as a standalone option
// Note: The date range is restricted to any 5 days.
// If no start or end date is provided, only ledger entries from the last 5 days will be returned.
// 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.
// If a start date is provided but no end date, the end date will be set to 5 days after the start date.
// If no start date is provided, but the end date is, the start date will be set to 5 days before the end date.
rpc ListLedgerEntries(ListLedgerEntriesRequest) returns (ListLedgerEntriesResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Ledger entries"};
}
// Export ledger entries
//
// Export ledger entries records ledger entries to a csv file.
// May or may not contain a date range - if no date range is provided, list all records for all times.
//
// Ledger entries can be exported by:
// - export ledger entries for a single party for a given asset within a given time range
// - export ledger entries for a single party for a given asset for all times
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
rpc ExportLedgerEntries(ExportLedgerEntriesRequest) returns (stream google.api.HttpBody) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Ledger entries"};
}
// List balance changes
//
// Get a list of the changes in account balances over a period of time.
rpc ListBalanceChanges(ListBalanceChangesRequest) returns (ListBalanceChangesResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Accounts"};
}
// Get latest market data
//
// Get the latest market data for a given market
rpc GetLatestMarketData(GetLatestMarketDataRequest) returns (GetLatestMarketDataResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"};
}
// List latest market data
//
// Get a list of the latest market data for every market
rpc ListLatestMarketData(ListLatestMarketDataRequest) returns (ListLatestMarketDataResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"};
}
// Get latest market depth
//
// Get the latest market depth for a given market
rpc GetLatestMarketDepth(GetLatestMarketDepthRequest) returns (GetLatestMarketDepthResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"};
}
// Observe markets depth
//
// Subscribe to a stream of the latest market depth for a given market
rpc ObserveMarketsDepth(ObserveMarketsDepthRequest) returns (stream ObserveMarketsDepthResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"};
}
// Observe markets depth updates
//
// Subscribe to a stream of updates on market depth for a given market
rpc ObserveMarketsDepthUpdates(ObserveMarketsDepthUpdatesRequest) returns (stream ObserveMarketsDepthUpdatesResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"};
}
// Observe markets data
//
// Subscribe to a stream of data about a given market
rpc ObserveMarketsData(ObserveMarketsDataRequest) returns (stream ObserveMarketsDataResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"};
}
// Get market data history
//
// Get market data history for a market ID from between a given date range
rpc GetMarketDataHistoryByID(GetMarketDataHistoryByIDRequest) returns (GetMarketDataHistoryByIDResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"};
}
// List transfers
//
// Get a list of transfers between public keys. A valid value for public key can be one of:
// - a party ID
// - "network"
// - "0000000000000000000000000000000000000000000000000000000000000000", the public key for the global rewards account
rpc ListTransfers(ListTransfersRequest) returns (ListTransfersResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Transfers"};
}
// Get transfer by ID
//
// Get a specific transfer by ID
rpc GetTransfer(GetTransferRequest) returns (GetTransferResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Transfers"};
}
// Get network limits
//
// Get the network limits relating to asset and market creation
rpc GetNetworkLimits(GetNetworkLimitsRequest) returns (GetNetworkLimitsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"};
}
// List candle data
//
// Get a list of candle data for a given candle ID. Candle IDs can be obtained by calling list-candle-intervals
rpc ListCandleData(ListCandleDataRequest) returns (ListCandleDataResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Candles"};
}
// Observe candle data
//
// Subscribe to a stream of candle updates
rpc ObserveCandleData(ObserveCandleDataRequest) returns (stream ObserveCandleDataResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Candles"};
}
// List candle intervals
//
// Get a list of all available intervals for a given market along with the corresponding candle ID
rpc ListCandleIntervals(ListCandleIntervalsRequest) returns (ListCandleIntervalsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Candles"};
}
// List votes
//
// Get a list of votes. A party ID or a proposal ID must be provided.
rpc ListVotes(ListVotesRequest) returns (ListVotesResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Governance"};
}
// Observe votes
//
// Subscribe to a stream of votes cast on a given proposal, or by all votes made by a given party
rpc ObserveVotes(ObserveVotesRequest) returns (stream ObserveVotesResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Governance"};
}
// List ERC20 multisig signer added bundles
//
// Get a list of the signature bundles to add a particular validator to the signer list of the multisig contract
rpc ListERC20MultiSigSignerAddedBundles(ListERC20MultiSigSignerAddedBundlesRequest) returns (ListERC20MultiSigSignerAddedBundlesResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "ERC20 bridge"};
}
// List ERC20 multisig signer removed bundles
//
// Get a list of the signature bundles to remove a particular validator from signer list of the multisig contract
rpc ListERC20MultiSigSignerRemovedBundles(ListERC20MultiSigSignerRemovedBundlesRequest) returns (ListERC20MultiSigSignerRemovedBundlesResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "ERC20 bridge"};
}
// Get ERC20 list asset bundle
//
// Get the signatures bundle to allowlist an ERC20 token in the collateral bridge
rpc GetERC20ListAssetBundle(GetERC20ListAssetBundleRequest) returns (GetERC20ListAssetBundleResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "ERC20 bridge"};
}
// Get ERC20 set asset limits bundle
//
// Get the signature bundle to update the token limits. These are `maxLifetimeDeposit` and `withdrawThreshold` for a given ERC20 token that is
// already allowlisted in the collateral bridge.
rpc GetERC20SetAssetLimitsBundle(GetERC20SetAssetLimitsBundleRequest) returns (GetERC20SetAssetLimitsBundleResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "ERC20 bridge"};
}
// Get ERC20 withdrawal approval
//
// Get the signature bundle to finalise a withdrawal on Ethereum
rpc GetERC20WithdrawalApproval(GetERC20WithdrawalApprovalRequest) returns (GetERC20WithdrawalApprovalResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "ERC20 bridge"};
}
// Get last trade
//
// Get the last trade made for a given market.
rpc GetLastTrade(GetLastTradeRequest) returns (GetLastTradeResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Trades"};
}
// List trades
//
// Get a list of all trades, optionally filtered by party/market/order
rpc ListTrades(ListTradesRequest) returns (ListTradesResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Trades"};
}
// Observe trades
//
// Subscribe to a stream of trades, optionally filtered by party/market
rpc ObserveTrades(ObserveTradesRequest) returns (stream ObserveTradesResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Trades"};
}
// Get oracle spec
//
// Get an oracle spec by ID. Oracle spec IDs can be found by querying markets that use them as a data source
rpc GetOracleSpec(GetOracleSpecRequest) returns (GetOracleSpecResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Data sources"};
}
// List oracle specs
//
// Get a list of all oracles specs that are defined against all markets
rpc ListOracleSpecs(ListOracleSpecsRequest) returns (ListOracleSpecsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Data sources"};
}
// List oracle data
//
// Get a list of all oracle data that have been broadcast to any market
rpc ListOracleData(ListOracleDataRequest) returns (ListOracleDataResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Data sources"};
}
// Get market
//
// Get information about a specific market using its ID. A market's ID will be the same as the ID of the proposal that
// generated it
rpc GetMarket(GetMarketRequest) returns (GetMarketResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"};
}
// List markets
//
// Get a list of markets
rpc ListMarkets(ListMarketsRequest) returns (ListMarketsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"};
}
// List successor markets
//
// Given a market ID, return the full lineage of markets since inception, or all successor markets since and including
// the given market ID. The markets will be returned in succession order, i.e. the market at position i will be the parent
// of the market at position i+1.
rpc ListSuccessorMarkets(ListSuccessorMarketsRequest) returns (ListSuccessorMarketsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"};
}
// Get party
//
// Get a single party
rpc GetParty(GetPartyRequest) returns (GetPartyResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Parties"};
}
// List parties
//
// Get a list of parties
rpc ListParties(ListPartiesRequest) returns (ListPartiesResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Parties"};
}
// List parties' profiles
//
// Get a list of profiles for multiple parties
rpc ListPartiesProfiles(ListPartiesProfilesRequest) returns (ListPartiesProfilesResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Parties"};
}
// List margin levels
//
// Get a list of margin levels that match the provided criteria. If no filter is provided, all margin levels will be returned.
rpc ListMarginLevels(ListMarginLevelsRequest) returns (ListMarginLevelsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Margin"};
}
// Observe margin levels
//
// Subscribe to a stream of margin levels updates
rpc ObserveMarginLevels(ObserveMarginLevelsRequest) returns (stream ObserveMarginLevelsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Margin"};
}
// List rewards
//
// Get a list of rewards that match the provided criteria. If no filter is provided, all rewards will be returned.
rpc ListRewards(ListRewardsRequest) returns (ListRewardsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Rewards"};
}
// List reward summaries
//
// Get a list of reward summaries where the reward amount is the total rewards received over all epochs
// per party ID and asset ID.
// Request parameters are optional party ID and asset ID.
// If no data is provided, all reward summaries will be returned grouped by party and asset ID.
rpc ListRewardSummaries(ListRewardSummariesRequest) returns (ListRewardSummariesResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Rewards"};
}
// List epoch reward summaries
//
// Get a list of reward summaries by epoch for a given range of epochs.
// The result is filtered by a list of asset IDs, market IDs and starting and ending epochs, for which to return rewards.
// If no data is provided, all reward summaries will be returned, grouped by epochs, market IDs, asset IDs and reward type.
rpc ListEpochRewardSummaries(ListEpochRewardSummariesRequest) returns (ListEpochRewardSummariesResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Rewards"};
}
// Get deposit
//
// Get a deposit by its ID
rpc GetDeposit(GetDepositRequest) returns (GetDepositResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Assets"};
}
// List deposits
//
// Get a list of deposits for a given party.
// If a date range is provided, filtering will be based on the last time the deposit
// has been updated in Vega time.
rpc ListDeposits(ListDepositsRequest) returns (ListDepositsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Assets"};
}
// Get withdrawal
//
// 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
rpc GetWithdrawal(GetWithdrawalRequest) returns (GetWithdrawalResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Assets"};
}
// List withdrawals
//
// Get a list of withdrawals for a given party
rpc ListWithdrawals(ListWithdrawalsRequest) returns (ListWithdrawalsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Assets"};
}
// Get asset
//
// Get a single asset using its ID. Use the assets list query to get an asset's ID
rpc GetAsset(GetAssetRequest) returns (GetAssetResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Assets"};
}
// List assets
//
// Get a list of assets available on the Vega network
rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Assets"};
}
// List liquidity provisions
//
// DEPRECATED: When a liquidity provider amends a provision, and it's accepted by the network, the pending
// provision is returned by the API instead of the provision that is currently active.
// Use ListAllLiquidityProvisions instead.
rpc ListLiquidityProvisions(ListLiquidityProvisionsRequest) returns (ListLiquidityProvisionsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Liquidity"};
option deprecated = true;
}
// List liquidity provisions
//
// Get a list of liquidity provisions for a given market. This API returns a current and pending liquidity provision
// in the event that a provision has been updated by the provider but the updated provision will not be active until the next epoch.
rpc ListAllLiquidityProvisions(ListAllLiquidityProvisionsRequest) returns (ListAllLiquidityProvisionsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Liquidity"};
}
// Observe liquidity provisions
//
// Subscribe to a stream of liquidity provision events for a given market and party
rpc ObserveLiquidityProvisions(ObserveLiquidityProvisionsRequest) returns (stream ObserveLiquidityProvisionsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Liquidity"};
}
// List liquidity providers data
//
// List information about active liquidity provider(s) for a given market, or liquidity provider's party ID.
rpc ListLiquidityProviders(ListLiquidityProvidersRequest) returns (ListLiquidityProvidersResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Liquidity"};
}
// List paid liquidity fees data
//
// List information about paid liquidity fees for a given market, or asset ID.
rpc ListPaidLiquidityFees(ListPaidLiquidityFeesRequest) returns (ListPaidLiquidityFeesResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Liquidity"};
}
// Get governance data
//
// Get a single proposal's details either by proposal ID or by reference
rpc GetGovernanceData(GetGovernanceDataRequest) returns (GetGovernanceDataResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Governance"};
}
// List governance data
//
// Get a list of proposals
rpc ListGovernanceData(ListGovernanceDataRequest) returns (ListGovernanceDataResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Governance"};
}
// Observe governance
//
// Subscribe to a stream of updates to governance proposals
rpc ObserveGovernance(ObserveGovernanceRequest) returns (stream ObserveGovernanceResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Governance"};
}
// List delegations
//
// Get a list of the token delegations on the network
rpc ListDelegations(ListDelegationsRequest) returns (ListDelegationsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"};
}
// Get network data
//
// Get data regarding the nodes of the network
rpc GetNetworkData(GetNetworkDataRequest) returns (GetNetworkDataResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"};
}
// Get node
//
// Get information about a given node
rpc GetNode(GetNodeRequest) returns (GetNodeResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"};
}
// List nodes
//
// Get a list of the nodes on the network along with the related information.
rpc ListNodes(ListNodesRequest) returns (ListNodesResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"};
}
// List node signatures
//
// Get a list of aggregate signatures from all the nodes of the network
rpc ListNodeSignatures(ListNodeSignaturesRequest) returns (ListNodeSignaturesResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "ERC20 bridge"};
}
// Get epoch
//
// Get data for a specific epoch, if ID is omitted, it retrieves the current epoch
rpc GetEpoch(GetEpochRequest) returns (GetEpochResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"};
}
// Estimate fee
//
// Estimate the fee that would be incurred for submitting an order
// with the specified price and size on the market.
rpc EstimateFee(EstimateFeeRequest) returns (EstimateFeeResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Orders"};
}
// Estimate margin
//
// Estimate the margin that would be required for submitting this order
rpc EstimateMargin(EstimateMarginRequest) returns (EstimateMarginResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Orders"};
option deprecated = true;
}
// Estimate position
//
// 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.
// Margin estimates are scaled to asset decimal places.
// 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.
rpc EstimatePosition(EstimatePositionRequest) returns (EstimatePositionResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Positions"};
}
// List network parameters
//
// Get a list of the network parameter keys and their values
rpc ListNetworkParameters(ListNetworkParametersRequest) returns (ListNetworkParametersResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"};
}
// Get network parameter
//
// Get a network parameter's value by its key
rpc GetNetworkParameter(GetNetworkParameterRequest) returns (GetNetworkParameterResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"};
}
// List checkpoints
//
// Get a list of information about checkpoints generated by the network
rpc ListCheckpoints(ListCheckpointsRequest) returns (ListCheckpointsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"};
}
// Get stake
//
// Get staking information for a given party
rpc GetStake(GetStakeRequest) returns (GetStakeResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"};
}
// Get risk factors
//
// Get risk factor data for a given market
rpc GetRiskFactors(GetRiskFactorsRequest) returns (GetRiskFactorsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"};
}
// Observe event bus
//
// Subscribe to a stream of events from the core
rpc ObserveEventBus(stream ObserveEventBusRequest) returns (stream ObserveEventBusResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Events"};
}
// Observe ledger movements
//
// Subscribe to a stream of transfer responses
rpc ObserveLedgerMovements(ObserveLedgerMovementsRequest) returns (stream ObserveLedgerMovementsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Ledger movements"};
}
// List key rotations
//
// Get a list of information about Vega key rotations that have been performed by validator nodes
rpc ListKeyRotations(ListKeyRotationsRequest) returns (ListKeyRotationsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"};
}
// List Ethereum key rotations
//
// Get a list of information about Ethereum key rotations that have been performed by validator nodes
rpc ListEthereumKeyRotations(ListEthereumKeyRotationsRequest) returns (ListEthereumKeyRotationsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"};
}
// Get Vega time
//
// Get the current time of the network in Unix nanoseconds
rpc GetVegaTime(GetVegaTimeRequest) returns (GetVegaTimeResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"};
}
// Get protocol upgrade status
//
// Get status of a protocol upgrade
rpc GetProtocolUpgradeStatus(GetProtocolUpgradeStatusRequest) returns (GetProtocolUpgradeStatusResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"};
}
// List protocol upgrade proposals
//
// Get a list of protocol upgrade proposals, optionally filtering on status or approver.
rpc ListProtocolUpgradeProposals(ListProtocolUpgradeProposalsRequest) returns (ListProtocolUpgradeProposalsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"};
}
// List snapshots
//
// Get a list of core snapshots taken
rpc ListCoreSnapshots(ListCoreSnapshotsRequest) returns (ListCoreSnapshotsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network"};
}
// Network History
//
// Network history allows the data node to reach out to peer nodes and fetch the most recent history, as well as
// older history if desired, such that it can quickly get itself up to the latest block height of the network and start
// to consume events for the latest block from the Vega core.
// See https://github.com/vegaprotocol/vega/tree/develop/datanode/networkhistory/README.md for a full description of network history
// Get most recent network history segment
//
// Get the network's most recently history segment
rpc GetMostRecentNetworkHistorySegment(GetMostRecentNetworkHistorySegmentRequest) returns (GetMostRecentNetworkHistorySegmentResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network history"};
}
// List all network history segments
//
// Get a list of all history segments stored by the data node currently connected to
rpc ListAllNetworkHistorySegments(ListAllNetworkHistorySegmentsRequest) returns (ListAllNetworkHistorySegmentsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network history"};
}
// Get active network history peer addresses
//
// Get a list of the addresses of all active network history peers
rpc GetActiveNetworkHistoryPeerAddresses(GetActiveNetworkHistoryPeerAddressesRequest) returns (GetActiveNetworkHistoryPeerAddressesResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network history"};
}
// Network history status
//
// Get information about the current state of network history's IPFS swarm
rpc GetNetworkHistoryStatus(GetNetworkHistoryStatusRequest) returns (GetNetworkHistoryStatusResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network history"};
}
// Network history bootstrap peers
//
// Get a list of IPFS peers that can be used to initialise a new data node with network history
rpc GetNetworkHistoryBootstrapPeers(GetNetworkHistoryBootstrapPeersRequest) returns (GetNetworkHistoryBootstrapPeersResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Network history"};
}
// List entities
//
// Get a list of all entities created by transaction hash
rpc ListEntities(ListEntitiesRequest) returns (ListEntitiesResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Explorer"};
}
// List funding periods
//
// Get a list of funding periods for a perpetual market.
rpc ListFundingPeriods(ListFundingPeriodsRequest) returns (ListFundingPeriodsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"};
}
// List funding period data points
//
// Get a list of data points for a perpetual market's funding periods.
rpc ListFundingPeriodDataPoints(ListFundingPeriodDataPointsRequest) returns (ListFundingPeriodDataPointsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"};
}
// List funding payments
//
// 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
// period ends.
rpc ListFundingPayments(ListFundingPaymentsRequest) returns (ListFundingPaymentsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Markets"};
}
// List party activity streak
//
// Get a party's activity across epochs.
rpc GetPartyActivityStreak(GetPartyActivityStreakRequest) returns (GetPartyActivityStreakResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Referral program"};
}
// Get current referral program
//
// Get the current referral program for the network. This program may not be active if it has ended
// and has not been replaced by another.
rpc GetCurrentReferralProgram(GetCurrentReferralProgramRequest) returns (GetCurrentReferralProgramResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Referral program"};
}
// List referral sets
//
// List all referral sets, or a specific referral set if you know its ID.
rpc ListReferralSets(ListReferralSetsRequest) returns (ListReferralSetsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Referral program"};
}
// List referral set referees
//
// List all referees that belong to a referral set.
rpc ListReferralSetReferees(ListReferralSetRefereesRequest) returns (ListReferralSetRefereesResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Referral program"};
}
// Get referral set statistics
//
// Get the total taker volume, and each referee's taker volume and, reward and discount factors for a referral set
// at the latest or a specific epoch. You can also optionally filter for a specific referee's statistics.
rpc GetReferralSetStats(GetReferralSetStatsRequest) returns (GetReferralSetStatsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Referral program"};
}
// List teams
//
// Get a list of all teams, or for a specific team by using team ID, or party ID of a referrer or referee
rpc ListTeams(ListTeamsRequest) returns (ListTeamsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Teams"};
}
// List teams statistics
//
// Get the statistics of all teams, or for a specific team by using team ID, over a number of epochs.
// If a team does not have at least the number of epochs' worth of data, it is ignored.
rpc ListTeamsStatistics(ListTeamsStatisticsRequest) returns (ListTeamsStatisticsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Teams"};
}
// List team members' statistics
//
// Get the statistics for all members of a given team, or for a specific member by using party ID, over a number of epochs.
// If a team does not have at least the number of epochs' worth of data, it is ignored.
rpc ListTeamMembersStatistics(ListTeamMembersStatisticsRequest) returns (ListTeamMembersStatisticsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Teams"};
}
// List team referees
//
// Get a list of all referees for a given team ID
rpc ListTeamReferees(ListTeamRefereesRequest) returns (ListTeamRefereesResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Teams"};
}
// List referee team history
//
// 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.
rpc ListTeamRefereeHistory(ListTeamRefereeHistoryRequest) returns (ListTeamRefereeHistoryResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Teams"};
}
// Get fees statistics
//
// Get accumulated fees, rewards, and applied discount information. Either a market or an asset must be supplied as a filter.
rpc GetFeesStats(GetFeesStatsRequest) returns (GetFeesStatsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Fees"};
}
// Get fees statistics for a party
//
// Get accumulated fees, rewards, and applied discount information. A party ID must be supplied as a filter.
rpc GetFeesStatsForParty(GetFeesStatsForPartyRequest) returns (GetFeesStatsForPartyResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Fees"};
}
// Get current volume discount program
//
// Get the current volume discount program for the network. This program may not be active if it has ended
// and has not been replaced by another.
rpc GetCurrentVolumeDiscountProgram(GetCurrentVolumeDiscountProgramRequest) returns (GetCurrentVolumeDiscountProgramResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Volume discount program"};
}
// Get volume discount statistics
//
// Get the information about a party's running traded volume, and the discount factor it earns them.
rpc GetVolumeDiscountStats(GetVolumeDiscountStatsRequest) returns (GetVolumeDiscountStatsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Volume discount program"};
}
// Get vesting balances summary
//
// Get information about a party's vesting and locked balances
rpc GetVestingBalancesSummary(GetVestingBalancesSummaryRequest) returns (GetVestingBalancesSummaryResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Vesting"};
}
// Get vesting balance statistics
//
// Get information about a party's vesting rewards
rpc GetPartyVestingStats(GetPartyVestingStatsRequest) returns (GetPartyVestingStatsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Vesting"};
}
// Observe transaction results
//
// Subscribe to a stream of transaction results, optionally filtered by party/hash/status
rpc ObserveTransactionResults(ObserveTransactionResultsRequest) returns (stream ObserveTransactionResultsResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Transaction results"};
}
// Estimate transfer fee costs
//
// Estimate transfer fee costs with potential discount applied
rpc EstimateTransferFee(EstimateTransferFeeRequest) returns (EstimateTransferFeeResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Transfers"};
}
// Available transfer fee discount
//
// Returns available per party per asset transfer discount
rpc GetTotalTransferFeeDiscount(GetTotalTransferFeeDiscountRequest) returns (GetTotalTransferFeeDiscountResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Transfers"};
}
// List games
//
// Get a list of games and corresponding game data, given the provided filters
rpc ListGames(ListGamesRequest) returns (ListGamesResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Games"};
}
// List margin modes per party per market
//
// Get a list of all margin modes, or for a specific market ID, or party ID.
rpc ListPartyMarginModes(ListPartyMarginModesRequest) returns (ListPartyMarginModesResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Margin"};
}
// Get time weighted notional position
//
// Get the time weighted notional position for a given party and asset. The time weighted notional position
// is used to check if a party qualifies for a reward.
// If no epoch is specified, the final time weighted notional position from the end of the most recently completed epoch is returned.
// If an epoch is specified, the final time weighted notional position at that epoch is returned.
rpc GetTimeWeightedNotionalPosition(GetTimeWeightedNotionalPositionRequest) returns (GetTimeWeightedNotionalPositionResponse) {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Positions"};
}
// Export network history as CSV
//
// Export CSV table data from network history between two block heights.
//
// The requested block heights must fall on network history segment boundaries, which can
// be discovered by calling the API to list all network history segments. By default
// segments contain 1000 blocks. In that case ranges such as (1, 1000), (1001, 2000), (1, 3000)
// would all fall on segment boundaries and be valid.
//
// The generated CSV file is compressed into a ZIP file and returned, with the file name
// in the following format: `[chain id]-[table name]-[start block]-[end block].zip`
//
// In gRPC, results are returned in a chunked stream of base64 encoded data.
//
// Through the REST gateway, the base64 data chunks are decoded and streamed as a
// `content-type: application/zip` HTTP response.
//
// The CSV exported data uses a comma as a DELIMITER between fields, and " for QUOTE-ing fields.
//
// If a value contains any of: DELIMITER, QUOTE, carriage return, or line feed then the whole
// value is prefixed and suffixed by the QUOTE character and any occurrence within
// the value of a QUOTE character preceded by another QUOTE.
//
// A NULL is output as the NULL parameter string and is not quoted, while a non-NULL value
// matching the NULL parameter string is quoted.
//
// For example, with the default settings, a NULL is written as an unquoted empty string,
// while an empty string data value is written with double quotes.
//
// Note that CSV files produced may contain quoted values containing embedded carriage returns and line feeds.
// Thus the files are not strictly one line per table row like text-format files.
//
// The first row of the CSV file is a header that describes the contents of each column
// in subsequent rows.
//
// Usually the ZIP file will contain only a single CSV file. However it is possible that
// the (from_block, to_block) request spans over a range of blocks in which the underlying
// schema of the database changes. For example, a column may have been added, removed, or renamed.
//
// If this happens, the CSV file will be split at the point of the schema change and the zip
// file will contain multiple CSV files, with a potentially different set of headers. The
// 'version' number of the database schema is part of the in the CSV filename:
//
// `[chain id]-[table name]-[schema version]-[start block]-[end block].zip`
//
// For example, a zip file might be called mainnet-sometable-000001-003000.zip
//
// And contain two CSV files: `mainnet-sometable-1-000001-002000.csv`:
//
// timestamp, value
// 1, foo
// 2, bar
//
// And `mainnet-sometable-2-002001-003000.csv`:
//
// timestamp, value, extra_value
// 3, baz, apple
//
// It is worth noting that the schema will not change within a single network history segment.
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE