fragment TradeFields on Trade {
  id
  price
  size
  createdAt
  aggressor
  market {
    id
  }
}

query Trades($marketId: ID!, $pagination: Pagination) {
  market(id: $marketId) {
    id
    tradesConnection(pagination: $pagination) {
      edges {
        node {
          ...TradeFields
        }
        cursor
      }
      pageInfo {
        startCursor
        endCursor
        hasNextPage
        hasPreviousPage
      }
    }
  }
}

subscription TradesUpdate($marketId: ID!) {
  trades(marketId: $marketId) {
    id
    price
    size
    createdAt
    marketId
    aggressor
  }
}
