https://github.com/runeksvendsen/crypto-depth
Measure market depth of the cryptocurrency market
https://github.com/runeksvendsen/crypto-depth
analysis cryptocurrency exchange market
Last synced: 3 months ago
JSON representation
Measure market depth of the cryptocurrency market
- Host: GitHub
- URL: https://github.com/runeksvendsen/crypto-depth
- Owner: runeksvendsen
- License: bsd-3-clause
- Created: 2018-06-26T06:58:17.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-01T14:16:48.000Z (over 6 years ago)
- Last Synced: 2025-07-07T08:07:09.384Z (3 months ago)
- Topics: analysis, cryptocurrency, exchange, market
- Language: Haskell
- Size: 85.9 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cryptocurrency market depth (*under development*)
## What?
Measure the liquidity (market depth) of all cryptocurrencies using the measure "*how much can I buy/sell of a given cryptocurrency while only moving the price **x**%*?" (where **x** is currently set to *5*). The more liquid a cryptocurrency is, the larger the quantity one can buy/sell while moving its price by some fixed percentage.
## How?
Build a weighted directed graph, where the nodes are (crypto)currencies (e.g. "USD", "BTC", "ETH", etc.) and the edge from e.g. "USD" to "BTC" constitutes the *sell orders*/*asks* of a BTC/USD orderbook (because the sell orders of a BTC/USD orderbook are consumed in order to move from "USD" to "BTC"). Conversely, the edge from "BTC" to "USD" constitutes the *buy orders*/*bids* of a BTC/USD orderbook (again, because the buy orders in a BTC/USD orderbook are consumed in order to move from "BTC" to "USD"). The edge weight is the inverse (*1/n*) of the amount *n* that you can sell/buy into the given orderbook while only moving the price at most **x**% (currently *x=5*).
By
1. Saving the result from applying Dijkstra's algorithm with source vertex "USD" and target vertex "*crypto_currency*" (to find the most liquid path from "USD" to the given cryptocurrency)
2. Removing the edge(s) returned by 1
3. Repeatingwe discover, in descending order of liquidity, all the paths from a given currency to "USD". We repeat this for all cryptocurrencies, in order to find how much one can sell/buy into a given cryptocurrency while only moving the price the specified percentage (using all available exchanges and markets).