Skip to main content Link Search Menu Expand Document (external link)

MakerDojo exposes unified hierarchical schema, making to easy to work with the data as well as allowing for cross-chain queriying capabilities. Naming convention for data on our platform is as follows: [chain/source].[namespace].[table].[column]. For example, ethereum.core.blocks.number refers to the number columns in Ethereum blocks table.

Source

This is the top level container for the dataset. This could be the name of the chain or the external data source being used. Common sources that are currently supported:

  • Celo
  • Ethereum (Coming Soon)
  • Polygon (Coming Soon)

Namespace

On MakerDojo, related tables are grouped into namespaces. These namespaces will be common across most of the data sources though there could be some deviations. Current common namespaces are

core

Raw imports from the blockchain or the external data source is captured in this namespace

enriched

Tables in this namespace represent processed data. This could be enriched data, materialized views etc.

Tables

Namespaces contain related tables holding our data in rows

Columns

These represent the dimension of the data being stored in the table

Following is the hierarchical structure for the tables, namespaces and their sources

├── Celo
│   ├── core
│   │   ├── blocks
│   │   ├── transactions
│   │   └── logs
│   └── enriched
│       ├── tokens
│       ├── token_transfers
│       ├── events
│       ├── prices
│       ├── dex_trades
│       └── exchange_pools
│
├── Ethereunm (Coming Soon!)
└── Polygon   (Coming Soon!)

Find below the details of individual tables and the columns from each of the top level sources

Celo

core

blocks

Name Type Description
sha3_uncles varchar Combined hash of all uncles for this block’s parent
gas_used bigdecimal Total gas used by the block
transaction_count integer The number of transactions in this block
receipts_root varchar Trie root of all the receipts in the block
total_difficulty integer Total difficulty of the chain until this block
nonce varchar Nonce is used to demonstrate the proof of work during mining
miner varchar The address of the miner
difficulty integer The effort required to mine the block
number bigint Position of the block within the chain
logs_bloom varchar Logs bloom of all the logs included in all the transactions of the block
gas_limit bigdecimal The gas limit of the current block
size integer This block’s size in bytes (limited by gas limit)
extra_data varchar Arbitrary additional data as raw bytes
time timestamp(3) The time when the block was mined
transactions_root varchar Trie root of all the transactions in the block
hash varchar The SHA256 hash of this block
parent_hash varchar The hash of the prior block
state_root varchar The root hash of the state object

transactions

Name Type Description
effective_gas_price bigdecimal The gas price this transaction paid in wei
gas_used bigdecimal The gas consumed by the transaction in wei
index integer The transactions index position in the block
block_number bigint The position of block in the blockchain in blocks
block_hash varchar A unique identifier for that block
to_address varchar Address of the receiver. null when its a contract creation transaction
transaction_type integer The type of the transaction introduced in EIP-2178
nonce bigint The transaction nonce, unique to that wallet
block_time timestamp(3) The time when the block was mined that includes this transaction
input varchar Serialized string representing the smart contract call with arguments
max_priority_fee_per_gas bigdecimal The maximum amount of gas to be included as a tip to the validator
created_contract_address varchar Adress of the newly created contracts. Null except for deployments
max_fee_per_gas bigdecimal The maximum amount of gas willing to be paid for the transaction
from_address varchar Address of the sender
receipt_root varchar Hash of the root of the trie that contains the receipts
value bigdecimal The amount of Eth sent in this transaction in wei.
hash varchar Hash of the transaction
cumulative_gas_used bigdecimal Gas used up until the transaction in the mined block
status boolean Status of the transaction. Accepted, Rejected (Error) or Pending

logs

Name Type Description
block_number bigint The number of the mined block that includes this log
block_time timestamp(3) The time when the block was mined that includes this log
address varchar Adress of the contract that emitted this log
topic1 varchar keccack256 hash of a flattened event declaration string in ABI
topic2 varchar First indexed topic of the event
topic3 varchar Second indexed topic of the event
topic4 varchar Third indexed topic of the event
topics array(varchar) All topics represented in array with topic1 at index 0 and so on
data varchar Concatenated string of all non indexed params of the event
index integer Position of this log in the block
transaction_index integer Position of the transaction in the block
transaction_hash varchar The hash of the transaction that produced this log

enriched

tokens

Name Type Description
block_time timestamp(3) The time at which the block containing token creation got mined
symbol varchar The symbol of the token
address varchar Address of the token
is_erc721 boolean True if the token is ERC-721
is_erc1155 boolean True if the token is ERC-1155
total_supply bigdecimal Total supply of the available tokens at the block_time
is_erc20 boolean True if the token is ERC-20
decimals integer The Number of decimals token uses
name varchar Name of the token
id bigdecimal Uniq identifier for the token. Applicable for NFTs
uri varchar The distinct URI for this token
transaction_hash varchar Hash of the transaction in which this token got created

events

Name Type Description
block_number bigint Number of the mind block containing this transfer
event_name varchar Name of the event
contract_name varchar Name of the contract that emitted the event
transaction_index integer Index of the transaction within the mined block
contract_address varchar Address of the contract that emitted the event
log_index integer Index of the log amongst all the logs emitted by the transaction
transaction_hash varchar Hash of the transaction that contains the emitted event
parsed_args json Topics and Data of the event parsed into JSON with correct names and format

token_transfers

Name Type Description
transaction_status boolean Status of the transaction. Accepted, Rejected (Error) or Pending
is_erc721 boolean True if the token is ERC-721
block_number bigint Number of the mind block containing this transfer
token_address varchar Address of the token
to_address varchar Address of the receiver
log_index integer Position of this log in the block
erc1155_tokenid bigint Id of the token, if token is ERC-1155
block_time timestamp(3) Time of the mined block
token_transfer_index integer Index of the transfer in case of a batch transfer
is_erc1155 boolean True if the token is ERC-1155
erc1155_operator varchar The address of an account/contract that is approved to make the transfer
is_erc20 boolean True if the token is ERC-20
token_name varchar Name of the token
token_decimals integer Decimals used by the token
transaction_from_address varchar Initator of the transaction in which this token transfer happened
token_symbol varchar Symbol of the token
transaction_value bigdecimal Value of the transaction in which this token transfer happened
from_address varchar Receiver of the token
value bigdecimal Amount of tokens transferred. For NFTs, this would be tokenId
transaction_hash varchar Hash of the transaction in which the transfer happened
transaction_to_address varchar Receiver of the transaction in which the transfer happened

dex_trades

Name Type Description
token0_amount bigdecimal Amount of Token0 that got swapped
block_number bigint Number of the mined block in which the swap happened
transaction_index integer Index of the transaction in the mined block
log_index integer Index of the event within the transaction
pool_address varchar Address of the pool on which the swap happened
block_time timestamp(3) Time of the mined block
token1_address varchar Address of Token1
sender varchar Address of the sender of the transaction that contains the trade
exchange_address varchar Address of the Exchange contract that created this pool
token1_decimals integer Decimals used by Token1
token0_address varchar Address of Token0
recipient varchar The receiving address
transaction_hash varchar Hash of the transaction in which the trade happened
token1_amount bigdecimal Address of Token1
token0_symbol varchar Symbol of Token0
token0_decimals integer Decimals used by Token1
token1_symbol varchar Address of Token1

exchange_pools

Name Type Description
block_time timestamp(3) Time of the mined block in which the pool got created
address varchar Address of the liquidity pool
exchange_address varchar Address of the Factory that created the pool
token1_address varchar Address of Token1
token1_decimals integer Decimals used by Token1
fee bigint Fee of the liquidity pool. Divide by 1e4 to get in percentage
token0_address varchar Address of Token0
transaction_hash varchar Hash of the transaction which created this pool
token0_symbol varchar Symbol of Token0
token0_decimals integer Decimals used by Token0
token1_symbol varchar Symbol of Token1

prices

Name Type Description
usd_price bigdecimal Price of the token in USD
token_address varchar The address of the token
token_symbol varchar The symbol of the token
time timestamp(3) The time at which this price is recorded
prices json Price of the token in other currencies
day varchar Average price on a given day. There will be only one row per token per day

Note: In cases you want to join on price for a given day, join on day column instead of time. We ensure that there is only one row per token per day. There can be multiple rows for a token with same date(time) (date of the timestamp) as we fetch multiple times in a given day.