Subgraphs

DODO uses Subgraphs to provide events and data related to contracts in the query chain. These subgraphs include DODOEX, vDODO, ERC20Token, DODO Mine V3.

More information on these endpoints can be found at the following link:

DODOEX V2 Subgraph Subgraph Query

Introduction #

Transaction History #

  • Each OrderHistory event is triggered by the execution of a DODOProxy contract. If the transaction is routed to a trading pool on DODO, the events triggered by the underlying pool will be ignored to prevent duplicate logging.
  • If the transaction does not come from DODOProxy, then the transaction events triggered by the underlying pool will be logged by OrderHistory.

Trading#

  • Every transaction event comes from a smart contract on the DODO platform.

Trading Pool Information #

  • Real-time pool status tracking by trading pair
  • Note that VIRTUAL type pools are pools that do not actually exist, and are created for statistical purposes only

Usage Examples#

Retrieving swap records:

{
  swaps(where:{pair:"0xc9f93163c99695c6526b799ebca2207fdf7d61ad"},first:10){
    hash
    from
    to
    fromToken{id}
    toToken{id}
    amountIn
    amountOut
  }
}

Querying user information:

{
  user(id:"0x8982a82a77eaf1cd6f490b67ad982304ecc590af"){
    id
    txCount
    tradingRewardRecieved
  }
}

Retrieving pool status by day or by hour:

{
  pairDayDatas(first:100,orderBy:date,orderDirection:desc){
    date
    volumeBase
    volumeQuote
    feeBase
    feeQuote
    baseToken{
      symbol
    }
    quoteToken{
      symbol
    }
  }
}JSON

Retrieving Crowdpooling campaign status:

{
  crowdPoolingDayDatas{
    date
    crowdPooling {
      id
      creator
      baseToken{
        symbol
      }
      quoteToken{
        symbol
      }
    }
    investedQuote
    investCount
    newcome
    poolQuote
  }
}