> For the complete documentation index, see [llms.txt](https://blockhouse-app.gitbook.io/blockhouse/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blockhouse-app.gitbook.io/blockhouse/asset-classes/crypto/standards-and-conventions.md).

# Standards and Conventions

{% tabs %}
{% tab title="CEX" %}

To ensure data consistency and reliability, the following standards and conventions are followed:

1. **Timestamps:**
   * Fee details are stored in JSON format for compatibility across exchanges.
   * Each trade fee is linked to its respective trade to ensure accurate calculations.
2. **Data Integrity:**
   * Each trade has a unique id that differentiates it from others.
   * symbol values follow the standard market notation (e.g., BTC/USD, ETH/USD).
3. Tr**ade Side Representation:**
   * The side field is always either "buy" or "sell" to indicate trade direction.
4. **Order Execution Types:**
   * The type field supports various order types, including:
     * Market Order: Executes immediately at the best available price.
     * Limit Order: Executes at a specific price or better.
     * Stop-Limit Order: Becomes a limit order once the stop price is reached.
5. F**ees and Costs:**

   * Fee details are stored in JSON format for compatibility across exchanges.
   * Each trade fee is linked to its respective trade to ensure accurate calculations.

{% endtab %}

{% tab title="DEX" %}
**Data Normalization**

Normalization simplifies DEX data by standardizing formats across multiple chains and protocols.

This section explores these processes, trade-offs, and the reasoning behind our schema design.

**Cross-Chain Standardization**

– Ethereum: Timestamps are captured directly from block data.

– Solana: Timestamps are converted from UNIX format to ISO-8601.

– Token amounts are normalized according to their decimal places.

– Prices are standardized to USD value using oracle feeds.

**Pool Liquidity Normalization**

– Total Value Locked (TVL) is calculated in USD.

– Volume metrics are normalized to 24-hour periods.

– Fee revenues are converted to APR values.

– Position concentrations are expressed as percentile distributions.

**Transaction Feature Engineering**

– Price impact calculations using constant product formulas.

– Slippage measurements comparing quoted vs. executed prices.

– Gas costs in USD for Ethereum transactions.

– Fee costs in USD for Solana transactions.

**Time Series Resampling**

– 1-minute candles for high-frequency analysis.

– 5-minute, 15-minute, hourly, and daily aggregations.

– Volume-weighted average prices (VWAP) calculated per interval.

– Liquidity depth measurements at standard intervals.

**Simulated Order Book Construction**

– AMM curve discretization into bid/ask levels.

– Concentrated liquidity position mapping to limit orders.

– Fee tier normalization across platforms.

– Multi-pool aggregation for complete market depth.

**Pricing Methodology**

– Market prices derived from the latest swap execution.

– Theoretical prices calculated from pool reserves.

– Slippage curves modeled for various trade sizes.

– Cross-DEX price normalization for arbitrage detection.

**Data Quality Assurance**

– Automated validation of schema compliance.

– Outlier detection for anomalous price or volume data.

– Chain reorganization handling with transaction finality checks.

– Missing data imputation for analytics continuity.
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://blockhouse-app.gitbook.io/blockhouse/asset-classes/crypto/standards-and-conventions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
