Swaps Data

If you are interested in a particular transaction or swap you can query them with the following example queries This is the reference for the full swap schema.

Get latest Swaps from Token

You can query for the latest swaps from a token by setting the where field to the token contract address.

This example query fetches multiple swap data about the sender, amounts, timestamp and transaction data for the DAKS token.

{
swaps(orderBy: timestamp, orderDirection: desc, where:
 { token: "0x6f38e0f1a73c96cb3f42598613ea3474f09cb200" }
  ) {
   id
    token {
      id
      symbol
    }
    base {
      id
      symbol
    }
    sender
    amountToken
    amountBase
    amountUSD
    timestamp
    transaction {
      id
      blockNumber
      gasUsed
      gasPrice
    }
  }
}

General Swap Data by Id

To query data about a particular swap, input the transaction hash + "-" + the index in the swaps transaction array as id ( or use an id from the latest swaps query response).

{
swaps(id: "0x7953dc2cdb8a27cbc5aa04002eca387368ea0aa0c06a46fca69e595a9ea333b7-70" ) {
  id
  token {
    id
    symbol
  }
  base {
    id
    symbol
  }
  sender
  amountToken
  amountBase
  amountUSD
  timestamp
  transaction {
    id
    blocknumber
    gasUsed
    gasPrice
 }
}

Last updated