Observe trades
GET/api/v2/stream/trades
Subscribe to a stream of trades, optionally filtered by party/market
Request
Query Parameters
Restrict the trades streamed to those made on the given markets.
Restrict the trades streamed to those made by the given parties.
Responses
- 200
- 500
- default
A successful response.(streaming responses)
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- If no scheme is provided,
https
is assumed. - An HTTP GET on the URL must yield a [google.protobuf.Type][] value in binary format, or produce an error.
- Applications are allowed to cache lookup results based on the URL, or have them precompiled into a binary to avoid any lookup. Therefore, binary compatibility needs to be preserved on changes to types. (Use versioned type names to manage breaking changes.)
- ]
- Array [
- ]
error object
details object[]
A URL/resource name that uniquely identifies the type of the serialized
protocol buffer message. This string must contain at least
one "/" character. The last segment of the URL's path must represent
the fully qualified name of the type (as in
path/google.protobuf.Duration
). The name should be in a canonical form
(e.g., leading "." is not accepted).
In practice, teams usually precompile into the binary all types that they
expect it to use in the context of Any. However, for URLs which use the
scheme http
, https
, or no scheme, one can optionally set up a type
server that maps type URLs to message definitions as follows:
Note: this functionality is not currently available in the official protobuf release, and it is not used for type URLs beginning with type.googleapis.com.
Schemes other than http
, https
(or the empty scheme) might be
used with implementation specific semantics.
result object
trades object[]
List of 0 or more trades.
Possible values: [SIDE_UNSPECIFIED
, SIDE_BUY
, SIDE_SELL
]
Default value: SIDE_UNSPECIFIED
Direction of the aggressive party e.g. SIDE_BUY or SIDE_SELL.
Price for the trade using asset decimals, as opposed to market decimals used in the price field. This is only used in trade events for position updates.
Identifier of the order from the buy side.
Unique party ID for the buyer.
Auction batch number that the buy side order was placed in.
buyerFee object
Fee amount charged to the buyer party for the trade.
Fee amount paid for maintaining the Vega infrastructure. This field is an unsigned integer scaled using the asset's decimal places.
Discount on infrastructure fee for eligible referrer.
Discount on infrastructure fee based on the taker volume.
Fee amount paid to market makers. This field is an unsigned integer scaled to the asset's decimal places.
Discount on liquidity fee for eligible referrer.
Discount on liquidity fee basedo on taker volume.
Fee amount paid to the non-aggressive party of the trade. This field is an unsigned integer scaled to the asset's decimal places.
Referrer discounts. Discount on maker fee for eligible referrer.
Volume discounts. Discount on maker fee based on the taker volume.
Unique ID for the trade.
Market ID on which the trade occurred.
Price for the trade, the price is an integer, for example 123456
is a correctly
formatted price of 1.23456
assuming market configured to 5 decimal places.
Identifier of the order from the sell side.
Unique party ID for the seller.
Auction batch number that the sell side order was placed in.
sellerFee object
Fee amount charged to the seller party for the trade.
Fee amount paid for maintaining the Vega infrastructure. This field is an unsigned integer scaled using the asset's decimal places.
Discount on infrastructure fee for eligible referrer.
Discount on infrastructure fee based on the taker volume.
Fee amount paid to market makers. This field is an unsigned integer scaled to the asset's decimal places.
Discount on liquidity fee for eligible referrer.
Discount on liquidity fee basedo on taker volume.
Fee amount paid to the non-aggressive party of the trade. This field is an unsigned integer scaled to the asset's decimal places.
Referrer discounts. Discount on maker fee for eligible referrer.
Volume discounts. Discount on maker fee based on the taker volume.
Size filled for the trade.
Timestamp in Unix nanoseconds for when the trade occurred.
Possible values: [TYPE_UNSPECIFIED
, TYPE_DEFAULT
, TYPE_NETWORK_CLOSE_OUT_GOOD
, TYPE_NETWORK_CLOSE_OUT_BAD
]
Default value: TYPE_UNSPECIFIED
Type for the trade.
{
"error": {
"code": 0,
"details": [
{
"@type": "string"
}
],
"message": "string"
},
"result": {
"trades": [
{
"aggressor": "SIDE_UNSPECIFIED",
"assetPrice": "string",
"buyOrder": "string",
"buyer": "string",
"buyerAuctionBatch": "string",
"buyerFee": {
"infrastructureFee": "string",
"infrastructureFeeReferrerDiscount": "string",
"infrastructureFeeVolumeDiscount": "string",
"liquidityFee": "string",
"liquidityFeeReferrerDiscount": "string",
"liquidityFeeVolumeDiscount": "string",
"makerFee": "string",
"makerFeeReferrerDiscount": "string",
"makerFeeVolumeDiscount": "string"
},
"id": "string",
"marketId": "string",
"price": "string",
"sellOrder": "string",
"seller": "string",
"sellerAuctionBatch": "string",
"sellerFee": {
"infrastructureFee": "string",
"infrastructureFeeReferrerDiscount": "string",
"infrastructureFeeVolumeDiscount": "string",
"liquidityFee": "string",
"liquidityFeeReferrerDiscount": "string",
"liquidityFeeVolumeDiscount": "string",
"makerFee": "string",
"makerFeeReferrerDiscount": "string",
"makerFeeVolumeDiscount": "string"
},
"size": "string",
"timestamp": "string",
"type": "TYPE_UNSPECIFIED"
}
]
}
}
An internal server error
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- If no scheme is provided,
https
is assumed. - An HTTP GET on the URL must yield a [google.protobuf.Type][] value in binary format, or produce an error.
- Applications are allowed to cache lookup results based on the URL, or have them precompiled into a binary to avoid any lookup. Therefore, binary compatibility needs to be preserved on changes to types. (Use versioned type names to manage breaking changes.)
- ]
details object[]
A URL/resource name that uniquely identifies the type of the serialized
protocol buffer message. This string must contain at least
one "/" character. The last segment of the URL's path must represent
the fully qualified name of the type (as in
path/google.protobuf.Duration
). The name should be in a canonical form
(e.g., leading "." is not accepted).
In practice, teams usually precompile into the binary all types that they
expect it to use in the context of Any. However, for URLs which use the
scheme http
, https
, or no scheme, one can optionally set up a type
server that maps type URLs to message definitions as follows:
Note: this functionality is not currently available in the official protobuf release, and it is not used for type URLs beginning with type.googleapis.com.
Schemes other than http
, https
(or the empty scheme) might be
used with implementation specific semantics.
{
"code": 0,
"details": [
{
"@type": "string"
}
],
"message": "string"
}
An unexpected error response.
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- If no scheme is provided,
https
is assumed. - An HTTP GET on the URL must yield a [google.protobuf.Type][] value in binary format, or produce an error.
- Applications are allowed to cache lookup results based on the URL, or have them precompiled into a binary to avoid any lookup. Therefore, binary compatibility needs to be preserved on changes to types. (Use versioned type names to manage breaking changes.)
- ]
details object[]
A URL/resource name that uniquely identifies the type of the serialized
protocol buffer message. This string must contain at least
one "/" character. The last segment of the URL's path must represent
the fully qualified name of the type (as in
path/google.protobuf.Duration
). The name should be in a canonical form
(e.g., leading "." is not accepted).
In practice, teams usually precompile into the binary all types that they
expect it to use in the context of Any. However, for URLs which use the
scheme http
, https
, or no scheme, one can optionally set up a type
server that maps type URLs to message definitions as follows:
Note: this functionality is not currently available in the official protobuf release, and it is not used for type URLs beginning with type.googleapis.com.
Schemes other than http
, https
(or the empty scheme) might be
used with implementation specific semantics.
{
"code": 0,
"details": [
{
"@type": "string"
}
],
"message": "string"
}