Navigation
← All projects

Project Alpine

Different exchanges. Comparable prices?

An interest in price differences across trading platforms became a project about the data underneath: bringing two exchanges into a consistent foundation for comparison and analysis.

Implemented with live Kraken and Coinbase data using Kafka, Databricks, Delta Lake and dbt.

Sources: Kraken + Coinbase

Modelling: 13 dbt models

Recorded run: 38 passing tests

The starting point

The same market, different screens.

Browsing different trading platforms and looking for potential arbitrage opportunities raised a more basic question: was I comparing like with like? Alpine grew from that curiosity into a project about making market observations consistent, traceable and ready to explore.

Before comparing prices, can we trust that the data means the same thing?

The problem behind it

Exchanges describe pairs, prices and volumes differently. A common format only helps if it preserves those meanings and keeps questionable records visible.

Project walkthrough

Follow a market observation

  1. Read each exchange on its own terms

    I read Kraken and Coinbase separately because they send information differently. The Coinbase part of this project covers Bitcoin priced in euros.

  2. Make a fair comparison possible

    I give matching assets a shared name and check that the latest price is present and positive. Records that fail these checks are set aside for review. The original exchange details remain available.

  3. Flag prices that meet a rule

    The project checks the gap between asking and bidding prices against a chosen threshold. It records an alert when the rule is met. Each run processes the available records and then finishes.

  4. Summarise the price movement

    For each exchange and asset pair, I group the observations by hour and calculate the opening, highest, lowest and closing prices. These tables make the movement easier to explore.

A view from the project. See the results below for more detail.

A view from the project. See the results below for more detail.

Alpine platform architecture

Collect the market updates → keep the originals → check and standardise them → prepare alerts and tables for analysis.

Decisions

What I had to change

Make sure the numbers mean the same thing

Kraken and Coinbase send their data differently. I read each source separately, keep its original labels and give matching assets a shared name. I also keep the latest trade size separate from the amount traded over a full day. Combining those figures would create a misleading comparison.

Work with the limits of the platform

The platform I used did not support the continuous processing schedule I first planned. I changed the approach so each run handles the data already waiting, finishes and then starts the next task. In Databricks this is called AvailableNow. It made the workflow workable, but it is different from keeping every stage running continuously.

Keep failures visible

I check that records have the expected fields, a recognised asset and a valid price. Records that fail are saved separately for investigation. Both paths keep a record of their progress, so accepted and rejected data can be followed independently.

Evidence

Inspect the results

The saved run shows 13 data models and 38 passing tests. Eight of the resulting tables are prepared for analysis, so the reader does not have to work through the raw market messages.

Recorded dbt test results

1 / 5Recorded dbt test results

Recorded dbt test results

Model lineage

Completed workflow

Silver data contract

Recorded alert events

Governance

Controls across the pipeline

I separate original records, checked records and analysis tables so their purpose is clear. Unity Catalog helps organise them, saved progress markers track processing and connection credentials come from secret storage. Reports and alerts use the same checked definitions.

Related governance controls

What to keep in mind

Operating scope and further validation

The screenshots show completed project runs and their tests. I have not established a guaranteed level of continuous service or tested whether the alerts would lead to profitable trades.

← More projectsDiscuss this project ↗