Skip to main content
Version: mainnet (v0.71)

TradeUpdate

A trade on Vega, the result of two orders being 'matched' in the market

type TradeUpdate {
id: ID!
marketId: ID!
buyOrder: String!
sellOrder: String!
buyerId: ID!
sellerId: ID!
aggressor: Side!
price: String!
size: String!
createdAt: Timestamp!
type: TradeType!
buyerFee: TradeFee!
sellerFee: TradeFee!
buyerAuctionBatch: Int
sellerAuctionBatch: Int
}

Fields

TradeUpdate.id ● ID! non-null scalar

The hash of the trade data

TradeUpdate.marketId ● ID! non-null scalar

The market the trade occurred on

TradeUpdate.buyOrder ● String! non-null scalar

The order that bought

TradeUpdate.sellOrder ● String! non-null scalar

The order that sold

TradeUpdate.buyerId ● ID! non-null scalar

The party that bought

TradeUpdate.sellerId ● ID! non-null scalar

The party that sold

TradeUpdate.aggressor ● Side! non-null enum

The aggressor indicates whether this trade was related to a BUY or SELL

TradeUpdate.price ● String! non-null scalar

The price of the trade (probably initially the passive order price, other determination algorithms are possible though) (uint64)

TradeUpdate.size ● String! non-null scalar

The number of units traded, will always be <= the remaining size of both orders immediately before the trade (uint64)

TradeUpdate.createdAt ● Timestamp! non-null scalar

RFC3339Nano time for when the trade occurred

TradeUpdate.type ● TradeType! non-null enum

The type of trade

TradeUpdate.buyerFee ● TradeFee! non-null object

The fee paid by the buyer side of the trade

TradeUpdate.sellerFee ● TradeFee! non-null object

The fee paid by the seller side of the trade

TradeUpdate.buyerAuctionBatch ● Int scalar

The batch in which the buyer order was submitted (applies only for auction modes)

TradeUpdate.sellerAuctionBatch ● Int scalar

The batch in which the seller order was submitted (applies only for auction modes)

Returned by

trades subscription ● tradesStream subscription