Price Oracle
Considering the number of different markets in global economy, it can be hard to decide the real price of an asset. Price oracle designed to overcome this problem with modeling the challenge as shortest path problem(dijkstra).
Each asset is defined as a node and each market is defined as a link between the nodes. Websocket connections are opened to integrated exchanges and realtime prices flows into the graph.
To compute link weights graph initialized with prices and all market volumes are converted to USDT. Then each link assigned a weight value depending on how much volume the market has.
After link weights computed all routes are purged and the routes are generated with updated weights. When a price update occurs pre-defined set of asset pair prices will be published to WS /price after the route is followed.
It's also possible to run dijkstra algorithm on two arbitrary nodes and get price of an asset in some specific asset. To use this feature you need to send an HTTP request to GET /price or POST /price endpoint.
You can also retrieve graph metrics from GET /metrics endpoint.