36 slick::stream_buffer_multiplexer &mux,
37 slick::queue<uint8_t>& control_queue,
38 slick::queue<uint8_t>& request_queue
46 bool is_connected()
const override {
return connected_.load(std::memory_order_relaxed); }
51 void start()
override;
53 bool is_running()
const override {
return running_.load(std::memory_order_relaxed); }
57 void process_md_requests();
59 void publish_definitions();
61 void on_trades(
const nlohmann::json& msg);
62 void on_bbo(
const nlohmann::json& msg);
63 void on_l2(
const nlohmann::json& msg);
64 void on_l2book(
const nlohmann::json& msg);
66 std::atomic_bool running_{
false};
67 std::atomic_bool connected_{
false};
68 std::thread worker_thread_;
71 std::string shm_name_;
73 std::unique_ptr<hyperliquid::Info> info_;
75 std::shared_ptr<producer_buffer> event_buffer_;
76 slick::queue<uint8_t>& control_queue_;
77 slick::queue<uint8_t>& request_queue_;
78 uint64_t request_cursor_;
80 std::string api_url_{
"https://api.hyperliquid.xyz"};
82 std::vector<std::string> trade_instruments_;
83 std::vector<std::string> quote_instruments_;
84 std::vector<std::string> level2_instruments_;
85 int level2_depth_{10};
88 std::vector<std::pair<std::string, int>> sub_ids_;
90 std::unordered_map<std::string, std::string> coin_to_name_;
92 std::set<price_t, std::greater<price_t>> bid_prices_;
93 std::set<price_t> ask_prices_;