Slick Sim 0.10.1
Exchange simulator that shadows real venues for risk-free strategy testing
Loading...
Searching...
No Matches
hyperliquid_trade_encoder.hpp
Go to the documentation of this file.
1#pragma once
2
4#include <common/messages.hpp>
5#include <nlohmann/json.hpp>
6
8
9// Encoders for Hyperliquid's `trades` channel, kept free of the socket layer so
10// the wire shape can be tested without standing up a WebSocket server.
11//
12// {"channel":"trades","data":[
13// {"coin":"ETH","side":"B","px":"3000.5","sz":"1.25","time":<ms>,
14// "hash":"0x0","tid":<id>}]}
15//
16// `side` is the aggressor: "B" for a buy, "A" otherwise. The simulator has no
17// on-chain transaction to reference, so `hash` is always the literal "0x0".
18
20nlohmann::json encode_trade_message(const char* coin, const TradeSummary& summary);
21
24nlohmann::json encode_trade_message(const char* coin, const MDTrade* trades, uint32_t num_trades);
25
26} // end namespace slick::sim::md_publisher
json encode_trade_message(const char *coin, const TradeSummary &summary)
One executed trade.