A Rust CLI tool to identify option arbitrages between different exchanges
cargo run --bin server
This will start the following workers:
- OrderBookManager : This is responsible for checking for arbitrage opportunities and broadcasting them to the endpoint.
- Endpoint : This is responsible for accepting websocket connections and broadcasting arbitrage opportunities to the clients.
- DeribitExchangeAdapter : This is responsible for subscribing to deribit and fetching the order book data.
- OkexExchangeAdapter : This is responsible for subscribing to okex and fetching the order book data.
The server has the following environment variables:
OKEX_WS_URL
: The URL of the Okex WebSocket APIOKEX_PRODUCTS_TO_SUBSCRIBE
: The products to subscribe to, separated by commasOKEX_HEARTBEAT_MILLIS
: The heartbeat interval in millisecondsDERIBIT_WS_URL
: The URL of the Deribit WebSocket APIDERIBIT_PRODUCTS_TO_SUBSCRIBE
: The products to subscribe to, separated by commasDERIBIT_HEARTBEAT_MILLIS
: The heartbeat interval in millisecondsWEBSOCKET_SERVER_PORT
: The port on which the server will listen for incoming websocket connections
By default, the server will use the environment variables in the .env/server.env
file.
OKEX_WS_URL
: wss://ws.okx.com:8443/ws/v5/publicOKEX_PRODUCTS_TO_SUBSCRIBE
: BTC-USD-250221-90000-POKEX_HEARTBEAT_MILLIS
: 5000DERIBIT_WS_URL
: wss://www.deribit.com/ws/api/v2DERIBIT_PRODUCTS_TO_SUBSCRIBE
: book.BTC-21FEB25-90000-P.none.20.100msDERIBIT_HEARTBEAT_MILLIS
: 5000WEBSOCKET_SERVER_PORT
: 9027
Using websocat
websocat ws://localhost:9027/stream/v1
You can also use tools like postman.