Schema Reference

Here you'll find a breakdown of the schemas used throughout the L3 Atom data lake. We'll provide both human-readable tables that outline what each field represents, as well as equivalent Apache Avro schemas.

Notes

  • A value of -1 indicates that the value is unknown

  • The exact format of the event_timestamp depends on the source. In our PostgreSQL database, it's a timestamp (integer for the number of milliseconds since the UNIX epoch), however over the websocket API you will be given an ISO-formatted string

    • Why? This is to give as many options to you as possible. The atom_timestamp will always a be an integer value of the number of microseconds since the UNIX epoch, but you might find it more useful to have a timestamp in an ISO format instead. Having a millisecond and microsecond timestamp also means that we can use the data in a variety of different datastores which may have different conventions for what timestmaps should be. For most people, given that the timestamps are very close, they can be used interchangeably, however there may be use cases that want to compare them (e.g. determining latency between exchanges)

  • Some exchanges don't provide an explicit event_timestamp. In those cases, we just convert the atom_timestamp into milliseconds as the next best thing. These cases will be specifically mentioned.

  • Open interest can differ wildly between exchanges. This is mainly due to inconsistencies in formatting. Some exchanges provide OI in USD, while others provide it in the base/quote token. Because of this, open interest values should most likely not be aggregated across exchanges as you may see unexpected results.

Tables

L3 Trades

L2 Trades

Ticker

L3 LOB

L2 LOB

Funding Rate

Open Interest

Candle

Ethereum Blocks

Ethereum Transactions

Ethereum Logs

Ethereum Token Transfers

Dex Trades

Dex Liquidity

Avro

L3 Trades

{
    "type": "record",
    "name": "L3_Trades",
    "namespace": "com.acme.avro",
    "fields": [
        {
            "name": "exchange",
            "type": "string"
        },
        {
            "name": "symbol",
            "type": "string"
        },
        {
            "name": "price",
            "type": "double"
        },
        {
            "name": "size",
            "type": "double"
        },
        {
            "name": "taker_side",
            "type": "string"
        },
        {
            "name": "trade_id",
            "type": "string"
        },
        {
            "name": "maker_order_id",
            "type": "string"
        },
        {
            "name": "taker_order_id",
            "type": "string"
        },
        {
            "name": "event_timestamp",
            "type": {
                "type": "long",
                "logicalType": "timestamp-millis"
            }
        },
        {
            "name": "atom_timestamp",
            "type": "long"
        }
    ]
}

L2 Trades

{
    "type": "record",
    "name": "Trade",
    "namespace": "com.acme.avro",
    "fields": [
        {
            "name": "exchange",
            "type": "string"
        },
        {
            "name": "symbol",
            "type": "string"
        },
        {
            "name": "price",
            "type": "double"
        },
        {
            "name": "size",
            "type": "double"
        },
        {
            "name": "taker_side",
            "type": "string"
        },
        {
            "name": "trade_id",
            "type": "string"
        },
        {
            "name": "event_timestamp",
            "type": {
                "type": "long",
                "logicalType": "timestamp-millis"
            }
        },
        {
            "name": "atom_timestamp",
            "type": "long"
        }
    ]
}

Ticker

{
    "type": "record",
    "name": "Ticker",
    "namespace": "com.acme.avro",
    "fields": [
        {
            "name": "exchange",
            "type": "string"
        },
        {
            "name": "symbol",
            "type": "string"
        },
        {
            "name": "bid_price",
            "type": "double"
        },
        {
            "name": "bid_size",
            "type": "double"
        },
        {
            "name": "ask_price",
            "type": "double"
        },
        {
            "name": "ask_size",
            "type": "double"
        },
        {
            "name": "event_timestamp",
            "type": {
                "type": "long",
                "logicalType": "timestamp-millis"
            }
        },
        {
            "name": "atom_timestamp",
            "type": "long"
        }
    ]
}

L3 LOB

{
    "type": "record",
    "name": "L3_LOB",
    "namespace": "com.acme.avro",
    "fields": [
        {
            "name": "exchange",
            "type": "string"
        },
        {
            "name": "symbol",
            "type": "string"
        },
        {
            "name": "price",
            "type": "double"
        },
        {
            "name": "size",
            "type": "double"
        },
        {
            "name": "side",
            "type": "string"
        },
        {
            "name": "order_id",
            "type": "string"
        },
        {
            "name": "event_timestamp",
            "type": {
                "type": "long",
                "logicalType": "timestamp-millis"
            }
        },
        {
            "name": "atom_timestamp",
            "type": "long"
        }
    ]
}

L2 LOB

{
    "type": "record",
    "name": "LOB",
    "namespace": "com.acme.avro",
    "fields": [
        {
            "name": "exchange",
            "type": "string"
        },
        {
            "name": "symbol",
            "type": "string"
        },
        {
            "name": "price",
            "type": "double"
        },
        {
            "name": "size",
            "type": "double"
        },
        {
            "name": "side",
            "type": "string"
        },
        {
            "name": "event_timestamp",
            "type": {
                "type": "long",
                "logicalType": "timestamp-millis"
            }
        },
        {
            "name": "atom_timestamp",
            "type": "long"
        }
    ]
}

Funding Rate

{
    "type": "record",
    "name": "funding_rate",
    "namespace": "com.acme.avro",
    "fields": [
        {
            "name": "exchange",
            "type": "string"
        },
        {
            "name": "symbol",
            "type": "string"
        },
        {
            "name": "mark_price",
            "type": "double"
        },
        {
            "name": "funding_rate",
            "type": "double"
        },
        {
            "name": "next_funding_time",
            "type": {
                "type": "long",
                "logicalType": "timestamp-millis"
            }
        },
        {
            "name": "predicted_rate",
            "type": "double"
        },
        {
            "name": "event_timestamp",
            "type": {
                "type": "long",
                "logicalType": "timestamp-millis"
            }
        },
        {
            "name": "atom_timestamp",
            "type": "long"
        }
    ]
}

Open Interest

{
    "type": "record",
    "name": "open_interest",
    "namespace": "com.acme.avro",
    "fields": [
        {
            "name": "exchange",
            "type": "string"
        },
        {
            "name": "symbol",
            "type": "string"
        },
        {
            "name": "open_interest",
            "type": "double"
        },
        {
            "name": "event_timestamp",
            "type": {
                "type": "long",
                "logicalType": "timestamp-millis"
            }
        },
        {
            "name": "atom_timestamp",
            "type": "long"
        }
    ]
}

Candle

{
    "type": "record",
    "name": "Candle",
    "namespace": "com.acme.avro",
    "fields": [
        {
            "name": "exchange",
            "type": "string"
        },
        {
            "name": "symbol",
            "type": "string"
        },
        {
            "name": "start",
            "type": {
                "type": "long",
                "logicalType": "timestamp-millis"
            }
        },
        {
            "name": "end",
            "type": {
                "type": "long",
                "logicalType": "timestamp-millis"
            }
        },
        {
            "name": "interval",
            "type": "string"
        },
        {
            "name": "trades",
            "type": "int"
        },
        {
            "name": "closed",
            "type": "boolean"
        },
        {
            "name": "o",
            "type": "double"
        },
        {
            "name": "h",
            "type": "double"
        },
        {
            "name": "l",
            "type": "double"
        },
        {
            "name": "c",
            "type": "double"
        },
        {
            "name": "v",
            "type": "double"
        },
        {
            "name": "event_timestamp",
            "type": {
                "type": "long",
                "logicalType": "timestamp-millis"
            }
        },
        {
            "name": "atom_timestamp",
            "type": "long"
        }
    ]
}

Ethereum Blocks

{
  "doc": "Blocks on the Ethereum Chain.",
  "fields": [
    {
      "name": "atomTimestamp",
      "type": "long"
    },
    {
      "name": "number",
      "type": "long"
    },
    {
      "name": "hash",
      "type": "string"
    },
    {
      "name": "parentHash",
      "type": "string"
    },
    {
      "name": "nonce",
      "type": "string"
    },
    {
      "name": "sha3Uncles",
      "type": [
        "string",
        "null"
      ]
    },
    {
      "name": "logsBloom",
      "type": [
        "string",
        "null"
      ]
    },
    {
      "name": "transactionsRoot",
      "type": [
        "string",
        "null"
      ]
    },
    {
      "name": "stateRoot",
      "type": [
        "string",
        "null"
      ]
    },
    {
      "name": "receiptsRoot",
      "type": [
        "string",
        "null"
      ]
    },
    {
      "name": "miner",
      "type": "string"
    },
    {
      "name": "difficulty",
      "type": "long"
    },
    {
      "name": "totalDifficulty",
      "type": {
        "logicalType": "decimal",
        "precision": 38,
        "scale": 0,
        "type": "bytes"
      }
    },
    {
      "name": "extraData",
      "type": [
        "string",
        "null"
      ]
    },
    {
      "name": "size",
      "type": "long"
    },
    {
      "name": "gasLimit",
      "type": {
        "logicalType": "decimal",
        "precision": 38,
        "scale": 0,
        "type": "bytes"
      }
    },
    {
      "name": "gasUsed",
      "type": {
        "logicalType": "decimal",
        "precision": 38,
        "scale": 0,
        "type": "bytes"
      }
    },
    {
      "name": "blockTimestamp",
      "type": {
        "logicalType": "timestamp-millis",
        "type": "long"
      }
    }
  ],
  "name": "ethereum_blocks",
  "namespace": "com.mycorp.mynamespace",
  "type": "record"
}

Ethereum Transactions

{
  "doc": "Ethereum Transaction Objects",
  "fields": [
    {
      "name": "atomTimestamp",
      "type": "long"
    },
    {
      "name": "blockTimestamp",
      "type": {
        "logicalType": "timestamp-millis",
        "type": "long"
      }
    },
    {
      "name": "hash",
      "type": "string"
    },
    {
      "name": "nonce",
      "type": "string"
    },
    {
      "name": "blockHash",
      "type": "string"
    },
    {
      "name": "blockNumber",
      "type": "long"
    },
    {
      "name": "transactionIndex",
      "type": "long"
    },
    {
      "name": "fromAddr",
      "type": "string"
    },
    {
      "name": "toAddr",
      "type": [
        "string",
        "null"
      ]
    },
    {
      "name": "value",
      "type": {
        "logicalType": "decimal",
        "precision": 38,
        "scale": 0,
        "type": "bytes"
      }
    },
    {
      "name": "gas",
      "type": "long"
    },
    {
      "name": "gasPrice",
      "type": "long"
    },
    {
      "name": "input",
      "type": "string"
    },
    {
      "name": "maxFeePerGas",
      "type": [
        "long",
        "null"
      ]
    },
    {
      "name": "maxPriorityFeePerGas",
      "type": [
        "long",
        "null"
      ]
    },
    {
      "name": "type",
      "type": "string"
    }
  ],
  "name": "ethereum_transactions",
  "namespace": "com.mycorp.mynamespace",
  "type": "record"
}

Ethereum Logs

{
  "doc": "Logs for Ethereum Events",
  "fields": [
    {
      "name": "atomTimestamp",
      "type": "long"
    },
    {
      "name": "blockTimestamp",
      "type": {
        "logicalType": "timestamp-millis",
        "type": "long"
      }
    },
    {
      "name": "logIndex",
      "type": "long"
    },
    {
      "name": "transactionIndex",
      "type": "long"
    },
    {
      "name": "transactionHash",
      "type": "string"
    },
    {
      "name": "blockHash",
      "type": "string"
    },
    {
      "name": "blockNumber",
      "type": "long"
    },
    {
      "name": "address",
      "type": "string"
    },
    {
      "name": "data",
      "type": "string"
    },
    {
      "name": "topic0",
      "type": [
        "null",
        "string"
      ]
    },
    {
      "name": "topic1",
      "type": [
        "null",
        "string"
      ]
    },
    {
      "name": "topic2",
      "type": [
        "null",
        "string"
      ]
    },
    {
      "name": "topic3",
      "type": [
        "null",
        "string"
      ]
    }
  ],
  "name": "ethereum_logs",
  "namespace": "com.mycorp.mynamespace",
  "type": "record"
}

Ethereum Token Transfers

{
  "doc": "Ethereum Token Transfer Objects",
  "fields": [
    {
      "name": "atomTimestamp",
      "type": "long"
    },
    {
      "name": "blockTimestamp",
      "type": {
        "logicalType": "timestamp-millis",
        "type": "long"
      }
    },
    {
      "name": "tokenAddr",
      "type": "string"
    },
    {
      "name": "fromAddr",
      "type": "string"
    },
    {
      "name": "toAddr",
      "type": "string"
    },
    {
      "name": "value",
      "type": {
        "logicalType": "decimal",
        "precision": 38,
        "scale": 0,
        "type": "bytes"
      }
    },
    {
      "name": "transactionHash",
      "type": "string"
    },
    {
      "name": "logIndex",
      "type": "long"
    },
    {
      "name": "blockNumber",
      "type": "long"
    },
    {
      "name": "blockHash",
      "type": "string"
    }
  ],
  "name": "ethereum_token_transfers",
  "namespace": "com.mycorp.mynamespace",
  "type": "record"
}

Dex Trades

{
  "doc": "Trades that occur on Ethereum DEXes",
  "fields": [
    {
      "name": "atomTimestamp",
      "type": "long"
    },
    {
      "name": "blockTimestamp",
      "type": {
        "logicalType": "timestamp-millis",
        "type": "long"
      }
    },
    {
      "name": "exchange",
      "type": "string"
    },
    {
      "name": "maker",
      "type": [
        "null",
        "string"
      ]
    },
    {
      "name": "taker",
      "type": [
        "null",
        "string"
      ]
    },
    {
      "name": "tokenBought",
      "type": "string"
    },
    {
      "name": "tokenSold",
      "type": "string"
    },
    {
      "name": "tokenBoughtAddr",
      "type": "string"
    },
    {
      "name": "tokenSoldAddr",
      "type": "string"
    },
    {
      "name": "amountBought",
      "type": {
        "logicalType": "decimal",
        "precision": 38,
        "scale": 24,
        "type": "bytes"
      }
    },
    {
      "name": "amountSold",
      "type": {
        "logicalType": "decimal",
        "precision": 38,
        "scale": 24,
        "type": "bytes"
      }
    },
    {
      "name": "logIndex",
      "type": "long"
    },
    {
      "name": "transactionHash",
      "type": "string"
    },
    {
      "name": "blockHash",
      "type": "string"
    },
    {
      "name": "blockNumber",
      "type": "long"
    },
    {
      "name": "pairAddr",
      "type": "string"
    }
  ],
  "name": "dex_trades",
  "namespace": "com.mycorp.mynamespace",
  "type": "record"
}

Dex Liquidity

{
    "doc": "Liquidity events that occur on Ethereum DEXes",
    "fields": [
      {
        "name": "eventType",
        "type": "string"
      },
      {
        "name": "atomTimestamp",
        "type": "long"
      },
      {
        "name": "blockTimestamp",
        "type": {
          "logicalType": "timestamp-millis",
          "type": "long"
        }
      },
      {
        "name": "exchange",
        "type": "string"
      },
      {
        "name": "pairAddr",
        "type": "string"
      },
      {
        "name": "transactionHash",
        "type": "string"
      },
      {
        "name": "logIndex",
        "type": "int"
      },
      {
        "name": "blockNumber",
        "type": "int"
      },
      {
        "name": "blockHash",
        "type": "string"
      },
      {
        "name": "token0",
        "type": "string"
      },
      {
        "name": "token1",
        "type": "string"
      },
      {
        "name": "token0Addr",
        "type": "string"
      },
      {
        "name": "token1Addr",
        "type": "string"
      },
      {
        "name": "amount0",
        "type": {
          "logicalType": "decimal",
          "precision": 38,
          "scale": 24,
          "type": "bytes"
        }
      },
      {
        "name": "amount1",
        "type": {
          "logicalType": "decimal",
          "precision": 38,
          "scale": 24,
          "type": "bytes"
        }
      },
      {
        "name": "owner",
        "type": ["string", "null"]
      }
    ],
    "name": "dex_liquidity",
    "namespace": "com.mycorp.mynamespace",
    "type": "record"
  }

Last updated