A real-time data visualization tool designed to showcase various market metrics across different exchanges. Its purpose is to provide insights into how each exchange reacts to specific market conditions and to evaluate each exchange's behavior in relation to others.
pip install -r requirements.txt
jupyter lab
v = MarketVisualization(exchanges, "prices")
v.start()
v = MarketVisualization(exchanges, "midpoints")
v.start()
v = MarketVisualization(exchanges, "spreads")
v.start()
To add a new exchange, create a class that inherits from the abstract Exchange
class and implements the following functions:
get_orders
: Fetches order data (best ask, bid, etc.) from the exchange.get_colors
: Defines the color scheme used for visualizing the exchange's data.name
: Returns the name of the exchange.
Based on the exchange type, place the new class in one of the following directories:
cexes/
for centralized exchangesdexes/
for decentralized exchangesaggregators/
for aggregation services
An example implementation:
class NewExchange(Exchange):
def get_orders(self):
# Returns an order-book with 1 ask:
# @1 w size 10
# and 1 bid:
# @0.5 w size 20
return [[[1,10],[0.5,20]]]
def get_colors(self):
return ["red", "green"]
def name(self):
return "NewExchange"