Copy of Subscribe trade

Streams DEX trades on BNB Chain as they happen, where sell currency smart contract is 0x55d3…7955, buy currency smart contract is 0xbb4c…095c and buy currency smart contract is 0x55d3…7955: block time, sell buyer, sell decimal, sell currency symbol, buy price, buy decimal, buy currency symbol and sell price.

By linthertoss · saved 18 January 2023 · Bitquery API v2

What it returns

Filters

The subscription

subscription subscribeTrade($network: network!, $baseCurrency: String!, $quoteCurrency: String!) {
  EVM(network: $network) {
    buy: DEXTrades(
      Trade: {Sell: {Currency: {SmartContract: {is: $baseCurrency}}}, Buy: {Currency: {SmartContract: {is: $quoteCurrency}}}}
      
    ) {
      Block {
        Time
      }
      Trade {
        Sell {
          Buyer
          Amount {
            Decimal
          }
          Currency {
            Symbol
          }
        }
        Buy {
          Price
          Amount {
            Decimal
          }
          Currency {
            Symbol
          }
        }
      }
    }
    sell: DEXTrades(
      Trade: {Buy: {Currency: {SmartContract: {is: $baseCurrency}}}, Sell: {Currency: {SmartContract: {is: $quoteCurrency}}}}
     
    ) {
      Block {
        Time
      }
      Trade {
        Sell {
          Price
          Buyer
          Amount {
            Decimal
          }
          Currency {
            Symbol
          }
        }
        Buy {
          Amount {
            Decimal
          }
          Currency {
            Symbol
          }
        }
      }
    }
  }
}

Variables

{
  "network": "bsc",
  "baseCurrency": "0x55d398326f99059ff775485246999027b3197955",
  "quoteCurrency": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"
}

Similar queries