<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[HangukQuant Research]]></title><description><![CDATA[Mathematics, Finance and Their Babies. 
quant research and quant dev.]]></description><link>https://www.research.hangukquant.com</link><image><url>https://substackcdn.com/image/fetch/$s_!LX9y!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc5718e3-074f-4c1d-a77d-f1fa609a9ea0_1280x1280.png</url><title>HangukQuant Research</title><link>https://www.research.hangukquant.com</link></image><generator>Substack</generator><lastBuildDate>Mon, 18 May 2026 03:30:39 GMT</lastBuildDate><atom:link href="https://www.research.hangukquant.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[QUANTA GLOBAL PTE. LTD. 202328387H.]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[hangukquant@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[hangukquant@substack.com]]></itunes:email><itunes:name><![CDATA[HangukQuant]]></itunes:name></itunes:owner><itunes:author><![CDATA[HangukQuant]]></itunes:author><googleplay:owner><![CDATA[hangukquant@substack.com]]></googleplay:owner><googleplay:email><![CDATA[hangukquant@substack.com]]></googleplay:email><googleplay:author><![CDATA[HangukQuant]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Designing State-of-the-Art Logging in Python]]></title><description><![CDATA[bringing nanosecond-level logging to Python and techniques applied]]></description><link>https://www.research.hangukquant.com/p/designing-state-of-the-art-logging</link><guid isPermaLink="false">https://www.research.hangukquant.com/p/designing-state-of-the-art-logging</guid><dc:creator><![CDATA[HangukQuant]]></dc:creator><pubDate>Fri, 08 May 2026 12:55:55 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!NdZd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40d93e98-9675-4d08-aecc-318e4e4a626b_1682x626.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hello friends~</p><p>This post, we will discuss the <strong>introduction of a state of the art performance Python logging subsystem in quantpylib</strong>, and discuss some of the key design principles that allow us to achieve this. To my knowledge, among all Python logging frameworks, it is the lowest latency implementation out there.</p><p>As an aside, I am focused on making quantpylib into a more mature platform for serious quants. Beyond my expectations, the repo has found its way into many retail traders&#8217; workflow, and even some small institutional trading stacks. </p><p>The project, although originally intended to be &#8216;my personal infra&#8217; - is now bigger than myself, and accordingly, we will look to adopt higher standards appropriate to the gravity of its use cases. Although it is a best-effort guarantee service, the best-est of the effort will be brought forth.</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;c7ed27a3-aba2-4c57-8ecc-33adc404f142&quot;,&quot;caption&quot;:&quot;&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;HangukQuant quantpylib Github Repo&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:42788676,&quot;name&quot;:&quot;HangukQuant&quot;,&quot;bio&quot;:&quot;quant research and quant dev. not financial advice.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2023-11-24T16:59:27.729Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.research.hangukquant.com/p/hangukquant-community-github-repo&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:139132009,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:29,&quot;comment_count&quot;:0,&quot;publication_id&quot;:453792,&quot;publication_name&quot;:&quot;HangukQuant Research&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!LX9y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc5718e3-074f-4c1d-a77d-f1fa609a9ea0_1280x1280.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>Let&#8217;s get started!</p><p>A taster: (<strong>on log scale)</strong>, quantpylib&#8217;s logger is 30-70x faster than standard <em>logging</em> and microsoft&#8217;s <em>picologging</em> library!</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NdZd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40d93e98-9675-4d08-aecc-318e4e4a626b_1682x626.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NdZd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40d93e98-9675-4d08-aecc-318e4e4a626b_1682x626.png 424w, https://substackcdn.com/image/fetch/$s_!NdZd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40d93e98-9675-4d08-aecc-318e4e4a626b_1682x626.png 848w, https://substackcdn.com/image/fetch/$s_!NdZd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40d93e98-9675-4d08-aecc-318e4e4a626b_1682x626.png 1272w, https://substackcdn.com/image/fetch/$s_!NdZd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40d93e98-9675-4d08-aecc-318e4e4a626b_1682x626.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NdZd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40d93e98-9675-4d08-aecc-318e4e4a626b_1682x626.png" width="1456" height="542" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/40d93e98-9675-4d08-aecc-318e4e4a626b_1682x626.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:542,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:582887,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/196889438?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40d93e98-9675-4d08-aecc-318e4e4a626b_1682x626.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!NdZd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40d93e98-9675-4d08-aecc-318e4e4a626b_1682x626.png 424w, https://substackcdn.com/image/fetch/$s_!NdZd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40d93e98-9675-4d08-aecc-318e4e4a626b_1682x626.png 848w, https://substackcdn.com/image/fetch/$s_!NdZd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40d93e98-9675-4d08-aecc-318e4e4a626b_1682x626.png 1272w, https://substackcdn.com/image/fetch/$s_!NdZd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40d93e98-9675-4d08-aecc-318e4e4a626b_1682x626.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong><br>Logging</strong> is an important part of system observability. It gives us a way to reconstruct the system states, what decisions it made, and where things failed in live systems.</p><p>However, logging is not free. A log invocation may require caller discovery, record construction, string formatting, structured field handling, handler traversal, locks, stream writes, flush behavior, and sometimes exception or stack formatting. In latency-sensitive tasks such as trading, this cost can sit directly in the hot path.</p><p>In Python, reducing this cost is difficult because the usual logging path is intentionally dynamic. Python objects are allocated, frames may be inspected, dictionaries are populated, handlers own locks, and formatting often happens before the caller can move on. This is not the shape we want for threads parsing market data and executing time-sensitive actions.</p><p>To alleviate these issues, a number of existing libraries try to improve different parts of the logging problem. A couple examples - </p><ul><li><p><em>picologging</em> is designed as a faster, mostly drop-in replacement for the standard library logging module. This is useful if the main constraint is compatibility with the existing logging API, while moving parts of the implementation into faster native (C) code.</p></li><li><p><em>loguru</em> attacks a slightly different problem. It makes logging much easier to configure and use: sinks, serialization, contextual binding, lazy formatting, and nicer ergonomics. Its <em>lazy=True</em> path can defer evaluation of expensive arguments until the message is actually emitted. Emitted log still travels through Loguru's event construction, formatting, and sink pipeline.</p></li></ul><p>Although these are good libraries, most of them still preserve the broad log-record shape: create an event-like record, attach metadata, decide when the message is constructed, and push the result through a sink. </p><p>They differ in how much work is deferred and whether message construction happens directly in the hot path, but the core abstraction is still a dynamic log record carrying metadata through a logging pipeline. <strong>The end result is that log invocations cost up to microseconds</strong>. Where we are targeting t2t in the microsecond teens and below, observability is a hefty price to pay.</p><p>Our objective, therefore, is to be able to generate structured, useful logging in Python applications - that can be aggregated and analysed downstream in logging pipeline(s) such as as for ingestion into a Loki database.</p><p>In order to target this objective, we would like to ask ourselves the following questions:</p><ul><li><p>what components of log invocation add to the hot path?</p></li><li><p>how do we reduce the number of Python object allocations in that path?</p></li><li><p>which part of the logging workflow is actually costly: call-site lookup, record construction, argument formatting, handler traversal, serialization, or I/O?</p></li><li><p>do we walk the Python frame stack to recover metadata such as filename, pathname, function name, or line number, and if so, how often?</p></li><li><p>what concurrency mechanism makes logging thread-safe?</p></li><li><p>if the logger acquires a lock, where is that lock acquired and how expensive is it under contention?</p></li><li><p>does the caller thread format strings, or can formatting be deferred?</p></li><li><p>does the caller thread call into the kernel for file or stream writes, or is that pushed into a writer thread?</p></li><li><p>is the path synchronous with the sink, or does the caller only publish a compact record and move on?</p></li></ul><h3>Standard Path</h3><p>A normal call like:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;de0847ca-9ac5-407b-bd6d-d616fb6427a5&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">logger.info(&#8221;fill %d @ %f for %s&#8221;, qty, px, symbol)</code></pre></div><p>can involve a surprisingly long sequence of work:</p><ol><li><p><strong>Enabled-level check:</strong> the logger has to decide whether the event is filtered out by the logger level, handler level, or effective inherited level.</p></li><li><p><strong>Caller discovery / frame inspection:</strong> the logger may inspect Python frames to recover metadata such as filename, pathname, function name, and line number.</p></li><li><p><strong>LogRecord construction:</strong> the logger creates a Python object representing the event.</p></li><li><p><strong>Attribute population:</strong> the record is filled with message arguments, timestamps, process/thread metadata, exception information, stack data, and user-provided extra fields.</p></li><li><p><strong>Handler traversal:</strong> Python logging is hierarchical, so the event may walk through logger and parent-handler control flow depending on propagation settings.</p></li><li><p><strong>Filters:</strong> each logger or handler may run user-defined filters before the record is emitted.</p></li><li><p><strong>Locks:</strong> handlers need synchronization because multiple threads may write into the same logging sink.</p></li><li><p><strong>Formatting:</strong> the message string, structured fields, timestamp, exception text, or JSON representation are constructed.</p></li><li><p><strong>Stream writes and flush behavior:</strong> the final bytes are written to stdout, a file, socket, or another sink, possibly crossing into the kernel or blocking on I/O.</p></li></ol><p>The logging libraries including the ones we mentioned improve parts of this path, but many still operate in the same conceptual shape: create an event object, attach dynamic fields, render it, and pass it through a logging pipeline.</p><p>To break this latency floor, we have to remove pieces of the constraint rather than merely make each piece a little faster. The useful observation is that most log invocation sites are only partially dynamic.</p><p>For example, in printf-style logging invocations, the static information usually includes the format string, file name, line number, severity, number of arguments, and rough parameter types. The dynamic information is much smaller: the values passed into that invocation, occasional <em>extra</em> fields, and the timestamp.</p><p>These points carry forward into the implementation&#8217;s optimization techniques.</p><h3>Techniques</h3><p>For the specific implementation, refer to the <em>quantpylib</em> codebase. The high-level design is easier to discuss in terms of the techniques applied.</p><h3><strong>static information registry</strong></h3><p>The first technique is to treat a log invocation site as something that can be registered once and then referred to cheaply.</p><p>The Python-facing fast path resolves the caller into a key based on the CPython code object and line number. Implementation-wise, this goes through CPython frame objects: get the current frame, recover the <em>PyCodeObject</em>, read the line number, and combine the code-object pointer and line number through a small custom hash. The result is a per-thread cache key for that call site.</p><p>On a cache hit, the logger gets back a stable integer id. On a cache miss, the format string and frame metadata are registered into a static registry: pathname, filename, line number, severity, parameter count, rough parameter types, and an unload/formatting function. This id uniquely identifies the log invocation site.</p><p>Instead of constructing a fresh record that contains all metadata, each emitted record can contain a pointer to the static data plus only the dynamic payload:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;cpp&quot;,&quot;nodeId&quot;:&quot;7d5ae96f-23f2-4f3d-841d-fd4e6511f69e&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-cpp">struct StaticData {
  const char* pathname;
  const char* filename;
  const char* format;
  uint32_t line_number;
  LogLevel severity;
  int num_params;
  const ParamType* param_types;
  UnloadFn unloadfn;
};

struct LogEntry {
  const StaticData* static_data_ptr;
  uint64_t timestamp;
  uint16_t entry_size;
  uint8_t reserved[6];
  char args[];
};</code></pre></div><p>There is a deliberate Python-specific constraint here that we enforce, which is that format strings should be stable literals.</p><p>For example, the intended shape:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;b352d07f-76e0-4e98-a549-fcd7bc2f3739&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">log.info("fill %d @ %f for %s", qty, price, symbol)</code></pre></div><p>is remarkably distinct from </p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;5f6ebae8-93d6-420b-b865-af38b699b435&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">log.info(f"fill {qty} @ {price} for {symbol}")</code></pre></div><p>In the first case, the format string is a literal object associated with the call site.  In CPython, the compiled code object holds constants in its constant table, and repeated execution of that call site loads the same Python string object from that table. Object identity is represented by the object&#8217;s address for its lifetime, i.e. what <em>id(obj)</em> exposes at the Python level. The logger uses this idea at the native layer by recording the PyObject* pointer for the format string. For repeated invocations of the same literal-style call site, that pointer remains stable.</p><p>In the second case, Python constructs a new string value dynamically, so the format string&#8217;s address is no longer a stable part of the call-site key. If the same source line starts producing different string objects, the logger cannot safely say that the cached id still refers to the same static logging schema, so it rejects the call.</p><p>This is a limitation we enforce so that the call-site cache is meaningful.</p><h3><strong>transportation layer</strong></h3><p>After the call-site cache resolves the static metadata id, the next problem is transportation: how do we move the dynamic log payload across the producer/writer thread boundary without turning the log invocation into a normal synchronized I/O operation?</p><p>The backend borrows from the LMAX Disruptor design. The important optimizations in that family of designs are as follows:</p><ol><li><p>Preallocation: allocate the ring buffer upfront so memory can be reused instead of dynamically allocated on every log invocation.</p></li><li><p>Lock-free producer hot path: producers writing to the ring buffer avoid a lock/mutex on the latency-sensitive path, which removes the handler-lock shape of conventional logging.</p></li><li><p>Sequence caching: the producer memoizes the observed consumer sequence, amortizing the core-to-core cache-coherence traffic that would otherwise come from producer/consumer progress tracking.</p></li></ol><p>Additionally, beyond the algorithmic improvements, the transportation layer makes optimizations designed to run well on modern hardware architectures:</p><ol start="4"><li><p>Cache-line aware sequence counters: sequence counters are aligned and padded to cache-line boundaries to reduce false sharing.</p></li><li><p>Power-of-two indexing: ring positions can be computed with a bit mask instead of modulo arithmetic.</p></li></ol><p>We generalize the LMAX Disruptor idea from a ring of fixed event objects to a ring over raw byte buffers.</p><p>The producer and the writer/consumer agree on a raw byte encoding for log entries. Instead of communicating Python objects or fixed event slots, the producer writes log entries as contiguous bytes using this encoding scheme, and the writer later decodes the bytes into formatted output. This matters because log records are not naturally fixed-size. A no-argument message, a three-argument printf-style message, and a message with dynamic extra fields have different byte footprints. Instead of forcing them into a fixed slot size, the logger reserves the exact number of bytes required for:</p><ul><li><p>the LogEntry header;</p></li><li><p>the pointer to static metadata;</p></li><li><p>timestamp and entry size;</p></li><li><p>packed printf-style arguments;</p></li><li><p>other fixed and variable length fields.</p></li></ul><p>Each producing thread owns a thread-local log buffer. Conceptually, this turns the logging transport into multiple SPSC-style queues: each producer publishes into its own buffer, and the writer side consumes from those buffers. This reduces producer-side contention because producers are not fighting over the same write sequence.</p><p>The writer thread (in a non critical path) is then responsible for merging log entries from the thread-local buffers. In the implementation, this is done with an appropriate ordering structure such as a priority heap over timestamps. The writer side also decides where the log output should go, when writes should be flushed, and what policy should govern the generation of the actual log lines.</p><p>Further, the writer side can be pinned to a housekeeping core and can perform the heavier work of turning byte records into the desired output format, such as JSON or K=V logs. This not only defers formatting and heavy I/O away from the hot path, but also helps keep the producer working set smaller and friendlier to L1/L2 cache behavior, which matters on modern architectures.</p><h3>Benchmark</h3><p>Based on the techniques, here are the benchmarks, and the benchmarking code: (note that exceptions call Python runtime&#8217;s stack trace formatting/utilities before calling into the logger framework)</p><h4>File Sink</h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2uD4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61dfad46-2e1d-42ee-9360-e1a1843155e2_3456x2028.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2uD4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61dfad46-2e1d-42ee-9360-e1a1843155e2_3456x2028.png 424w, https://substackcdn.com/image/fetch/$s_!2uD4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61dfad46-2e1d-42ee-9360-e1a1843155e2_3456x2028.png 848w, https://substackcdn.com/image/fetch/$s_!2uD4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61dfad46-2e1d-42ee-9360-e1a1843155e2_3456x2028.png 1272w, https://substackcdn.com/image/fetch/$s_!2uD4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61dfad46-2e1d-42ee-9360-e1a1843155e2_3456x2028.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2uD4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61dfad46-2e1d-42ee-9360-e1a1843155e2_3456x2028.png" width="1456" height="854" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/61dfad46-2e1d-42ee-9360-e1a1843155e2_3456x2028.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:854,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2311315,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/196889438?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61dfad46-2e1d-42ee-9360-e1a1843155e2_3456x2028.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2uD4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61dfad46-2e1d-42ee-9360-e1a1843155e2_3456x2028.png 424w, https://substackcdn.com/image/fetch/$s_!2uD4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61dfad46-2e1d-42ee-9360-e1a1843155e2_3456x2028.png 848w, https://substackcdn.com/image/fetch/$s_!2uD4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61dfad46-2e1d-42ee-9360-e1a1843155e2_3456x2028.png 1272w, https://substackcdn.com/image/fetch/$s_!2uD4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61dfad46-2e1d-42ee-9360-e1a1843155e2_3456x2028.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;a41c4dae-e7ea-4f4c-b288-057fdf8a6ebc&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">=========== sink=file ===========

--- file / no_args ---
variant                   p50        p90        p99          max
stdlib                  6417n      7834n     15000n      129125n
loguru                 14792n     16796n     25750n     1213250n
picologging             5375n      6875n     13293n      110333n
structlog               3917n      4458n      8500n     1334334n
quantpylib-perf          167n       208n       375n       56708n

--- file / 1xint ---
variant                   p50        p90        p99          max
stdlib                  6667n      8500n     15418n      127875n
loguru                 15125n     18042n     29792n      706875n
picologging             5458n      7500n     13667n      131833n
structlog               4542n      4958n     10918n      108833n
quantpylib-perf          167n       208n       292n       10417n

--- file / 3xmixed ---
variant                   p50        p90        p99          max
stdlib                  6625n      7838n     14376n      114458n
loguru                 14875n     15542n     21250n     1903917n
picologging             5500n      5833n     11042n      124791n
structlog               4584n      4792n      8458n       28208n
quantpylib-perf          167n       209n       375n        1208n

--- file / extra ---
variant                   p50        p90        p99          max
stdlib                  7417n      8087n     14501n       29000n
loguru                 15791n     16417n     22000n     1438458n
picologging             5625n      6834n     12583n      112959n
structlog               4542n      4709n      6875n       26708n
quantpylib-perf          292n       334n       750n        1916n

--- file / exception ---
variant                   p50        p90        p99          max
stdlib                 37375n     44834n     68668n     1062792n
loguru                 49083n     60042n     97542n     3616500n
picologging            29458n     32458n     50125n      233792n
structlog              30416n     32167n     40626n     1301708n
quantpylib-perf        22834n     23459n     32667n       78333n

--- file / filtered ---
variant                   p50        p90        p99          max
stdlib                   125n       125n       375n        9083n
loguru                   459n       583n      1500n       24000n
picologging               42n        84n       334n       19958n
structlog               1042n      1084n      1458n       14458n
quantpylib-perf           42n        83n       167n       23667n</code></pre></div><h4>Stdout Sink</h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0zzj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6411ef0-4364-41f4-b794-923ea8835c28_3456x2028.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0zzj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6411ef0-4364-41f4-b794-923ea8835c28_3456x2028.png 424w, https://substackcdn.com/image/fetch/$s_!0zzj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6411ef0-4364-41f4-b794-923ea8835c28_3456x2028.png 848w, https://substackcdn.com/image/fetch/$s_!0zzj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6411ef0-4364-41f4-b794-923ea8835c28_3456x2028.png 1272w, https://substackcdn.com/image/fetch/$s_!0zzj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6411ef0-4364-41f4-b794-923ea8835c28_3456x2028.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0zzj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6411ef0-4364-41f4-b794-923ea8835c28_3456x2028.png" width="1456" height="854" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e6411ef0-4364-41f4-b794-923ea8835c28_3456x2028.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:854,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:3714513,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/196889438?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6411ef0-4364-41f4-b794-923ea8835c28_3456x2028.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!0zzj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6411ef0-4364-41f4-b794-923ea8835c28_3456x2028.png 424w, https://substackcdn.com/image/fetch/$s_!0zzj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6411ef0-4364-41f4-b794-923ea8835c28_3456x2028.png 848w, https://substackcdn.com/image/fetch/$s_!0zzj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6411ef0-4364-41f4-b794-923ea8835c28_3456x2028.png 1272w, https://substackcdn.com/image/fetch/$s_!0zzj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6411ef0-4364-41f4-b794-923ea8835c28_3456x2028.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;ddde7393-b224-4e9a-8d46-bf2350b548fb&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">--- stdout / no_args ---
variant                   p50        p90        p99          max
stdlib                 11000n     13167n     37167n      553916n
loguru                 23833n     28083n    499468n     4076250n
picologging             9167n     10583n     20500n    56333375n
structlog               6083n      8625n     15459n      356625n
quantpylib-perf          167n       500n      1250n       34167n

--- stdout / 1xint ---
variant                   p50        p90        p99          max
stdlib                 11209n     13042n     23877n      197000n
loguru                 23833n     27541n    498848n     5344250n
picologging             8750n     10213n     14792n      212500n
structlog               6709n      8667n     13375n      109334n
quantpylib-perf          167n       542n      1041n       14333n

--- stdout / 3xmixed ---
variant                   p50        p90        p99          max
stdlib                 10959n     12750n     19750n      250958n
loguru                 24250n     29379n    530761n     3686250n
picologging             8958n     10458n     17375n      180542n
structlog               7250n      9042n     18668n      159709n
quantpylib-perf          208n       416n       709n       16166n

--- stdout / extra ---
variant                   p50        p90        p99          max
stdlib                 12958n     15084n     42048n      573750n
loguru                 25583n     29708n    527216n     3164916n
picologging             9042n     10542n     17590n      190875n
structlog               7917n      9625n     17209n       88417n
quantpylib-perf          292n       708n      1208n       40584n

--- stdout / exception ---
variant                   p50        p90        p99          max
stdlib                 68917n     89379n    553959n     3580625n
loguru                 83875n    109721n    816045n     6636292n
picologging            46125n     51625n     66709n     1413083n
structlog              63375n     82712n    591252n     3555583n
quantpylib-perf        24083n     39379n     63922n     1239959n

--- stdout / filtered ---
variant                   p50        p90        p99          max
stdlib                   125n       167n       541n       13500n
loguru                   500n       542n      1125n      119708n
picologging               42n        84n       125n        1042n
structlog               1167n      1625n      9542n      671791n
quantpylib-perf           42n       167n       334n        5292n</code></pre></div><p><strong>Bench Code:</strong></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;b490f35e-6c29-448c-a74b-5a81a09df8a4&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">import os
import sys
import time
import logging
from pathlib import Path

import numpy as np
import matplotlib.pyplot as plt
import quantpylib.logger as qlogger

LOG_FILE = "bench.log"
ITERS = 10_000
PAUSE_MICROS = 10

WORKLOADS = [
    "no_args",
    "1xint",
    "3xmixed",
    "extra",
    "exception",
    "filtered",
]
SINKS = ["file", "stdout"]

def invocations(fn, iters, pause_micros):
    fn() #warmup
    latencies = []
    for _ in range(iters):
        t0 = time.perf_counter_ns()
        fn()
        latencies.append(time.perf_counter_ns() - t0)
        if pause_micros:
            time.sleep(pause_micros / 1_000_000)
    return latencies

void_log = lambda logger: lambda : logger.info("hello")
int_log = lambda logger: lambda : logger.info("x=%d", 42)
mixed_log = lambda logger: lambda : logger.info("fill %d @ %f for %s", 42, 3.14, "btc")
extra_log = lambda logger: lambda : logger.info(
    "fill %d @ %f for %s",
    42,
    3.14,
    "btc",
    extra={"venue": "binance", "tag": "maker", "oid": 1234},
)
filtered_log = lambda logger: lambda : logger.debug("x=%d", 42)

def exception_log(logger):
    def log():
        try:
            1 / 0
        except Exception:
            logger.error(
                "error",
                extra={"exc": qlogger.get_exception(), "stack": qlogger.get_stack()},
            )
    return log

def bench_workloads(logger, iters=ITERS, pause_micros=PAUSE_MICROS):
    return {
        "no_args": invocations(void_log(logger), iters, pause_micros),
        "1xint": invocations(int_log(logger), iters, pause_micros),
        "3xmixed": invocations(mixed_log(logger), iters, pause_micros),
        "extra": invocations(extra_log(logger), iters, pause_micros),
        "exception": invocations(exception_log(logger), iters, pause_micros),
        "filtered": invocations(filtered_log(logger), iters, pause_micros),
    }

def _attach_handler(log, sink, handler_factory):
    for h in list(log.handlers):
        log.removeHandler(h)
    handler = handler_factory(sink)
    log.addHandler(handler)
    log.propagate = False

class LoguruAdapter:
    def __init__(self, logger):
        self._logger = logger

    def debug(self, msg, *args, extra=None):
        self._log("DEBUG", msg, args, extra)

    def info(self, msg, *args, extra=None):
        self._log("INFO", msg, args, extra)

    def error(self, msg, *args, extra=None):
        self._log("ERROR", msg, args, extra)

    def _log(self, level, msg, args, extra):
        logger = self._logger.bind(**extra) if extra else self._logger
        logger.opt(lazy=True).log(level, "{}", lambda: msg % args if args else msg)

class StructlogAdapter:
    def __init__(self, logger):
        self._logger = logger

    def debug(self, msg, *args, extra=None):
        self._log("debug", msg, args, extra)

    def info(self, msg, *args, extra=None):
        self._log("info", msg, args, extra)

    def error(self, msg, *args, extra=None):
        self._log("error", msg, args, extra)

    def _log(self, method, msg, args, extra):
        event = msg % args if args else msg
        kwargs = extra if extra else {}
        getattr(self._logger, method)(event, **kwargs)

def bench_stdlib(sink, log_file, **workload_kwargs):
    log = logging.getLogger("stdlib")
    log.setLevel(logging.INFO)
    def factory(sk):
        h = logging.FileHandler(log_file, mode='a') if sk == "file" else logging.StreamHandler()
        h.setLevel(logging.INFO)
        h.setFormatter(qlogger.JSONFormatter())
        return h
    _attach_handler(log, sink, factory)
    return bench_workloads(log, **workload_kwargs)

def bench_loguru(sink, log_file, **workload_kwargs):
    from loguru import logger
    logger.remove()
    output = log_file if sink == "file" else sys.stdout
    logger.add(output, level="INFO", serialize=True, enqueue=False)
    return bench_workloads(LoguruAdapter(logger), **workload_kwargs)

def bench_picologging(sink, log_file, **workload_kwargs):
    import picologging
    log = picologging.getLogger("picologging")
    log.setLevel(picologging.INFO)
    def factory(sk):
        h = picologging.FileHandler(log_file, mode='a') if sk == "file" else picologging.StreamHandler()
        h.setLevel(picologging.INFO)
        h.setFormatter(qlogger.JSONFormatter())
        return h
    _attach_handler(log, sink, factory)
    return bench_workloads(log, **workload_kwargs)

def bench_structlog(sink, log_file, **workload_kwargs):
    import structlog
    output = open(log_file, "a") if sink == "file" else sys.stdout
    structlog.configure(
        processors=[
            structlog.processors.add_log_level,
            structlog.processors.JSONRenderer(),
        ],
        wrapper_class=structlog.make_filtering_bound_logger(logging.INFO),
        logger_factory=structlog.WriteLoggerFactory(file=output),
        cache_logger_on_first_use=False,
    )
    try:
        return bench_workloads(StructlogAdapter(structlog.get_logger("structlog")), **workload_kwargs)
    finally:
        if sink == "file":
            output.close()

def bench_pylogger(sink, log_file, **workload_kwargs):
    from quantpylib.logger.logger import Logger
    log_path = Path(log_file)
    log = Logger(
        name=sink,
        register_handlers=[],
        stdout_register=(sink == "stdout"),
        stdout_level=logging.INFO,
        file_register=(sink == "file"),
        filename=log_path.name,
        logs_dir=str(log_path.parent or Path(".")),
        file_level=logging.INFO,
    )
    return bench_workloads(log, **workload_kwargs)

def bench_cplogger(sink, log_file, **workload_kwargs):
    from quantpylib.logger import Logger
    log_path = Path(log_file)
    log = Logger(
        # name="perf", defaults to perf
        stdout_register=(sink == "stdout"),
        stdout_level=logging.INFO,
        stdout_formatter_cls=qlogger.JSONFormatter,
        file_register=(sink == "file"),
        filename=log_path.name,
        logs_dir=str(log_path.parent or Path(".")),
        file_level=logging.INFO,
        file_formatter_cls=qlogger.JSONFormatter,
    )
    results = bench_workloads(log, **workload_kwargs)
    return results

def print_table(workload, results, sink):
    print(f"\n--- {sink} / {workload} ---")
    print(f"{'variant':&lt;18} {'p50':&gt;10} {'p90':&gt;10} {'p99':&gt;10} {'max':&gt;12}")
    for variant, data in results.items():
        lats = np.asarray(data[workload])
        print(f"{variant:&lt;18} {np.percentile(lats, 50):&gt;9.0f}n {np.percentile(lats, 90):&gt;9.0f}n {np.percentile(lats, 99):&gt;9.0f}n {np.max(lats):&gt;11.0f}n")

def plot_sink(sink, results):
    cols = 2
    rows = int(np.ceil(len(WORKLOADS) / cols))
    fig, axes = plt.subplots(rows, cols, figsize=(12, 4 * rows))
    for ax, w in zip(axes.flat, WORKLOADS):
        for variant, data in results.items():
            ax.plot(data[w], label=variant, alpha=0.6)
        ax.set_title(w)
        ax.set_xlabel('Iteration')
        ax.set_ylabel('Time (ns)')
        ax.set_yscale('log')
        ax.legend()
    for ax in axes.flat[len(WORKLOADS):]:
        ax.set_visible(False)
    fig.suptitle(f'logger latency: sink={sink}')
    fig.tight_layout()

def main():
    import argparse
    parser = argparse.ArgumentParser()
    parser.add_argument('-sink', '--sink', type=str, help='Specify logging sink = [file, stdout]', choices=SINKS, default='file')
    parser.add_argument("--log-file", type=str, default=LOG_FILE)
    parser.add_argument("--iters", type=int, default=ITERS)
    parser.add_argument("--plot", action=argparse.BooleanOptionalAction, default=True)
    args = parser.parse_args()
    sink = args.sink
    
    if os.path.exists(args.log_file):
        os.remove(args.log_file)

    all_results = {}
    print(f"\n=========== sink={sink} ===========")
    variants = {
        "stdlib": bench_stdlib(sink, args.log_file, iters=args.iters),
        "loguru": bench_loguru(sink, args.log_file, iters=args.iters),
        # "quantpylib-root": bench_pylogger(sink, args.log_file, iters=args.iters),
        "picologging": bench_picologging(sink, args.log_file, iters=args.iters),
        "structlog": bench_structlog(sink, args.log_file, iters=args.iters),
        "quantpylib-perf": bench_cplogger(sink, args.log_file, iters=args.iters),
    }
    all_results[sink] = variants
    
    for w in WORKLOADS:
        print_table(w, all_results[sink], sink)

    if args.plot:
        plot_sink(sink, all_results[sink])
        plt.show()

if __name__ == "__main__":
    main()</code></pre></div>]]></content:encoded></item><item><title><![CDATA[Quantpylib Lighter Integration]]></title><link>https://www.research.hangukquant.com/p/quantpylib-lighter-integration</link><guid isPermaLink="false">https://www.research.hangukquant.com/p/quantpylib-lighter-integration</guid><dc:creator><![CDATA[HangukQuant]]></dc:creator><pubDate>Tue, 28 Apr 2026 13:01:19 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Szif!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80d876fa-5d19-4280-b397-945a592338ab_1896x1634.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Quantpylib now officially supports the Lighter exchange, with <a href="https://github.com/hangukquant/quantpylib/blob/main/examples/example_lighter.py">full example scripts</a>, <a href="https://quantpylib.hangukquant.com/wrappers/lighter/">documentation</a> and gateway compatibility, supporting seamless composability with our <a href="https://quantpylib.hangukquant.com/scripts/market_making/">market making features.</a></p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;c63699f4-6667-46e3-a043-c43bbd0e7977&quot;,&quot;caption&quot;:&quot;&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;HangukQuant quantpylib Github Repo&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:42788676,&quot;name&quot;:&quot;HangukQuant&quot;,&quot;bio&quot;:&quot;quant research and quant dev. not financial advice.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2023-11-24T16:59:27.729Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.research.hangukquant.com/p/hangukquant-community-github-repo&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:139132009,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:29,&quot;comment_count&quot;:0,&quot;publication_id&quot;:453792,&quot;publication_name&quot;:&quot;HangukQuant Research&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!LX9y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc5718e3-074f-4c1d-a77d-f1fa609a9ea0_1280x1280.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p></p><p>The Lighter SDK is designed to be both performance aware and intuitive, presenting a significantly improved interface over the <a href="https://github.com/elliottech/lighter-python">official package.</a> See full docs here: </p><p><a href="https://quantpylib.hangukquant.com/wrappers/lighter/">https://quantpylib.hangukquant.com/wrappers/lighter/</a></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Szif!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80d876fa-5d19-4280-b397-945a592338ab_1896x1634.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Szif!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80d876fa-5d19-4280-b397-945a592338ab_1896x1634.png 424w, https://substackcdn.com/image/fetch/$s_!Szif!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80d876fa-5d19-4280-b397-945a592338ab_1896x1634.png 848w, https://substackcdn.com/image/fetch/$s_!Szif!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80d876fa-5d19-4280-b397-945a592338ab_1896x1634.png 1272w, https://substackcdn.com/image/fetch/$s_!Szif!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80d876fa-5d19-4280-b397-945a592338ab_1896x1634.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Szif!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80d876fa-5d19-4280-b397-945a592338ab_1896x1634.png" width="1456" height="1255" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/80d876fa-5d19-4280-b397-945a592338ab_1896x1634.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1255,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1069769,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/195745940?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80d876fa-5d19-4280-b397-945a592338ab_1896x1634.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Szif!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80d876fa-5d19-4280-b397-945a592338ab_1896x1634.png 424w, https://substackcdn.com/image/fetch/$s_!Szif!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80d876fa-5d19-4280-b397-945a592338ab_1896x1634.png 848w, https://substackcdn.com/image/fetch/$s_!Szif!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80d876fa-5d19-4280-b397-945a592338ab_1896x1634.png 1272w, https://substackcdn.com/image/fetch/$s_!Szif!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80d876fa-5d19-4280-b397-945a592338ab_1896x1634.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>and our market making tutorial here:</p><p><a href="https://quantpylib.hangukquant.com/scripts/market_making/">https://quantpylib.hangukquant.com/scripts/market_making/</a></p><p><strong>We will update our polymarket SDK to follow the v2 integration soon.</strong></p><p>Cheers!</p>]]></content:encoded></item><item><title><![CDATA[Quantpylib RWA Integration (Databento)]]></title><link>https://www.research.hangukquant.com/p/quantpylib-rwa-integration-databento</link><guid isPermaLink="false">https://www.research.hangukquant.com/p/quantpylib-rwa-integration-databento</guid><dc:creator><![CDATA[HangukQuant]]></dc:creator><pubDate>Fri, 17 Apr 2026 13:37:34 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!IhGk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb69ab3ea-d793-49bf-8434-da6324196d2a_2682x1960.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Our research blog&#8217;s lifetime subscription is available at 40% off for another 3 days.</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;c5410b1f-5a98-45cc-96c4-f627a0559884&quot;,&quot;caption&quot;:&quot;&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;40% off Lifetime, 7 Days&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:42788676,&quot;name&quot;:&quot;HangukQuant&quot;,&quot;bio&quot;:&quot;quant research and quant dev. not financial advice.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2026-04-13T13:31:15.928Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!W_yf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d6dd49f-6f37-4dbb-a3be-49495a7bef32_1316x662.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.research.hangukquant.com/p/40-off-lifetime-7-days&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:194069197,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:7,&quot;comment_count&quot;:0,&quot;publication_id&quot;:453792,&quot;publication_name&quot;:&quot;HangukQuant Research&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!LX9y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc5718e3-074f-4c1d-a77d-f1fa609a9ea0_1280x1280.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>As a continuation of the hip-3 perp dex integrations, </p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;f67ce6a7-bbc0-4d3b-824e-f0c297f82d00&quot;,&quot;caption&quot;:&quot;&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Quantpylib Update (hyperliquid docs, examples and ws)&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:42788676,&quot;name&quot;:&quot;HangukQuant&quot;,&quot;bio&quot;:&quot;quant research and quant dev. not financial advice.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2026-04-06T13:25:50.880Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!9jK9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a94e48c-5ace-411e-be3a-a32e3f778e60_1783x1396.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.research.hangukquant.com/p/quantpylib-update-hyperliquid-docs&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:193349933,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:4,&quot;comment_count&quot;:0,&quot;publication_id&quot;:453792,&quot;publication_name&quot;:&quot;HangukQuant Research&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!LX9y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc5718e3-074f-4c1d-a77d-f1fa609a9ea0_1280x1280.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>quantpylib now features Databento&#8217;s live dataset integration with the same init-subscribe-handler pipeline:</p><p><br><strong><a href="https://quantpylib.hangukquant.com/wrappers/databento/">See docs and example script here:</a></strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!IhGk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb69ab3ea-d793-49bf-8434-da6324196d2a_2682x1960.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!IhGk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb69ab3ea-d793-49bf-8434-da6324196d2a_2682x1960.png 424w, https://substackcdn.com/image/fetch/$s_!IhGk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb69ab3ea-d793-49bf-8434-da6324196d2a_2682x1960.png 848w, https://substackcdn.com/image/fetch/$s_!IhGk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb69ab3ea-d793-49bf-8434-da6324196d2a_2682x1960.png 1272w, https://substackcdn.com/image/fetch/$s_!IhGk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb69ab3ea-d793-49bf-8434-da6324196d2a_2682x1960.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!IhGk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb69ab3ea-d793-49bf-8434-da6324196d2a_2682x1960.png" width="1456" height="1064" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b69ab3ea-d793-49bf-8434-da6324196d2a_2682x1960.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1064,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:652581,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/194517911?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb69ab3ea-d793-49bf-8434-da6324196d2a_2682x1960.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!IhGk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb69ab3ea-d793-49bf-8434-da6324196d2a_2682x1960.png 424w, https://substackcdn.com/image/fetch/$s_!IhGk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb69ab3ea-d793-49bf-8434-da6324196d2a_2682x1960.png 848w, https://substackcdn.com/image/fetch/$s_!IhGk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb69ab3ea-d793-49bf-8434-da6324196d2a_2682x1960.png 1272w, https://substackcdn.com/image/fetch/$s_!IhGk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb69ab3ea-d793-49bf-8434-da6324196d2a_2682x1960.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>We have also improved the order tracking features of our OMS utility library. To learn how to experiment with <em>market making in just 300 lines of code</em> with quantpylib, <a href="https://quantpylib.hangukquant.com/scripts/market_making/">see our tutorial here.</a></p><p></p>]]></content:encoded></item><item><title><![CDATA[40% off Lifetime, 7 Days]]></title><link>https://www.research.hangukquant.com/p/40-off-lifetime-7-days</link><guid isPermaLink="false">https://www.research.hangukquant.com/p/40-off-lifetime-7-days</guid><dc:creator><![CDATA[HangukQuant]]></dc:creator><pubDate>Mon, 13 Apr 2026 13:31:15 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!W_yf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d6dd49f-6f37-4dbb-a3be-49495a7bef32_1316x662.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>It&#8217;s been <strong>half a decade</strong> now that I&#8217;ve been doing my &#8216;cute little journaling&#8217;, and I can&#8217;t believe more than 10 thousand people tune into my thoughts. <br><br>What do you have to say, Ms. Lee from econs class, who never said I&#8217;d amount to anything?</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!W_yf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d6dd49f-6f37-4dbb-a3be-49495a7bef32_1316x662.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!W_yf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d6dd49f-6f37-4dbb-a3be-49495a7bef32_1316x662.png 424w, https://substackcdn.com/image/fetch/$s_!W_yf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d6dd49f-6f37-4dbb-a3be-49495a7bef32_1316x662.png 848w, https://substackcdn.com/image/fetch/$s_!W_yf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d6dd49f-6f37-4dbb-a3be-49495a7bef32_1316x662.png 1272w, https://substackcdn.com/image/fetch/$s_!W_yf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d6dd49f-6f37-4dbb-a3be-49495a7bef32_1316x662.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!W_yf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d6dd49f-6f37-4dbb-a3be-49495a7bef32_1316x662.png" width="1316" height="662" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7d6dd49f-6f37-4dbb-a3be-49495a7bef32_1316x662.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:662,&quot;width&quot;:1316,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:485958,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/194069197?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d6dd49f-6f37-4dbb-a3be-49495a7bef32_1316x662.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!W_yf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d6dd49f-6f37-4dbb-a3be-49495a7bef32_1316x662.png 424w, https://substackcdn.com/image/fetch/$s_!W_yf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d6dd49f-6f37-4dbb-a3be-49495a7bef32_1316x662.png 848w, https://substackcdn.com/image/fetch/$s_!W_yf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d6dd49f-6f37-4dbb-a3be-49495a7bef32_1316x662.png 1272w, https://substackcdn.com/image/fetch/$s_!W_yf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d6dd49f-6f37-4dbb-a3be-49495a7bef32_1316x662.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">each one of you helped me to smush Ms Lee&#8217;s face</figcaption></figure></div><p>I sincerely appreciate each and everyone of you.</p><p>Anyway, I received a handful of DM&#8217;s recently asking for &#8216;special arrangements&#8217; for access to read the work. I am very flattered, but I thought I shall share the link publicly.</p><p>Let&#8217;s start with <em><strong><a href="https://www.research.hangukquant.com/">this</a></strong><a href="https://www.research.hangukquant.com/"> very blog</a>.</em> I&#8217;ll create the other links to other resources such as lectures and repo when there are enough people asking for it.</p><p>So, 7 Days, 40% off the Lifetime Access.</p><p><a href="https://buy.stripe.com/dRm3cw0mC05N6Am3XKe7m0f">https://buy.stripe.com/dRm3cw0mC05N6Am3XKe7m0f</a><br><br>That&#8217;s all for this post. As promised, Lighter gateway will be integrated over the coming days.</p><p>Look forward to having you&#8230;. for the next 5 years.</p><p></p><p>A Cat.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1543852786-1cf6624b9987?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxNXx8Y2F0fGVufDB8fHx8MTc3NjA4Njk4OXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1543852786-1cf6624b9987?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxNXx8Y2F0fGVufDB8fHx8MTc3NjA4Njk4OXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1543852786-1cf6624b9987?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxNXx8Y2F0fGVufDB8fHx8MTc3NjA4Njk4OXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1543852786-1cf6624b9987?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxNXx8Y2F0fGVufDB8fHx8MTc3NjA4Njk4OXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1543852786-1cf6624b9987?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxNXx8Y2F0fGVufDB8fHx8MTc3NjA4Njk4OXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1543852786-1cf6624b9987?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxNXx8Y2F0fGVufDB8fHx8MTc3NjA4Njk4OXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080" width="332" height="498" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1543852786-1cf6624b9987?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxNXx8Y2F0fGVufDB8fHx8MTc3NjA4Njk4OXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:6000,&quot;width&quot;:4000,&quot;resizeWidth&quot;:332,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;brown tabby cat&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="brown tabby cat" title="brown tabby cat" srcset="https://images.unsplash.com/photo-1543852786-1cf6624b9987?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxNXx8Y2F0fGVufDB8fHx8MTc3NjA4Njk4OXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1543852786-1cf6624b9987?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxNXx8Y2F0fGVufDB8fHx8MTc3NjA4Njk4OXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1543852786-1cf6624b9987?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxNXx8Y2F0fGVufDB8fHx8MTc3NjA4Njk4OXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1543852786-1cf6624b9987?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxNXx8Y2F0fGVufDB8fHx8MTc3NjA4Njk4OXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"></figcaption></figure></div><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Optimising the hyperliquid-python-sdk]]></title><description><![CDATA[Getting 2.5ms order signing to <0.1ms.]]></description><link>https://www.research.hangukquant.com/p/optimising-the-hyperliquid-python</link><guid isPermaLink="false">https://www.research.hangukquant.com/p/optimising-the-hyperliquid-python</guid><dc:creator><![CDATA[HangukQuant]]></dc:creator><pubDate>Sun, 12 Apr 2026 12:31:42 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!XjkE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2a2bb3d-6247-427e-b6a3-b6b0ee5a353f_996x400.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The following are all implemented optimizations <a href="https://quantpylib.hangukquant.com/wrappers/hyperliquid/">in the quantpylib&#8217;s hyperliquid wrapper.</a><br><br>For a pedestrian signing of a hyperliquid l1-payload such as order actions, the latency cost is a <strong>couple of ms</strong>. Over a simple experiment of 1000 iterations, a rough latency percentile benchmark gives <strong>2.39-2.57ms in p50-p99 latency.</strong></p><p>That is <strong>practically the network latency</strong> of getting a market data payload from Binance through a cdn, which you might be doing if you are a mm anyway.</p><p>We can do much better.</p><p>In instances <strong>where orders are not preemptively signed,</strong> order signing lives directly on the hot path. Hyperliquid&#8217;s signing path (from <a href="https://github.com/hyperliquid-dex/hyperliquid-python-sdk/blob/master/hyperliquid/utils/signing.py">signing.py)</a> is a pipeline of <strong>canonicalization and hashing</strong></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2K9v!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a59f506-41e6-4ae3-8a06-e85f6484b97f_1010x200.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2K9v!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a59f506-41e6-4ae3-8a06-e85f6484b97f_1010x200.png 424w, https://substackcdn.com/image/fetch/$s_!2K9v!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a59f506-41e6-4ae3-8a06-e85f6484b97f_1010x200.png 848w, https://substackcdn.com/image/fetch/$s_!2K9v!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a59f506-41e6-4ae3-8a06-e85f6484b97f_1010x200.png 1272w, https://substackcdn.com/image/fetch/$s_!2K9v!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a59f506-41e6-4ae3-8a06-e85f6484b97f_1010x200.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2K9v!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a59f506-41e6-4ae3-8a06-e85f6484b97f_1010x200.png" width="1010" height="200" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6a59f506-41e6-4ae3-8a06-e85f6484b97f_1010x200.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:200,&quot;width&quot;:1010,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:54603,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/193941794?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a59f506-41e6-4ae3-8a06-e85f6484b97f_1010x200.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2K9v!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a59f506-41e6-4ae3-8a06-e85f6484b97f_1010x200.png 424w, https://substackcdn.com/image/fetch/$s_!2K9v!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a59f506-41e6-4ae3-8a06-e85f6484b97f_1010x200.png 848w, https://substackcdn.com/image/fetch/$s_!2K9v!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a59f506-41e6-4ae3-8a06-e85f6484b97f_1010x200.png 1272w, https://substackcdn.com/image/fetch/$s_!2K9v!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a59f506-41e6-4ae3-8a06-e85f6484b97f_1010x200.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!XjkE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2a2bb3d-6247-427e-b6a3-b6b0ee5a353f_996x400.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!XjkE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2a2bb3d-6247-427e-b6a3-b6b0ee5a353f_996x400.png 424w, https://substackcdn.com/image/fetch/$s_!XjkE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2a2bb3d-6247-427e-b6a3-b6b0ee5a353f_996x400.png 848w, https://substackcdn.com/image/fetch/$s_!XjkE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2a2bb3d-6247-427e-b6a3-b6b0ee5a353f_996x400.png 1272w, https://substackcdn.com/image/fetch/$s_!XjkE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2a2bb3d-6247-427e-b6a3-b6b0ee5a353f_996x400.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!XjkE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2a2bb3d-6247-427e-b6a3-b6b0ee5a353f_996x400.png" width="996" height="400" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c2a2bb3d-6247-427e-b6a3-b6b0ee5a353f_996x400.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:400,&quot;width&quot;:996,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:79588,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/193941794?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2a2bb3d-6247-427e-b6a3-b6b0ee5a353f_996x400.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!XjkE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2a2bb3d-6247-427e-b6a3-b6b0ee5a353f_996x400.png 424w, https://substackcdn.com/image/fetch/$s_!XjkE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2a2bb3d-6247-427e-b6a3-b6b0ee5a353f_996x400.png 848w, https://substackcdn.com/image/fetch/$s_!XjkE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2a2bb3d-6247-427e-b6a3-b6b0ee5a353f_996x400.png 1272w, https://substackcdn.com/image/fetch/$s_!XjkE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2a2bb3d-6247-427e-b6a3-b6b0ee5a353f_996x400.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>EIP-712 encoding</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uh6Y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924d91c7-505b-4a0c-a25d-06c2760c995c_996x898.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uh6Y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924d91c7-505b-4a0c-a25d-06c2760c995c_996x898.png 424w, https://substackcdn.com/image/fetch/$s_!uh6Y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924d91c7-505b-4a0c-a25d-06c2760c995c_996x898.png 848w, https://substackcdn.com/image/fetch/$s_!uh6Y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924d91c7-505b-4a0c-a25d-06c2760c995c_996x898.png 1272w, https://substackcdn.com/image/fetch/$s_!uh6Y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924d91c7-505b-4a0c-a25d-06c2760c995c_996x898.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uh6Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924d91c7-505b-4a0c-a25d-06c2760c995c_996x898.png" width="996" height="898" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/924d91c7-505b-4a0c-a25d-06c2760c995c_996x898.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:898,&quot;width&quot;:996,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:130343,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/193941794?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924d91c7-505b-4a0c-a25d-06c2760c995c_996x898.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!uh6Y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924d91c7-505b-4a0c-a25d-06c2760c995c_996x898.png 424w, https://substackcdn.com/image/fetch/$s_!uh6Y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924d91c7-505b-4a0c-a25d-06c2760c995c_996x898.png 848w, https://substackcdn.com/image/fetch/$s_!uh6Y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924d91c7-505b-4a0c-a25d-06c2760c995c_996x898.png 1272w, https://substackcdn.com/image/fetch/$s_!uh6Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F924d91c7-505b-4a0c-a25d-06c2760c995c_996x898.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>and finally, secp256k1 signing.</strong></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!UD7f!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24ffba2f-66a2-4655-8516-946671a2d60b_1002x160.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!UD7f!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24ffba2f-66a2-4655-8516-946671a2d60b_1002x160.png 424w, https://substackcdn.com/image/fetch/$s_!UD7f!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24ffba2f-66a2-4655-8516-946671a2d60b_1002x160.png 848w, https://substackcdn.com/image/fetch/$s_!UD7f!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24ffba2f-66a2-4655-8516-946671a2d60b_1002x160.png 1272w, https://substackcdn.com/image/fetch/$s_!UD7f!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24ffba2f-66a2-4655-8516-946671a2d60b_1002x160.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!UD7f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24ffba2f-66a2-4655-8516-946671a2d60b_1002x160.png" width="1002" height="160" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/24ffba2f-66a2-4655-8516-946671a2d60b_1002x160.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:160,&quot;width&quot;:1002,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:94830,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/193941794?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24ffba2f-66a2-4655-8516-946671a2d60b_1002x160.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!UD7f!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24ffba2f-66a2-4655-8516-946671a2d60b_1002x160.png 424w, https://substackcdn.com/image/fetch/$s_!UD7f!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24ffba2f-66a2-4655-8516-946671a2d60b_1002x160.png 848w, https://substackcdn.com/image/fetch/$s_!UD7f!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24ffba2f-66a2-4655-8516-946671a2d60b_1002x160.png 1272w, https://substackcdn.com/image/fetch/$s_!UD7f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24ffba2f-66a2-4655-8516-946671a2d60b_1002x160.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Optimising this pipeline is a simple matter of appreciating the schema of an EIP712 payload, Ethereum&#8217;s structured-data signing format. The signer is given a typed message with 4 pieces:</p><ul><li><p><code>domain</code>: identifies the application / signing domain</p></li><li><p><code>types</code>: declares the schema of the message</p></li><li><p><code>primaryType</code>: the top-level struct being signed</p></li><li><p><code>message</code>: the actual field values</p></li></ul><p>The eth-account takes <code>encode_typed_data</code> of these components and produces a <code>SignableMessage</code>. On each order sign, it hashes the type definition of the EIP712 domain, performs ABI validation, obtains the domain separator, computes the Agent type hash - all of which are static. </p><p>The dynamic fields go into a tiny component, the connection-id and agent hash, which is part of the final digest:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;d58848f0-701d-4c5d-b11f-a950c358c2c4&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">keccak(&#8221;\x19\x01&#8221; || domain_separator || struct_hash)</code></pre></div><p>a 32-byte digest signed by secp256k1. Between parsing the schema, walking the dictionary fields, ABI encoding and object creation/allocation - most of which are static per order - our hot path is not so hot anymore. If we can surgically stick to hashing only the dynamic components, our working set is a lot smaller.</p><p>Last but not least, significant performance degradations arise when we rely on native eth-account backend to perform signing. Elliptic curve signing relies on mathematically nontrivial operations, requiring large-integer modular arithmetic and scalar multiplication. </p><p><strong>Following the &#8216;everything is object&#8217; design</strong>, simple arithmetic such as &#8216;+&#8217; requires namespace lookup, operator dispatch, pointer chasing, heap allocation and refcount churn in Python - cryptographic operations implemented at the Python layer is terrible news for low latency code.</p><blockquote><p>Wow, Everything is Computer - President Donald Trump</p><p>Wow, Everything is Object - Python Engineer</p></blockquote><p>Again, appreciating this truth is 90% of the job done - we can find solutions to push the cryptographic work from Python runtime into a secp256k1 backend optimised in C, such as the <a href="https://github.com/bitcoin-core/secp256k1">bitcoin-core library.</a> Writing a tiny Python binding around it is the remaining 10%&#8230;oh wait, <a href="https://github.com/ofek/coincurve">it already exists.</a></p><p>Bringing it all together, we can now replace our <code>sign_l1_action</code> with <code>sign_l1_action_fast</code>. </p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;fff80744-758b-404d-8fd8-7d98a0733dfe&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">from coincurve import PrivateKey

_EIP712DOMAIN_TYPEHASH = keccak(b"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)")
_DOMAIN_SEPARATOR = keccak(
    _EIP712DOMAIN_TYPEHASH
    + keccak(b"Exchange")
    + keccak(b"1")
    + (1337).to_bytes(32, "big")
    + b'\x00' * 32
)
_AGENT_TYPEHASH = keccak(b"Agent(string source,bytes32 connectionId)")
_SOURCE_A = keccak(b"a")
_SOURCE_B = keccak(b"b")

def sign_l1_action_fast(ccwallet, action, vault_prefix, nonce, source_prefix, expires_after):
    data = msgpack.packb(action)
    data += nonce.to_bytes(8, "big")
    data += vault_prefix
    if expires_after is not None:
        data += b"\x00" + expires_after.to_bytes(8, "big")
    connection_id = keccak(data)
    agent_hash = keccak(_AGENT_TYPEHASH + source_prefix + connection_id)
    digest = keccak(b"\x19\x01" + _DOMAIN_SEPARATOR + agent_hash)
    sig = ccwallet.sign_recoverable(digest, hasher=None)
    return {"r": to_hex(sig[:32]), "s": to_hex(sig[32:64]), "v": sig[64] + 27}

class Hyperliquid:
    def __init__(self...):
        ...
        self.ccwallet = PrivateKey(self.wallet.key)
        self._vault_prefix = b"\x00" if self.vault_address is None else (b"\x01" + address_to_bytes(self.vault_address))
        self._src_prefix = _SOURCE_A if self.is_mainnet else _SOURCE_B</code></pre></div><p>and there we go! Using a faster implementation of cryptographic signatures is most of the speedup, giving us <strong>0.29-0.32ms </strong>in the same experiment. Using the pre-computed cache values gives a further 4-fold speedup, @ <strong>0.08-0.09ms.</strong></p><p><em>And that wasn&#8217;t even that hard&#8230;a simple trick in the Python Houdini</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ELEQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd6ba83-5efe-4ea5-b843-2a6280ecc467_500x500.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ELEQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd6ba83-5efe-4ea5-b843-2a6280ecc467_500x500.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ELEQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd6ba83-5efe-4ea5-b843-2a6280ecc467_500x500.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ELEQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd6ba83-5efe-4ea5-b843-2a6280ecc467_500x500.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ELEQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd6ba83-5efe-4ea5-b843-2a6280ecc467_500x500.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ELEQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd6ba83-5efe-4ea5-b843-2a6280ecc467_500x500.jpeg" width="500" height="500" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cbd6ba83-5efe-4ea5-b843-2a6280ecc467_500x500.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:500,&quot;width&quot;:500,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ELEQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd6ba83-5efe-4ea5-b843-2a6280ecc467_500x500.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ELEQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd6ba83-5efe-4ea5-b843-2a6280ecc467_500x500.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ELEQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd6ba83-5efe-4ea5-b843-2a6280ecc467_500x500.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ELEQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd6ba83-5efe-4ea5-b843-2a6280ecc467_500x500.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div>]]></content:encoded></item><item><title><![CDATA[2 Years, 1M PnL and Life as a Solo Crypto Quant]]></title><description><![CDATA[Road to 50 Sharpe]]></description><link>https://www.research.hangukquant.com/p/2-years-1m-pnl-and-life-as-a-solo</link><guid isPermaLink="false">https://www.research.hangukquant.com/p/2-years-1m-pnl-and-life-as-a-solo</guid><dc:creator><![CDATA[HangukQuant]]></dc:creator><pubDate>Fri, 10 Apr 2026 16:15:21 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Lvvp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e6fa10f-5aa8-4f78-89e1-1eae828b892e_1200x480.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Lvvp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e6fa10f-5aa8-4f78-89e1-1eae828b892e_1200x480.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Lvvp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e6fa10f-5aa8-4f78-89e1-1eae828b892e_1200x480.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Lvvp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e6fa10f-5aa8-4f78-89e1-1eae828b892e_1200x480.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Lvvp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e6fa10f-5aa8-4f78-89e1-1eae828b892e_1200x480.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Lvvp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e6fa10f-5aa8-4f78-89e1-1eae828b892e_1200x480.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Lvvp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e6fa10f-5aa8-4f78-89e1-1eae828b892e_1200x480.jpeg" width="1200" height="480" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4e6fa10f-5aa8-4f78-89e1-1eae828b892e_1200x480.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:480,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Image&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Image" title="Image" srcset="https://substackcdn.com/image/fetch/$s_!Lvvp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e6fa10f-5aa8-4f78-89e1-1eae828b892e_1200x480.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Lvvp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e6fa10f-5aa8-4f78-89e1-1eae828b892e_1200x480.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Lvvp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e6fa10f-5aa8-4f78-89e1-1eae828b892e_1200x480.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Lvvp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e6fa10f-5aa8-4f78-89e1-1eae828b892e_1200x480.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This is a <a href="https://x.com/HangukQuant/status/2042545298875318397">RT of an article I wrote on X.</a></p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;c96dcaf4-dbe8-4aa3-a129-333f2dfa0e3c&quot;,&quot;caption&quot;:&quot;&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Crypto Arbitrage (1 Week Setup) - Coming&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:42788676,&quot;name&quot;:&quot;HangukQuant&quot;,&quot;bio&quot;:&quot;quant research and quant dev. not financial advice.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2024-04-09T18:29:01.571Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!Tv3A!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89ff058b-13b5-4053-b93f-846e27a1a13c_2889x1456.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.research.hangukquant.com/p/crypto-arbitrage-1-week-setup-coming&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:143424317,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:13,&quot;comment_count&quot;:3,&quot;publication_id&quot;:453792,&quot;publication_name&quot;:&quot;HangukQuant Research&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!LX9y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc5718e3-074f-4c1d-a77d-f1fa609a9ea0_1280x1280.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>Exactly 2 years ago, on this date - I took a step into the treacherous crypto order books. My first foray into crypto trading was a quasi systematic funding arbitrage strategy, which I executed by hand using some spaghetti code dashboard to filter for funding pairs on binance-hyperliquid.</p><h2><strong>1 to 10 Sharpe</strong></h2><p>In those days, funding arbitrage was already a well known strategy, but execution, variation and reach played a big factor in realised APR. New exchanges seemed to be budding left and right, with unique funding mechanisms.<br><br>This pushed me to quickly build out more exchange connectors and a gateway functionality that would allow me to automate funding arbitrage strategies across multiple exchanges in a unified interface, which would later turn out to be <a href="https://quantpylib.hangukquant.com/">the quantpylib project</a>, a code repo started by my followers and then later lead by me to be a tool for both quantitative research and trading. </p><p>At this point, other projects like ccxt and hummingbot existed, but the quantpylib project focused more on <em>connectivity and composability of features </em>without relying on an architectural framework, allowing traders with variable strategies to implement high to low frequency strategies according to their needs. It integrated binance, bybit, woox, paradex and lighter, exchanges I executed arbs across. 2.5 years later and 1000+ commits later, <em>quantpylib</em> is still a work in progress.<br><br>I had decent reach and okay execution, enough to land me in the <a href="https://x.com/HangukQuant/status/2004453365988904971?s=20">40% APR range,</a> while earning points - which ironically turned out to be even more lucrative than the pnl itself, all thanks to The El Jeffe crew. These days, with tools like <a href="https://x.com/@LorisTools">@LorisTools</a>, the scale and reach of such arbitrage strategies are extensive.</p><p>Despite the ~10 Sharpe, it was a strategy with extremely low vol, and scaling the pnl meant I had to put more of my <em>already small net worth</em> on chain, a risk I was not willing to take. It also took many man hours of attention, taking time away from investing in my own technical capabilities. In young, 'skilled' workers, knowledge compounds over the remaining career lifespan.</p><h2><strong>I shut it down.</strong></h2><p>At the same time, I  was in a desperate struggle with my own mental faculties.  I was, at heart, a builder. I built things in public, in an industry where large doses of skepticism were warranted. <em>I had the imposter syndrome bug. Was I just a peddler of snake oil?  </em>Some people (including those I admired) and the anti-substack mob seemed to think so. </p><p><em>Hanguk&#8217;s income is from his newsletter. All he can do is implement a momentum trading strategy. I find it funny that Hanguk teaches systematic funding arbitrage but has to record pnl manually. </em></p><p><em>You write on a blog, I do this for a living, I would know.</em></p><p>I saw it in X replies, Discord channels, Reddit communities. Maybe I am just a fucking fraud, and I will never be <em>that guy. </em>After all, trading is an incredibly competitive industry, and greater man than me have failed. I am still young, and I can still pivot into being a quant trader where all my friends are. I could get referrals, I would be &#8216;in the industry&#8217; and I won&#8217;t have to deal with all these bullshit.</p><p>These dark thoughts would later crescendo into anxiety and panic attacks. By all counts, my &#8216;online blog&#8217; was bringing me 200k+ in ARR, and my trading was comparably rewarding. I was living my life. <em>I once had no income and no pnl, and had an unshakeable confidence that I would &#8216;figure it out&#8217;. </em>Having somewhat <em>figured it out, </em>it turned out that there were many cracks in this facade. Crypto strats were going to be squeezed by TradFi, and AI was going to wipe me out, who needs &#8216;research&#8217; when everyone had a PhD-expert on their fingertips?</p><h2><strong>Wakeup, Doomer</strong></h2><p>The truth is, there were many people supporting me. For every nasty comment, there were ten others who cheered my work on. </p><p>Claude Mythos, OpenGod or whatever - I was well equipped and adaptable enough to thrive in a post-intelligent economy. I spent some time talking to my Dad, who had the wisdom of life to slap the doomer out of me. </p><p>It&#8217;s all in your head.</p><p>I got over it by biasing towards action. Day after day, I would wake up in sweats and palpitations, and before the darkness paralysed me, I would have done a handful of pushups, hopped in the shower, and was headed out to write some code. If I kept moving, it couldn&#8217;t catch me. It took a few months, and slowly but surely, I was okay again. </p><p>Fear is good marketing. Do not be the product.</p><h2><strong>10 to 50 Sharpe</strong></h2><p>In the months to follow, I would have the most productive schedule of my life. <br>I had always wanted to go from mid-frequency to high-frequency strategies. I wanted to be knowledgeable in niche domains and be a respected engineer. There was a lot more to learn, and my mind was liberated.</p><p>I worked on hft research, tooling, infrastructure and trading. I built new features on quantpylib, picked up C++, sharpened my mathematical knowledge and was allowed to be dumb again.<br><br>I was new, and publicly so.  It had been awhile, but I was in love again. I read, I experimented, I asked and made mistakes. I basked in the wealth of knowledge. I didn&#8217;t have a PhD at my fingertips to replace me. I had one to teach me.<br><br>The best way to learn is by doing. In my frenzy of learning, researching and experimenting, I arrived at my next gold mine. Months of research, screaming at the monitor - I got my next reward, my first (successful, I had many unsuccessful ones) HFT strategy:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DCQT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37882aa6-a6af-4b45-8549-8985ff1ee9a0_900x506.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DCQT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37882aa6-a6af-4b45-8549-8985ff1ee9a0_900x506.jpeg 424w, https://substackcdn.com/image/fetch/$s_!DCQT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37882aa6-a6af-4b45-8549-8985ff1ee9a0_900x506.jpeg 848w, https://substackcdn.com/image/fetch/$s_!DCQT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37882aa6-a6af-4b45-8549-8985ff1ee9a0_900x506.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!DCQT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37882aa6-a6af-4b45-8549-8985ff1ee9a0_900x506.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DCQT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37882aa6-a6af-4b45-8549-8985ff1ee9a0_900x506.jpeg" width="900" height="506" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/37882aa6-a6af-4b45-8549-8985ff1ee9a0_900x506.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:506,&quot;width&quot;:900,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Image&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Image" title="Image" srcset="https://substackcdn.com/image/fetch/$s_!DCQT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37882aa6-a6af-4b45-8549-8985ff1ee9a0_900x506.jpeg 424w, https://substackcdn.com/image/fetch/$s_!DCQT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37882aa6-a6af-4b45-8549-8985ff1ee9a0_900x506.jpeg 848w, https://substackcdn.com/image/fetch/$s_!DCQT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37882aa6-a6af-4b45-8549-8985ff1ee9a0_900x506.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!DCQT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37882aa6-a6af-4b45-8549-8985ff1ee9a0_900x506.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I consistently topped the leaderboards, fin-fluencers were writing nonsense threads about me, and I felt ... vindicated.</p><h3>Sunset</h3><p>When the sun rises, it must set. </p><blockquote><p>There&#8217;s no such thing as the goose that lays the golden egg forever. - Jim Simons, Renaissance Technologies</p></blockquote><p>Nowadays, I battle with the immortality of the goose. I hesitated if I should write this article. I&#8217;m hanging in there, but I am no longer a leaderboard resident.</p><p>As the sun sets, I am dumb again. But there is more iron in me.</p>]]></content:encoded></item><item><title><![CDATA[Quantpylib Update (hyperliquid docs, examples and ws)]]></title><link>https://www.research.hangukquant.com/p/quantpylib-update-hyperliquid-docs</link><guid isPermaLink="false">https://www.research.hangukquant.com/p/quantpylib-update-hyperliquid-docs</guid><dc:creator><![CDATA[HangukQuant]]></dc:creator><pubDate>Mon, 06 Apr 2026 13:25:50 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!9jK9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a94e48c-5ace-411e-be3a-a32e3f778e60_1783x1396.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Regarding quantpylib:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;fe0ff446-c3ab-4c46-8c9d-8831a3624f28&quot;,&quot;caption&quot;:&quot;&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;HangukQuant quantpylib Github Repo&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:42788676,&quot;name&quot;:&quot;HangukQuant&quot;,&quot;bio&quot;:&quot;quant research and quant dev. not financial advice.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2023-11-24T16:59:27.729Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.research.hangukquant.com/p/hangukquant-community-github-repo&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:139132009,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:29,&quot;comment_count&quot;:1,&quot;publication_id&quot;:453792,&quot;publication_name&quot;:&quot;HangukQuant Research&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!LX9y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc5718e3-074f-4c1d-a77d-f1fa609a9ea0_1280x1280.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>Following our last update -</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;57488680-45b6-4f49-8d04-9c25992445ed&quot;,&quot;caption&quot;:&quot;&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Quantpylib Update (hyperliquid sdk)&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:42788676,&quot;name&quot;:&quot;HangukQuant&quot;,&quot;bio&quot;:&quot;quant research and quant dev. not financial advice.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2026-03-29T17:01:07.189Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!dgla!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff692bc95-032a-45b7-8a26-71c0dcb27375_2569x1567.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.research.hangukquant.com/p/quantpylib-update-hyperliquid-sdk&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:192522990,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:13,&quot;comment_count&quot;:0,&quot;publication_id&quot;:453792,&quot;publication_name&quot;:&quot;HangukQuant Research&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!LX9y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc5718e3-074f-4c1d-a77d-f1fa609a9ea0_1280x1280.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>The full list of new websocket channels, hip-3 dex integrations, example script and documentation has been pushed.</p><p>You may refer to them here:<br><a href="https://quantpylib.hangukquant.com/wrappers/hyperliquid/">https://quantpylib.hangukquant.com/wrappers/hyperliquid/</a></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9jK9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a94e48c-5ace-411e-be3a-a32e3f778e60_1783x1396.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9jK9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a94e48c-5ace-411e-be3a-a32e3f778e60_1783x1396.png 424w, https://substackcdn.com/image/fetch/$s_!9jK9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a94e48c-5ace-411e-be3a-a32e3f778e60_1783x1396.png 848w, https://substackcdn.com/image/fetch/$s_!9jK9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a94e48c-5ace-411e-be3a-a32e3f778e60_1783x1396.png 1272w, https://substackcdn.com/image/fetch/$s_!9jK9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a94e48c-5ace-411e-be3a-a32e3f778e60_1783x1396.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9jK9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a94e48c-5ace-411e-be3a-a32e3f778e60_1783x1396.png" width="1456" height="1140" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8a94e48c-5ace-411e-be3a-a32e3f778e60_1783x1396.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1140,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:339972,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/193349933?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a94e48c-5ace-411e-be3a-a32e3f778e60_1783x1396.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9jK9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a94e48c-5ace-411e-be3a-a32e3f778e60_1783x1396.png 424w, https://substackcdn.com/image/fetch/$s_!9jK9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a94e48c-5ace-411e-be3a-a32e3f778e60_1783x1396.png 848w, https://substackcdn.com/image/fetch/$s_!9jK9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a94e48c-5ace-411e-be3a-a32e3f778e60_1783x1396.png 1272w, https://substackcdn.com/image/fetch/$s_!9jK9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a94e48c-5ace-411e-be3a-a32e3f778e60_1783x1396.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>We are looking to complete integrations for Lighter and Aster DEX in the next updates.</p><p>Cheerios</p>]]></content:encoded></item><item><title><![CDATA[Quantpylib Update (hyperliquid sdk)]]></title><link>https://www.research.hangukquant.com/p/quantpylib-update-hyperliquid-sdk</link><guid isPermaLink="false">https://www.research.hangukquant.com/p/quantpylib-update-hyperliquid-sdk</guid><dc:creator><![CDATA[HangukQuant]]></dc:creator><pubDate>Sun, 29 Mar 2026 17:01:07 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!dgla!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff692bc95-032a-45b7-8a26-71c0dcb27375_2569x1567.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Quantpylib is our trading and research repository featuring exchange gateways connectors, research and hft tooling. </p><p>Read more about quantpylib here:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;30bede70-cc8a-4db7-948f-218c3bb110a9&quot;,&quot;caption&quot;:&quot;&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;HangukQuant quantpylib Github Repo&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:42788676,&quot;name&quot;:&quot;HangukQuant&quot;,&quot;bio&quot;:&quot;quant research and quant dev. not financial advice.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2023-11-24T16:59:27.729Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.research.hangukquant.com/p/hangukquant-community-github-repo&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:139132009,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:29,&quot;comment_count&quot;:0,&quot;publication_id&quot;:453792,&quot;publication_name&quot;:&quot;HangukQuant Research&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!LX9y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc5718e3-074f-4c1d-a77d-f1fa609a9ea0_1280x1280.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>and docs here:</p><p><a href="https://quantpylib.hangukquant.com">https://quantpylib.hangukquant.com</a></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dgla!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff692bc95-032a-45b7-8a26-71c0dcb27375_2569x1567.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dgla!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff692bc95-032a-45b7-8a26-71c0dcb27375_2569x1567.png 424w, https://substackcdn.com/image/fetch/$s_!dgla!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff692bc95-032a-45b7-8a26-71c0dcb27375_2569x1567.png 848w, https://substackcdn.com/image/fetch/$s_!dgla!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff692bc95-032a-45b7-8a26-71c0dcb27375_2569x1567.png 1272w, https://substackcdn.com/image/fetch/$s_!dgla!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff692bc95-032a-45b7-8a26-71c0dcb27375_2569x1567.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dgla!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff692bc95-032a-45b7-8a26-71c0dcb27375_2569x1567.png" width="1456" height="888" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f692bc95-032a-45b7-8a26-71c0dcb27375_2569x1567.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:888,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:519055,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/192522990?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff692bc95-032a-45b7-8a26-71c0dcb27375_2569x1567.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dgla!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff692bc95-032a-45b7-8a26-71c0dcb27375_2569x1567.png 424w, https://substackcdn.com/image/fetch/$s_!dgla!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff692bc95-032a-45b7-8a26-71c0dcb27375_2569x1567.png 848w, https://substackcdn.com/image/fetch/$s_!dgla!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff692bc95-032a-45b7-8a26-71c0dcb27375_2569x1567.png 1272w, https://substackcdn.com/image/fetch/$s_!dgla!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff692bc95-032a-45b7-8a26-71c0dcb27375_2569x1567.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>As promised, we are continuing the building on quantpylib and integrating it with new features, platforms and improved performance. On this patch, we have updated the Hyperliquid gateway. The last major update on the gateway included seamless integrations with spot asset trading - since then the Hyperliquid eco has had tremendous amount of new features, <strong>including new margin systems, HIP-3 DEX integrations, no-op fast cancel paths, twaps, builder codes and so on.</strong></p><p>All of them are now available in our hyperliquid gateway wrapper.</p><p>Docs and example scripts to follow.</p><p>Future integrations will also include other platforms and (tradfi) data sources that have RWA streams. </p><p>Happy Trading!  </p>]]></content:encoded></item><item><title><![CDATA[Nimble Market Maker - Monkey Patch and Benchmark/Testing]]></title><description><![CDATA[& some old alpha in the Polymarket API]]></description><link>https://www.research.hangukquant.com/p/nimble-market-maker-monkey-patch</link><guid isPermaLink="false">https://www.research.hangukquant.com/p/nimble-market-maker-monkey-patch</guid><dc:creator><![CDATA[HangukQuant]]></dc:creator><pubDate>Thu, 12 Mar 2026 11:35:42 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1692713473145-3cf7a6ccc5da?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyMnx8c21hbGwlMjBjYXR8ZW58MHx8fHwxNzczMzAzMDIzfDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A number of months ago, I started the nimble market maker alpha series - </p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;e3cee9f1-f9c5-4747-a1cd-63dc878019fb&quot;,&quot;caption&quot;:&quot;&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Nimble Market-Maker Alpha&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:42788676,&quot;name&quot;:&quot;HangukQuant&quot;,&quot;bio&quot;:&quot;quant research and quant dev. not financial advice.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2025-11-19T17:21:12.346Z&quot;,&quot;cover_image&quot;:&quot;https://images.unsplash.com/photo-1734787101540-050257ab9ded?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyMnx8ZHdhcmZ8ZW58MHx8fHwxNzYyMTkyMTczfDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.research.hangukquant.com/p/nimble-market-maker-alpha&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177905187,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:16,&quot;comment_count&quot;:0,&quot;publication_id&quot;:453792,&quot;publication_name&quot;:&quot;HangukQuant Research&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!LX9y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc5718e3-074f-4c1d-a77d-f1fa609a9ea0_1280x1280.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>We then talked about how the insurgence of crypto and blockchain matching platforms provide small quant teams and even individuals to deploy high sharpe strategies in pseudo-competitive markets due lower barriers and fragmented liquidity.</p><p>The nature of these budding platform often have attendant issues in one form or another, including behavioural and performance ones. These issues also often take weeks to months/years to get ironed out, some despite already having been flagged. </p><p>Whether it is engineering inaptitude (monolithic stack), prioritisation (these platforms often have a multitude of pressing concerns and distribution objectives), awareness (the issue is not recognised by leadership) or negligence (aware but don&#8217;t care), often flaws exist.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2jIX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55a6719c-f62c-45a4-8aaf-33d48f8f2999_822x134.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2jIX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55a6719c-f62c-45a4-8aaf-33d48f8f2999_822x134.png 424w, https://substackcdn.com/image/fetch/$s_!2jIX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55a6719c-f62c-45a4-8aaf-33d48f8f2999_822x134.png 848w, https://substackcdn.com/image/fetch/$s_!2jIX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55a6719c-f62c-45a4-8aaf-33d48f8f2999_822x134.png 1272w, https://substackcdn.com/image/fetch/$s_!2jIX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55a6719c-f62c-45a4-8aaf-33d48f8f2999_822x134.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2jIX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55a6719c-f62c-45a4-8aaf-33d48f8f2999_822x134.png" width="506" height="82.48661800486617" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/55a6719c-f62c-45a4-8aaf-33d48f8f2999_822x134.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:134,&quot;width&quot;:822,&quot;resizeWidth&quot;:506,&quot;bytes&quot;:31826,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/190699057?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55a6719c-f62c-45a4-8aaf-33d48f8f2999_822x134.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2jIX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55a6719c-f62c-45a4-8aaf-33d48f8f2999_822x134.png 424w, https://substackcdn.com/image/fetch/$s_!2jIX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55a6719c-f62c-45a4-8aaf-33d48f8f2999_822x134.png 848w, https://substackcdn.com/image/fetch/$s_!2jIX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55a6719c-f62c-45a4-8aaf-33d48f8f2999_822x134.png 1272w, https://substackcdn.com/image/fetch/$s_!2jIX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55a6719c-f62c-45a4-8aaf-33d48f8f2999_822x134.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>In some instances, you can shout at them &#8220;THIS ISSUE IS COSTING YOU HUNDREDS OF THOUSANDS&#8221; and they will give flaky answers, leaving you to wonder if you should have told them in the first place or taken advantage&#8230;</p><p>This was a conversation in the past year from [REDACTED] crypto platform, where the reply to my ticket was <em>how much money they had raised!</em></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8Pwv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F704a3dbc-711c-486d-aeab-a40d6a74a64c_472x242.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8Pwv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F704a3dbc-711c-486d-aeab-a40d6a74a64c_472x242.png 424w, https://substackcdn.com/image/fetch/$s_!8Pwv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F704a3dbc-711c-486d-aeab-a40d6a74a64c_472x242.png 848w, https://substackcdn.com/image/fetch/$s_!8Pwv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F704a3dbc-711c-486d-aeab-a40d6a74a64c_472x242.png 1272w, https://substackcdn.com/image/fetch/$s_!8Pwv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F704a3dbc-711c-486d-aeab-a40d6a74a64c_472x242.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8Pwv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F704a3dbc-711c-486d-aeab-a40d6a74a64c_472x242.png" width="316" height="162.01694915254237" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/704a3dbc-711c-486d-aeab-a40d6a74a64c_472x242.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:242,&quot;width&quot;:472,&quot;resizeWidth&quot;:316,&quot;bytes&quot;:50614,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/190699057?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F704a3dbc-711c-486d-aeab-a40d6a74a64c_472x242.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8Pwv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F704a3dbc-711c-486d-aeab-a40d6a74a64c_472x242.png 424w, https://substackcdn.com/image/fetch/$s_!8Pwv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F704a3dbc-711c-486d-aeab-a40d6a74a64c_472x242.png 848w, https://substackcdn.com/image/fetch/$s_!8Pwv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F704a3dbc-711c-486d-aeab-a40d6a74a64c_472x242.png 1272w, https://substackcdn.com/image/fetch/$s_!8Pwv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F704a3dbc-711c-486d-aeab-a40d6a74a64c_472x242.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p>In most cases, the issue is more subtle, such as performance. Undocumented API endpoints, wrongly documented endpoints, undocumented parameters and so on. These can be rectified to some extent by <strong>looking at the developer tools (Chrome F-12) network payloads and observing the message traffic.</strong></p><p>In other cases, everything appears as is, and no behavioural flaws are apparent. However, if you are looking to onboard a platform and play a significant role in liquidity provision, it is absolutely necessary for you to understand the in-and-outs of both the functional and behavioural kinks of interfaces presented by the exchange.</p><p>For example, a cancel order functionality may be available via these features:</p>
      <p>
          <a href="https://www.research.hangukquant.com/p/nimble-market-maker-monkey-patch">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Easy Wins in Low Latency Market Data Feed Parsing]]></title><description><![CDATA[how to wire up a bba feed parser in cpp to your python application for fast wins]]></description><link>https://www.research.hangukquant.com/p/easy-wins-in-low-latency-market-data</link><guid isPermaLink="false">https://www.research.hangukquant.com/p/easy-wins-in-low-latency-market-data</guid><dc:creator><![CDATA[HangukQuant]]></dc:creator><pubDate>Mon, 02 Mar 2026 11:43:37 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!87yt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb255ed2a-c71d-4565-85f3-09eaa677edfd_2083x732.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>It turns out that an incredible number of quantitative trading firms run on Python. When we think about quant trading, we often only talk about the Citadel-s and Optiver-s, but particularly in the crypto space - the biodiversity is rich and competition is variable. The animals in the canopy and those in the shrubs thrive on a different diet.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1470058869958-2a77ade41c02?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxqdW5nbGV8ZW58MHx8fHwxNzcyNDQxMTU2fDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1470058869958-2a77ade41c02?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxqdW5nbGV8ZW58MHx8fHwxNzcyNDQxMTU2fDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1470058869958-2a77ade41c02?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxqdW5nbGV8ZW58MHx8fHwxNzcyNDQxMTU2fDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1470058869958-2a77ade41c02?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxqdW5nbGV8ZW58MHx8fHwxNzcyNDQxMTU2fDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1470058869958-2a77ade41c02?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxqdW5nbGV8ZW58MHx8fHwxNzcyNDQxMTU2fDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1470058869958-2a77ade41c02?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxqdW5nbGV8ZW58MHx8fHwxNzcyNDQxMTU2fDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080" width="526" height="350.6666666666667" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1470058869958-2a77ade41c02?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxqdW5nbGV8ZW58MHx8fHwxNzcyNDQxMTU2fDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:4000,&quot;width&quot;:6000,&quot;resizeWidth&quot;:526,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;area covered with green leafed plants&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="area covered with green leafed plants" title="area covered with green leafed plants" srcset="https://images.unsplash.com/photo-1470058869958-2a77ade41c02?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxqdW5nbGV8ZW58MHx8fHwxNzcyNDQxMTU2fDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1470058869958-2a77ade41c02?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxqdW5nbGV8ZW58MHx8fHwxNzcyNDQxMTU2fDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1470058869958-2a77ade41c02?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxqdW5nbGV8ZW58MHx8fHwxNzcyNDQxMTU2fDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1470058869958-2a77ade41c02?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxqdW5nbGV8ZW58MHx8fHwxNzcyNDQxMTU2fDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>One of the things I like to do when my friends hop firms is to ask what the focus of the interview was, the skills involved et cetera. I was rather surprised that Python still has a good seat in the software stack of crypto trading firms, and not in the &#8220;dashboard and risk&#8221; layer. In the actual trading logic.</p><p>Anyways, I did come across scenarios for my own (low latency) trading purposes, where I wanted to optimise feed parsing but the entire system was written in Python. It is a pretty neat trick, the gains are nice (~10x), use case is diverse and implementation is simple - fantastic to share.</p><p>Let&#8217;s go!</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!87yt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb255ed2a-c71d-4565-85f3-09eaa677edfd_2083x732.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!87yt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb255ed2a-c71d-4565-85f3-09eaa677edfd_2083x732.png 424w, https://substackcdn.com/image/fetch/$s_!87yt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb255ed2a-c71d-4565-85f3-09eaa677edfd_2083x732.png 848w, https://substackcdn.com/image/fetch/$s_!87yt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb255ed2a-c71d-4565-85f3-09eaa677edfd_2083x732.png 1272w, https://substackcdn.com/image/fetch/$s_!87yt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb255ed2a-c71d-4565-85f3-09eaa677edfd_2083x732.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!87yt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb255ed2a-c71d-4565-85f3-09eaa677edfd_2083x732.png" width="728" height="256" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b255ed2a-c71d-4565-85f3-09eaa677edfd_2083x732.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:512,&quot;width&quot;:1456,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:87982,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/188223238?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb255ed2a-c71d-4565-85f3-09eaa677edfd_2083x732.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!87yt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb255ed2a-c71d-4565-85f3-09eaa677edfd_2083x732.png 424w, https://substackcdn.com/image/fetch/$s_!87yt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb255ed2a-c71d-4565-85f3-09eaa677edfd_2083x732.png 848w, https://substackcdn.com/image/fetch/$s_!87yt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb255ed2a-c71d-4565-85f3-09eaa677edfd_2083x732.png 1272w, https://substackcdn.com/image/fetch/$s_!87yt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb255ed2a-c71d-4565-85f3-09eaa677edfd_2083x732.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div>
      <p>
          <a href="https://www.research.hangukquant.com/p/easy-wins-in-low-latency-market-data">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[high frequency trading - reading the pmu for code profiling]]></title><description><![CDATA[lightweight benchmarking harness in python]]></description><link>https://www.research.hangukquant.com/p/high-frequency-trading-reading-the</link><guid isPermaLink="false">https://www.research.hangukquant.com/p/high-frequency-trading-reading-the</guid><dc:creator><![CDATA[HangukQuant]]></dc:creator><pubDate>Thu, 19 Feb 2026 15:15:16 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1529978515127-dba8c80bbf05?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxM3x8c25ha2V8ZW58MHx8fHwxNzcxNDM3MDEyfDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Optimizing code for ultra-low latency requires precise profiling tools that can measure performance counters without introducing significant overhead. Linux&#8217;s <em><a href="https://www.brendangregg.com/perf.html">perf</a> </em>is a fantastic tool but can be problematic for micro-benchmarking scenarios common in HFT pipelines.</p><p>Article explores the Performance Monitoring Unit (PMU), its role in code profiling, and introduces a lightweight Python-based controller for direct PMU access. While demonstrated in Python for clarity, the underlying syscalls are straightforward to port to C or C++.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1529978515127-dba8c80bbf05?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxM3x8c25ha2V8ZW58MHx8fHwxNzcxNDM3MDEyfDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1529978515127-dba8c80bbf05?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxM3x8c25ha2V8ZW58MHx8fHwxNzcxNDM3MDEyfDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1529978515127-dba8c80bbf05?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxM3x8c25ha2V8ZW58MHx8fHwxNzcxNDM3MDEyfDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1529978515127-dba8c80bbf05?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxM3x8c25ha2V8ZW58MHx8fHwxNzcxNDM3MDEyfDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1529978515127-dba8c80bbf05?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxM3x8c25ha2V8ZW58MHx8fHwxNzcxNDM3MDEyfDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1529978515127-dba8c80bbf05?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxM3x8c25ha2V8ZW58MHx8fHwxNzcxNDM3MDEyfDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080" width="524" height="352.65180854950677" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1529978515127-dba8c80bbf05?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxM3x8c25ha2V8ZW58MHx8fHwxNzcxNDM3MDEyfDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:3684,&quot;width&quot;:5474,&quot;resizeWidth&quot;:524,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;brown snake&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="brown snake" title="brown snake" srcset="https://images.unsplash.com/photo-1529978515127-dba8c80bbf05?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxM3x8c25ha2V8ZW58MHx8fHwxNzcxNDM3MDEyfDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1529978515127-dba8c80bbf05?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxM3x8c25ha2V8ZW58MHx8fHwxNzcxNDM3MDEyfDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1529978515127-dba8c80bbf05?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxM3x8c25ha2V8ZW58MHx8fHwxNzcxNDM3MDEyfDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1529978515127-dba8c80bbf05?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxM3x8c25ha2V8ZW58MHx8fHwxNzcxNDM3MDEyfDA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">some snake, maybe a Python. ask a snake expert</figcaption></figure></div><p>In the next post we will showcase using tools written here - to benchmark a custom bba parse against orjson.</p>
      <p>
          <a href="https://www.research.hangukquant.com/p/high-frequency-trading-reading-the">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[hft - tuning guide]]></title><description><![CDATA[@ kernel level]]></description><link>https://www.research.hangukquant.com/p/hft-tuning-guide</link><guid isPermaLink="false">https://www.research.hangukquant.com/p/hft-tuning-guide</guid><pubDate>Tue, 10 Feb 2026 16:38:36 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1633451238042-85d93d267866?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzNHx8bWVjaGFuaWNhbCUyMGNsb2NrfGVufDB8fHx8MTc2OTY3MDc5NXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Tuning for low latency systems is a multi-layer approach. Attention is paid to different components spanning hardware, firmware, OS/kernel, network stack, application layer logic, toolchain, network infra investments, memory management etc.</p><p>On a tangent, other techniques/agreements such as micro benchmarking, hardware timestamping, mm contracts come to mind as important. On a rather precariously long list of items, I want to break them down by layer.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1633451238042-85d93d267866?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzNHx8bWVjaGFuaWNhbCUyMGNsb2NrfGVufDB8fHx8MTc2OTY3MDc5NXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1633451238042-85d93d267866?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzNHx8bWVjaGFuaWNhbCUyMGNsb2NrfGVufDB8fHx8MTc2OTY3MDc5NXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1633451238042-85d93d267866?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzNHx8bWVjaGFuaWNhbCUyMGNsb2NrfGVufDB8fHx8MTc2OTY3MDc5NXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1633451238042-85d93d267866?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzNHx8bWVjaGFuaWNhbCUyMGNsb2NrfGVufDB8fHx8MTc2OTY3MDc5NXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1633451238042-85d93d267866?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzNHx8bWVjaGFuaWNhbCUyMGNsb2NrfGVufDB8fHx8MTc2OTY3MDc5NXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1633451238042-85d93d267866?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzNHx8bWVjaGFuaWNhbCUyMGNsb2NrfGVufDB8fHx8MTc2OTY3MDc5NXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080" width="416" height="275.53246753246754" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1633451238042-85d93d267866?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzNHx8bWVjaGFuaWNhbCUyMGNsb2NrfGVufDB8fHx8MTc2OTY3MDc5NXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:3264,&quot;width&quot;:4928,&quot;resizeWidth&quot;:416,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;a close up of a watch face with the gears missing&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="a close up of a watch face with the gears missing" title="a close up of a watch face with the gears missing" srcset="https://images.unsplash.com/photo-1633451238042-85d93d267866?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzNHx8bWVjaGFuaWNhbCUyMGNsb2NrfGVufDB8fHx8MTc2OTY3MDc5NXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1633451238042-85d93d267866?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzNHx8bWVjaGFuaWNhbCUyMGNsb2NrfGVufDB8fHx8MTc2OTY3MDc5NXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1633451238042-85d93d267866?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzNHx8bWVjaGFuaWNhbCUyMGNsb2NrfGVufDB8fHx8MTc2OTY3MDc5NXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1633451238042-85d93d267866?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzNHx8bWVjaGFuaWNhbCUyMGNsb2NrfGVufDB8fHx8MTc2OTY3MDc5NXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"></figcaption></figure></div><p>My philosophy around this research/blog is if it&#8217;s useful to me, it&#8217;s useful for someone else. I wanted a nice compilation as a personal handbook. Think it will be pretty useful for a lot of readers, hence I will compile them in the market notes down the line. </p><p><strong>This post is dedicated to the (linux) kernel component.</strong></p>
      <p>
          <a href="https://www.research.hangukquant.com/p/hft-tuning-guide">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[hft benchmarking; done wrong. part II]]></title><link>https://www.research.hangukquant.com/p/hft-benchmarking-done-wrong-part-fe0</link><guid isPermaLink="false">https://www.research.hangukquant.com/p/hft-benchmarking-done-wrong-part-fe0</guid><dc:creator><![CDATA[HangukQuant]]></dc:creator><pubDate>Sun, 01 Feb 2026 15:23:10 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1612529376930-9734e04e6910?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1MXx8Y2F0JTIwcmVhZGluZ3xlbnwwfHx8fDE3Njk0MTI2MDl8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the last post, we discussed how to better measure throughput against single message handoff latencies, which are useful when we want to benchmark trading systems.</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;c0986a7e-8dcc-4a47-87f2-f3825975962f&quot;,&quot;caption&quot;:&quot;&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;hft benchmarking; done wrong. part I&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:42788676,&quot;name&quot;:&quot;HangukQuant&quot;,&quot;bio&quot;:&quot;quant research and quant dev. not financial advice.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2026-01-26T13:26:32.143Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!z7in!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3631fe5d-7f85-4d5a-ad64-fc91c2be8ffe_1027x1481.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.research.hangukquant.com/p/hft-benchmarking-done-wrong-part&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:185642932,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:6,&quot;comment_count&quot;:0,&quot;publication_id&quot;:453792,&quot;publication_name&quot;:&quot;HangukQuant Research&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!LX9y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc5718e3-074f-4c1d-a77d-f1fa609a9ea0_1280x1280.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>These profiles give us a better latency characteristic of a trading system that has queue depth ~ O(1). However, we know that market data is bursty. We are interested in what affects the shape of the latency distribution under load.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1612529376930-9734e04e6910?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1MXx8Y2F0JTIwcmVhZGluZ3xlbnwwfHx8fDE3Njk0MTI2MDl8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1612529376930-9734e04e6910?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1MXx8Y2F0JTIwcmVhZGluZ3xlbnwwfHx8fDE3Njk0MTI2MDl8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1612529376930-9734e04e6910?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1MXx8Y2F0JTIwcmVhZGluZ3xlbnwwfHx8fDE3Njk0MTI2MDl8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1612529376930-9734e04e6910?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1MXx8Y2F0JTIwcmVhZGluZ3xlbnwwfHx8fDE3Njk0MTI2MDl8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1612529376930-9734e04e6910?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1MXx8Y2F0JTIwcmVhZGluZ3xlbnwwfHx8fDE3Njk0MTI2MDl8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1612529376930-9734e04e6910?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1MXx8Y2F0JTIwcmVhZGluZ3xlbnwwfHx8fDE3Njk0MTI2MDl8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080" width="309" height="463.5" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1612529376930-9734e04e6910?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1MXx8Y2F0JTIwcmVhZGluZ3xlbnwwfHx8fDE3Njk0MTI2MDl8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:5472,&quot;width&quot;:3648,&quot;resizeWidth&quot;:309,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;white and black cat on white book page&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="white and black cat on white book page" title="white and black cat on white book page" srcset="https://images.unsplash.com/photo-1612529376930-9734e04e6910?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1MXx8Y2F0JTIwcmVhZGluZ3xlbnwwfHx8fDE3Njk0MTI2MDl8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1612529376930-9734e04e6910?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1MXx8Y2F0JTIwcmVhZGluZ3xlbnwwfHx8fDE3Njk0MTI2MDl8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1612529376930-9734e04e6910?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1MXx8Y2F0JTIwcmVhZGluZ3xlbnwwfHx8fDE3Njk0MTI2MDl8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1612529376930-9734e04e6910?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw1MXx8Y2F0JTIwcmVhZGluZ3xlbnwwfHx8fDE3Njk0MTI2MDl8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Under load, latency also needs to take into consideration queuing time in the pipeline. In effect, this queuing is incurred at all the network hops, as well as the system&#8217;s NIC, kernel processing stages etc&#8230;here we only look at app-layer queues. Bursty feeds push arrival rate above instantaneous service capacity and force backlog; once backlog exists, latency becomes backlog-dependent.</p>
      <p>
          <a href="https://www.research.hangukquant.com/p/hft-benchmarking-done-wrong-part-fe0">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[hft benchmarking; done wrong. part I]]></title><link>https://www.research.hangukquant.com/p/hft-benchmarking-done-wrong-part</link><guid isPermaLink="false">https://www.research.hangukquant.com/p/hft-benchmarking-done-wrong-part</guid><dc:creator><![CDATA[HangukQuant]]></dc:creator><pubDate>Mon, 26 Jan 2026 13:26:32 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!z7in!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3631fe5d-7f85-4d5a-ad64-fc91c2be8ffe_1027x1481.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><p>Previously, we discussed the lock-free ringbuffer implementation, showcasing a canonical port of the Java Disruptor implementation from LMAX.</p><p>An implementation <a href="https://github.com/hangukquant/disruptor_cpp">https://github.com/hangukquant/disruptor_cpp</a></p><p>You can also refer to our market notes on cache friendly design:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;b051165d-3a96-4310-b019-72a61350f6af&quot;,&quot;caption&quot;:&quot;&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Cache Conscious Programming (quant dev notes)&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:42788676,&quot;name&quot;:&quot;HangukQuant&quot;,&quot;bio&quot;:&quot;quant research and quant dev. not financial advice.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2025-09-26T15:06:03.354Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!MGzV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34fbe4b1-4bad-484e-95ad-e55e26da8607_1276x640.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.research.hangukquant.com/p/cache-conscious-programming-quant&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:174600805,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:8,&quot;comment_count&quot;:6,&quot;publication_id&quot;:453792,&quot;publication_name&quot;:&quot;HangukQuant Research&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!LX9y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc5718e3-074f-4c1d-a77d-f1fa609a9ea0_1280x1280.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>and see the quant notes on the implementation details:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;af8da317-5fba-4cb7-be64-f1275b473ebb&quot;,&quot;caption&quot;:&quot;&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;High Performance Programming / LMAX Disruptor / Quant Notes / p1153&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:42788676,&quot;name&quot;:&quot;HangukQuant&quot;,&quot;bio&quot;:&quot;quant research and quant dev. not financial advice.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2025-07-21T18:34:51.253Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!gyxe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a536d89-eda8-414e-9950-9c24cd807c7c_1138x1346.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.research.hangukquant.com/p/high-performance-programming-quant&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:168881348,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:6,&quot;comment_count&quot;:0,&quot;publication_id&quot;:453792,&quot;publication_name&quot;:&quot;HangukQuant Research&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!LX9y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc5718e3-074f-4c1d-a77d-f1fa609a9ea0_1280x1280.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>This post is dedicated to running a simple benchmark of the Disruptor&#8217;s latency profile. We begin with a simple benchmarking code, and then improve it to have a better appreciation of the ringbuffer&#8217;s profile. I credit the post to @ <a href="https://x.com/dbytesmith">Bytes Smith</a> was kind enough to share his insights with exceedingly clear explanations and code. Whether you are programming in Python, Java, or C++ - this is worth reading with a piece of paper: it is a useful exercise for thinking about your own benchmarks and (very possibly) quantitative interviews.</p><h3>A short description of the Disruptor</h3><p>At a high level, the Disruptor is a <strong>preallocated, cache-friendly ring buffer</strong> paired with a <strong>sequencer</strong> that hands out monotonically increasing sequence numbers. Producers &#8220;claim&#8221; a slot (a sequence), write the payload into that slot, then &#8220;publish&#8221; it. Consumers advance their own sequences as they process events, and producers use <strong>gating sequences</strong> to avoid overwriting data that has not been consumed.</p><p>Key pieces:</p><ul><li><p><strong>RingBuffer</strong>: fixed-size array, typically power-of-two sized for cheap indexing (<code>seq &amp; (N-1)</code>).</p></li><li><p><strong>Sequencer</strong>: coordinates claims/publication and enforces backpressure via gating sequences.</p></li><li><p><strong>SequenceBarrier</strong>: lets consumers wait until a sequence is available (published).</p></li><li><p><strong>WaitStrategy</strong>: controls how consumers wait.</p></li><li><p><strong>EventProcessor / EventHandler</strong>: consumer loop + callback.</p></li></ul><p>This diagram and a short code snippet below should be enough to explain its usage in <strong>low latency inter-thread synchronization patterns.</strong>  </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!z7in!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3631fe5d-7f85-4d5a-ad64-fc91c2be8ffe_1027x1481.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!z7in!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3631fe5d-7f85-4d5a-ad64-fc91c2be8ffe_1027x1481.png 424w, https://substackcdn.com/image/fetch/$s_!z7in!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3631fe5d-7f85-4d5a-ad64-fc91c2be8ffe_1027x1481.png 848w, https://substackcdn.com/image/fetch/$s_!z7in!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3631fe5d-7f85-4d5a-ad64-fc91c2be8ffe_1027x1481.png 1272w, https://substackcdn.com/image/fetch/$s_!z7in!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3631fe5d-7f85-4d5a-ad64-fc91c2be8ffe_1027x1481.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!z7in!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3631fe5d-7f85-4d5a-ad64-fc91c2be8ffe_1027x1481.png" width="564" height="813.3242453748783" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3631fe5d-7f85-4d5a-ad64-fc91c2be8ffe_1027x1481.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1481,&quot;width&quot;:1027,&quot;resizeWidth&quot;:564,&quot;bytes&quot;:126861,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/185642932?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3631fe5d-7f85-4d5a-ad64-fc91c2be8ffe_1027x1481.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!z7in!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3631fe5d-7f85-4d5a-ad64-fc91c2be8ffe_1027x1481.png 424w, https://substackcdn.com/image/fetch/$s_!z7in!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3631fe5d-7f85-4d5a-ad64-fc91c2be8ffe_1027x1481.png 848w, https://substackcdn.com/image/fetch/$s_!z7in!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3631fe5d-7f85-4d5a-ad64-fc91c2be8ffe_1027x1481.png 1272w, https://substackcdn.com/image/fetch/$s_!z7in!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3631fe5d-7f85-4d5a-ad64-fc91c2be8ffe_1027x1481.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Code snippet for a simple Google Benchmark:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!x79P!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62beb34d-9826-45b1-ac39-424e03e55882_1290x2538.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!x79P!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62beb34d-9826-45b1-ac39-424e03e55882_1290x2538.png 424w, https://substackcdn.com/image/fetch/$s_!x79P!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62beb34d-9826-45b1-ac39-424e03e55882_1290x2538.png 848w, https://substackcdn.com/image/fetch/$s_!x79P!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62beb34d-9826-45b1-ac39-424e03e55882_1290x2538.png 1272w, https://substackcdn.com/image/fetch/$s_!x79P!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62beb34d-9826-45b1-ac39-424e03e55882_1290x2538.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!x79P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62beb34d-9826-45b1-ac39-424e03e55882_1290x2538.png" width="1290" height="2538" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/62beb34d-9826-45b1-ac39-424e03e55882_1290x2538.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2538,&quot;width&quot;:1290,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:569485,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/185642932?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62beb34d-9826-45b1-ac39-424e03e55882_1290x2538.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!x79P!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62beb34d-9826-45b1-ac39-424e03e55882_1290x2538.png 424w, https://substackcdn.com/image/fetch/$s_!x79P!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62beb34d-9826-45b1-ac39-424e03e55882_1290x2538.png 848w, https://substackcdn.com/image/fetch/$s_!x79P!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62beb34d-9826-45b1-ac39-424e03e55882_1290x2538.png 1272w, https://substackcdn.com/image/fetch/$s_!x79P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62beb34d-9826-45b1-ac39-424e03e55882_1290x2538.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Spin up a consumer thread to read events published to the ringbuffer. Set timer.</p><p>For 1 million events, repeat:</p><ul><li><p>Producer claims the next sequence from the ringbuffer (<code>next()</code>).</p></li><li><p>Producer writes the payload (<code>value = i</code>) into the claimed slot.</p></li><li><p>Producer publishes the sequence to make it visible to the consumer.</p></li><li><p>Producer waits for the consumer sequence to catch up (i.e., all events consumed).</p></li><li><p>Stop timer and record the delta.</p></li></ul><h3><strong>Issues</strong></h3><p>Depending on the workload at hand, this benchmark can be either useful or nearly meaningless in the context of trading systems. In trading systems, objects synchronized across &#8220;thread boundaries&#8221; might include market data payloads, logging messages, watchdog flags, risk checks, internal signals, etc. These have very different performance questions.</p><p>Depending on the task, different observable metrics should be prioritized:</p><ul><li><p><strong>Throughput / average throughput</strong>: e.g., backpressure on a heavy logging system. We don&#8217;t want backpressure because it drops messages or stalls the producer, possibly in the hot path.</p></li><li><p><strong>Invocation latency</strong>: e.g., &#8220;how much does logging <em>in the hot path</em> add to t2t?&#8221; Here service time downstream is less important as log aggregation downstream is batch processed and not time sensitive.</p></li><li><p><strong>Message hand-off latency</strong>: the t2t hot path question&#8212;&#8220;how long until another core can act on this critical information?&#8221;</p></li><li><p><strong>In-flight distribution</strong>: jitter and tail latency. Queue time vs service time effects latency shape and burst behavior under load/volatility.</p></li></ul><p>In the benchmark displayed, the code is primarily a <strong>steady-state throughput</strong> in a hot pipeline and not a direct measurement of <em>handoff latency per message</em>. It is closer to &#8220;max pipeline rate under ideal conditions&#8221;.</p><p>Consider these:</p><ol><li><p><strong>Batching effects hide per-message latency</strong></p><ul><li><p>Disruptor consumers often drain available sequences in a tight loop. Even if you &#8220;publish one-by-one&#8221;, the consumer may observe bursts due to scheduling, cache effects, and barrier semantics.</p></li><li><p>If your real handler does parse + compute + branch-y logic, the consumer won&#8217;t look like this at all. Memory access patterns are less predictable; cache hit rates would be significantly lower in practice.</p></li></ul></li><li><p><strong>Payload realism</strong></p><ul><li><p>A real market data payload might be on the order of hundreds of bytes, often touching multiple cache lines and performing parsing that creates unpredictable memory access patterns.</p></li><li><p>A single <code>int64_t</code> write is a best-case scenario for cache locality and store-forwarding behavior.</p></li></ul></li><li><p><strong>Market data &#8220;information entropy&#8221; is heavy-tailed</strong></p><ul><li><p>Consider BBA / incremental updates: many messages are qty-deltas or otherwise non-impactful to fair value and quoting decisions.</p></li><li><p>The consequential message triggers quote updates and often coincides with bursts: more inbound messages, more in-flight backlog, more cache churn, and longer effective queue time.</p></li><li><p>Average throughput under a benign stream is a poor proxy for &#8220;what happens when it matters&#8221;.</p></li></ul></li><li><p><strong>CPU affinity / topology dominates the result</strong></p><ul><li><p>With no core affinity, the OS may schedule producer/consumer:</p><ul><li><p>on the same physical core (time-slicing),</p></li><li><p>on SMT siblings (shared execution resources),</p></li><li><p>on different cores sharing parts of cache hierarchy,</p></li><li><p>or (worse) across NUMA nodes.</p></li></ul></li><li><p>Each case changes the coherence traffic pattern and latency regime. If you care about &#8220;handoff across cores&#8221;, we must control placement.</p></li></ul></li></ol><p>In any case, we shall question if the trading system in question requires synchronization across separate NUMA nodes. Lastly (assuming the two threads land on separate physical cores), there is <em>true parallelism </em>and real time (elapsed time) is a better metric than cpu time (which aggregates across threads).</p><p>In the worst case, for the benchmark in question, since the handler is a no-op - there is potential for dead code elimination, optimizing the store-op of the payload.</p><h3>Improvements</h3><p>We fix the benchmark in view of the issues presented. Further, to approximate <strong>single payload handoff latency</strong> (usually what we care about for a &#8220;one packet&#8221; hop), we record a latency sample by:</p><ol><li><p>Producer writes into ring A and publishes.</p></li><li><p>Consumer reads it and immediately echoes it back via ring B.</p></li><li><p>Producer waits for the echo, computes RTT in cycles, and divides by two as an approximation of one-way handoff latency.</p></li></ol><p>This &#8220;ping-pong&#8221; pattern deliberately measures something closer to the cache-to-cache transfer + sequencing overhead + barrier/wait overhead,<br>under a controlled topology.</p><p>The noop handler is replaced with meaningful but low-overhead logic. First, some meta-functions:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hdSX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac4bf96-e2da-4b65-90d9-d9c1f437e8fd_1280x2090.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hdSX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac4bf96-e2da-4b65-90d9-d9c1f437e8fd_1280x2090.png 424w, https://substackcdn.com/image/fetch/$s_!hdSX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac4bf96-e2da-4b65-90d9-d9c1f437e8fd_1280x2090.png 848w, https://substackcdn.com/image/fetch/$s_!hdSX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac4bf96-e2da-4b65-90d9-d9c1f437e8fd_1280x2090.png 1272w, https://substackcdn.com/image/fetch/$s_!hdSX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac4bf96-e2da-4b65-90d9-d9c1f437e8fd_1280x2090.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hdSX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac4bf96-e2da-4b65-90d9-d9c1f437e8fd_1280x2090.png" width="1280" height="2090" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5ac4bf96-e2da-4b65-90d9-d9c1f437e8fd_1280x2090.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2090,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:472546,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/185642932?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac4bf96-e2da-4b65-90d9-d9c1f437e8fd_1280x2090.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!hdSX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac4bf96-e2da-4b65-90d9-d9c1f437e8fd_1280x2090.png 424w, https://substackcdn.com/image/fetch/$s_!hdSX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac4bf96-e2da-4b65-90d9-d9c1f437e8fd_1280x2090.png 848w, https://substackcdn.com/image/fetch/$s_!hdSX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac4bf96-e2da-4b65-90d9-d9c1f437e8fd_1280x2090.png 1272w, https://substackcdn.com/image/fetch/$s_!hdSX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac4bf96-e2da-4b65-90d9-d9c1f437e8fd_1280x2090.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><code>Here, measure_tsc_freq_hz </code>reads the TSC (time-stamp counter), a monotonically increasing cycle counter on x86. <code>_mm_lfence() </code>is used as a serialization barrier to reduce out-of-order effects around <code>RDTSC</code>. Sleeping for 100ms and multiplying by 10 provides an approximate per second TSC frequency. </p><p>You can refer to this post for more notes on the TSC.</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;1b39492c-7bb9-44f9-a610-6a793b1146d5&quot;,&quot;caption&quot;:&quot;&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Timestamp-ing for Performance&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:42788676,&quot;name&quot;:&quot;HangukQuant&quot;,&quot;bio&quot;:&quot;quant research and quant dev. not financial advice.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2025-10-09T12:03:13.334Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!bpyY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f07a74a-5e7e-490e-8400-0ca940b0eda5_1276x4382.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.research.hangukquant.com/p/timestamp-ing-for-performance&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:175685730,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:6,&quot;comment_count&quot;:0,&quot;publication_id&quot;:453792,&quot;publication_name&quot;:&quot;HangukQuant Research&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!LX9y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc5718e3-074f-4c1d-a77d-f1fa609a9ea0_1280x1280.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vOQy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0eb121b0-a26c-4ddd-9277-75d5002950db_1268x1388.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vOQy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0eb121b0-a26c-4ddd-9277-75d5002950db_1268x1388.png 424w, https://substackcdn.com/image/fetch/$s_!vOQy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0eb121b0-a26c-4ddd-9277-75d5002950db_1268x1388.png 848w, https://substackcdn.com/image/fetch/$s_!vOQy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0eb121b0-a26c-4ddd-9277-75d5002950db_1268x1388.png 1272w, https://substackcdn.com/image/fetch/$s_!vOQy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0eb121b0-a26c-4ddd-9277-75d5002950db_1268x1388.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vOQy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0eb121b0-a26c-4ddd-9277-75d5002950db_1268x1388.png" width="1268" height="1388" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0eb121b0-a26c-4ddd-9277-75d5002950db_1268x1388.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1388,&quot;width&quot;:1268,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:292419,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/185642932?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0eb121b0-a26c-4ddd-9277-75d5002950db_1268x1388.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vOQy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0eb121b0-a26c-4ddd-9277-75d5002950db_1268x1388.png 424w, https://substackcdn.com/image/fetch/$s_!vOQy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0eb121b0-a26c-4ddd-9277-75d5002950db_1268x1388.png 848w, https://substackcdn.com/image/fetch/$s_!vOQy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0eb121b0-a26c-4ddd-9277-75d5002950db_1268x1388.png 1272w, https://substackcdn.com/image/fetch/$s_!vOQy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0eb121b0-a26c-4ddd-9277-75d5002950db_1268x1388.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>pretty self explanatory&#8230; and finally the benchmark code:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VcvI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeb75375-5d85-4d05-b8cf-5a44a3bf53fa_1254x3436.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VcvI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeb75375-5d85-4d05-b8cf-5a44a3bf53fa_1254x3436.png 424w, https://substackcdn.com/image/fetch/$s_!VcvI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeb75375-5d85-4d05-b8cf-5a44a3bf53fa_1254x3436.png 848w, https://substackcdn.com/image/fetch/$s_!VcvI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeb75375-5d85-4d05-b8cf-5a44a3bf53fa_1254x3436.png 1272w, https://substackcdn.com/image/fetch/$s_!VcvI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeb75375-5d85-4d05-b8cf-5a44a3bf53fa_1254x3436.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VcvI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeb75375-5d85-4d05-b8cf-5a44a3bf53fa_1254x3436.png" width="1254" height="3436" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/feb75375-5d85-4d05-b8cf-5a44a3bf53fa_1254x3436.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:3436,&quot;width&quot;:1254,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:807370,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/185642932?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeb75375-5d85-4d05-b8cf-5a44a3bf53fa_1254x3436.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!VcvI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeb75375-5d85-4d05-b8cf-5a44a3bf53fa_1254x3436.png 424w, https://substackcdn.com/image/fetch/$s_!VcvI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeb75375-5d85-4d05-b8cf-5a44a3bf53fa_1254x3436.png 848w, https://substackcdn.com/image/fetch/$s_!VcvI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeb75375-5d85-4d05-b8cf-5a44a3bf53fa_1254x3436.png 1272w, https://substackcdn.com/image/fetch/$s_!VcvI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeb75375-5d85-4d05-b8cf-5a44a3bf53fa_1254x3436.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In the next post we will discuss a slightly different benchmark to analyse a trading system under load.</p><p>Cheers!</p><p></p><p></p><p></p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Crypto HFT - In Depth Guide to Optimisation (III)]]></title><link>https://www.research.hangukquant.com/p/crypto-hft-in-depth-guide-to-optimisation-d14</link><guid isPermaLink="false">https://www.research.hangukquant.com/p/crypto-hft-in-depth-guide-to-optimisation-d14</guid><dc:creator><![CDATA[HangukQuant]]></dc:creator><pubDate>Wed, 21 Jan 2026 15:19:07 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!MVq7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32d0ae30-8c25-4640-b2e4-207113e9d257_1080x857.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><p>In the first post, we discussed where latencies come from in cloud-hosted infrastructures for crypto hft mm. We discussed how ALBs can add jitter</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;f41d1f63-0fc5-4e5a-bb46-4460a681e6a6&quot;,&quot;caption&quot;:&quot;&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Crypto HFT - In Depth Guide to Optimization (I)&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:42788676,&quot;name&quot;:&quot;HangukQuant&quot;,&quot;bio&quot;:&quot;quant research and quant dev. not financial advice.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2025-12-22T18:51:51.154Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!PSqn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F395567fa-9f60-4663-8263-8043df63984c_974x594.jpeg&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.research.hangukquant.com/p/crypto-hft-in-depth-guide-to-optimization&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:182346782,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:12,&quot;comment_count&quot;:1,&quot;publication_id&quot;:453792,&quot;publication_name&quot;:&quot;HangukQuant Research&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!LX9y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc5718e3-074f-4c1d-a77d-f1fa609a9ea0_1280x1280.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>and how to find the best &#8216;front door&#8217;. Upon finding the right endpoint (if any) - we discussed AWS box placement strategies and search heuristics to increase probability of reducing the physical distance to server racks, such as using partition and spread placement groups.  </p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;6443ac55-55eb-4d57-83d5-46a95be52e90&quot;,&quot;caption&quot;:&quot;&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Crypto HFT - In Depth Guide to Optimisation (II)&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:42788676,&quot;name&quot;:&quot;HangukQuant&quot;,&quot;bio&quot;:&quot;quant research and quant dev. not financial advice.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2025-12-28T13:41:38.296Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!ErGu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74c97db9-aef3-44cc-bc95-d15c07ae5231_1080x1099.jpeg&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.research.hangukquant.com/p/crypto-hft-in-depth-guide-to-optimisation&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:182749992,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:11,&quot;comment_count&quot;:0,&quot;publication_id&quot;:453792,&quot;publication_name&quot;:&quot;HangukQuant Research&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!LX9y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc5718e3-074f-4c1d-a77d-f1fa609a9ea0_1280x1280.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>We want to round this up with some more AWS-native notes, and talk a little bit on the importance of network topology and writing a custom gateway for multi-asset/regional arbitrage. I wanted to include some notes regarding on-prem server tuning, but I think it&#8217;s not really crypto-specific MM so I will put that in a separate post.</p>
      <p>
          <a href="https://www.research.hangukquant.com/p/crypto-hft-in-depth-guide-to-optimisation-d14">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[An Announcement;]]></title><description><![CDATA[a little update on the short break]]></description><link>https://www.research.hangukquant.com/p/an-announcement</link><guid isPermaLink="false">https://www.research.hangukquant.com/p/an-announcement</guid><dc:creator><![CDATA[HangukQuant]]></dc:creator><pubDate>Sun, 11 Jan 2026 16:33:45 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!LX9y!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc5718e3-074f-4c1d-a77d-f1fa609a9ea0_1280x1280.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[
      <p>
          <a href="https://www.research.hangukquant.com/p/an-announcement">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Crypto HFT - In Depth Guide to Optimisation (II)]]></title><description><![CDATA[some lesser known hft alphas]]></description><link>https://www.research.hangukquant.com/p/crypto-hft-in-depth-guide-to-optimisation</link><guid isPermaLink="false">https://www.research.hangukquant.com/p/crypto-hft-in-depth-guide-to-optimisation</guid><dc:creator><![CDATA[HangukQuant]]></dc:creator><pubDate>Sun, 28 Dec 2025 13:41:38 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ErGu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74c97db9-aef3-44cc-bc95-d15c07ae5231_1080x1099.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the last post - we discussed how crypto gateways are hosted/exposed in cloud infrastructure. We discussed <strong>how edge processing facilities and load balancers </strong>can introduce step changes in network latency and tools to mitigate these if possible.</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;7f57323f-ff79-4dda-87d1-a726769f75b6&quot;,&quot;caption&quot;:&quot;&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Crypto HFT - In Depth Guide to Optimization (I)&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:42788676,&quot;name&quot;:&quot;HangukQuant&quot;,&quot;bio&quot;:&quot;quant research and quant dev. not financial advice.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2025-12-22T18:51:51.154Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!PSqn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F395567fa-9f60-4663-8263-8043df63984c_974x594.jpeg&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.research.hangukquant.com/p/crypto-hft-in-depth-guide-to-optimization&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:182346782,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:11,&quot;comment_count&quot;:0,&quot;publication_id&quot;:453792,&quot;publication_name&quot;:&quot;HangukQuant Research&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!LX9y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc5718e3-074f-4c1d-a77d-f1fa609a9ea0_1280x1280.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>These week, we cover some more advanced topics in the area of latency optimisation. We are <strong>currently doing a week long thousand dollar discount for our research platforms:</strong></p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;a44673f2-0bab-488c-bb5f-690689eb7944&quot;,&quot;caption&quot;:&quot;&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Free Stuff, Cheap Stuff and New Stuff - HangukQuant Wishes you A Merry Xmas&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:42788676,&quot;name&quot;:&quot;HangukQuant&quot;,&quot;bio&quot;:&quot;quant research and quant dev. not financial advice.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2025-12-25T11:07:11.838Z&quot;,&quot;cover_image&quot;:&quot;https://images.unsplash.com/photo-1607805059372-636a320ebbcd?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3OHx8Y2hyaXN0bWFzfGVufDB8fHx8MTc2NjU2NTU1MXww&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=1080&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.research.hangukquant.com/p/free-stuff-cheap-stuff-and-new-stuff&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:182526261,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:4,&quot;comment_count&quot;:0,&quot;publication_id&quot;:453792,&quot;publication_name&quot;:&quot;HangukQuant Research&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!LX9y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc5718e3-074f-4c1d-a77d-f1fa609a9ea0_1280x1280.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>Continuing the thread on optimization&#8230;</p>
      <p>
          <a href="https://www.research.hangukquant.com/p/crypto-hft-in-depth-guide-to-optimisation">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Crypto HFT - In Depth Guide to Optimization (I)]]></title><link>https://www.research.hangukquant.com/p/crypto-hft-in-depth-guide-to-optimization</link><guid isPermaLink="false">https://www.research.hangukquant.com/p/crypto-hft-in-depth-guide-to-optimization</guid><dc:creator><![CDATA[HangukQuant]]></dc:creator><pubDate>Mon, 22 Dec 2025 18:51:51 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!PSqn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F395567fa-9f60-4663-8263-8043df63984c_974x594.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Continuing the last post on the market maker series - </p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;7991beba-1a93-492e-a34e-2a5312133f22&quot;,&quot;caption&quot;:&quot;&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Market Making - Tooling for Modelling Latency Requirements and Microstructural Behavior - II&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:42788676,&quot;name&quot;:&quot;HangukQuant&quot;,&quot;bio&quot;:&quot;quant research and quant dev. not financial advice.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2025-12-13T17:18:54.792Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!BDSc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3e495c2-c451-498f-bcf6-c6a495a9c628_1728x600.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.research.hangukquant.com/p/market-making-tooling-for-modelling-b25&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:180573447,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:12,&quot;comment_count&quot;:0,&quot;publication_id&quot;:453792,&quot;publication_name&quot;:&quot;HangukQuant Research&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!LX9y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc5718e3-074f-4c1d-a77d-f1fa609a9ea0_1280x1280.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>we are going to do an exploration of the <strong>state and techniques for crypto specific hft optimisation,</strong> which differ from traditional hft outfits. Traditionally, tradfi hft involves buying access to colocation services which places their machine adjacent to the exchange servers. Exchanges typically spend a lot of effort <strong>ensuring fair access network connectivity and deterministic latency for these participants.</strong> </p><p>Therefore the role of the hft quant was primarily about server tuning, configuring kernel interactions such as buffers, IRQ coalescing and scheduler tasks, as well as app-level software t2t. To the extent of ultra low-latency settings - quant teams in-housed FPGA/DPDK solutions.</p><p>However, the crypto industry, and to an increasing extent, tradfi is <strong>turning to low latency services hosted by cloud infrastructure</strong> - for reasons including costs, scalability/elasticity and operational velocity.</p><p>Most crypto CEXes and DEXes matching engines/sequencers, market data gateways are hosted on cloud services such as AWS. Therefore, the role of <strong>colocation as purchasing exclusive proximity rights is secondary</strong> (although still present in a different form, as we will discuss) and the job of engineers here is now <strong>primarily the task of network optimisation, and the traditional skillset of tuning on-prem servers takes a backseat</strong> in terms of the leverage in latency gains to be had.</p><p>Given this backdrop, we explore a <strong>series of optimisation techniques that quant teams use in the crypto hft space.</strong> Of course, these techniques were not discovered by me, rather - they are based on a culmination of experience trading on these cloud infrastructures, conferences and consultations with cloud solutions architects and network engineers.</p>
      <p>
          <a href="https://www.research.hangukquant.com/p/crypto-hft-in-depth-guide-to-optimization">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Market Making - Tooling for Modelling Latency Requirements and Microstructural Behavior - II]]></title><description><![CDATA[with Python code]]></description><link>https://www.research.hangukquant.com/p/market-making-tooling-for-modelling-b25</link><guid isPermaLink="false">https://www.research.hangukquant.com/p/market-making-tooling-for-modelling-b25</guid><dc:creator><![CDATA[HangukQuant]]></dc:creator><pubDate>Sat, 13 Dec 2025 17:18:54 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!BDSc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3e495c2-c451-498f-bcf6-c6a495a9c628_1728x600.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the last post we made the case for modelling lead-lag latencies between exchange venues and/or trading instruments, <strong>with critical applications for lead-lag/statistical arbitrage type strategies:</strong></p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;56621800-f67e-4544-afb9-162f9ed76616&quot;,&quot;caption&quot;:&quot;&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Market Making - Tooling for Modelling Latency Requirements and Microstructural Behavior - I&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:42788676,&quot;name&quot;:&quot;HangukQuant&quot;,&quot;bio&quot;:&quot;quant research and quant dev. not financial advice.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2025-12-04T12:02:09.796Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!4715!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc7eae4f-b86e-4058-95cd-568084135860_1253x680.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.research.hangukquant.com/p/market-making-tooling-for-modelling&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:180397944,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:8,&quot;comment_count&quot;:0,&quot;publication_id&quot;:453792,&quot;publication_name&quot;:&quot;HangukQuant Research&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!LX9y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc5718e3-074f-4c1d-a77d-f1fa609a9ea0_1280x1280.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>Building on that foundation, this post shifts focus to the statistical modeling aspect - the combination of the work in the last and current post gives us a great <strong>Python software test harness</strong> tool for &#8216;sussing&#8217; out hft landscapes.</p><p>To motivate the post, we would like to obtain a plot like the following - showing <strong>peak correlation at lag of 32ms at bybit to the leader binance.</strong> </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VJk8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1beba530-8099-484c-bd4a-f37039c951d2_1728x654.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VJk8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1beba530-8099-484c-bd4a-f37039c951d2_1728x654.png 424w, https://substackcdn.com/image/fetch/$s_!VJk8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1beba530-8099-484c-bd4a-f37039c951d2_1728x654.png 848w, https://substackcdn.com/image/fetch/$s_!VJk8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1beba530-8099-484c-bd4a-f37039c951d2_1728x654.png 1272w, https://substackcdn.com/image/fetch/$s_!VJk8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1beba530-8099-484c-bd4a-f37039c951d2_1728x654.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VJk8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1beba530-8099-484c-bd4a-f37039c951d2_1728x654.png" width="1456" height="551" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1beba530-8099-484c-bd4a-f37039c951d2_1728x654.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:551,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:50038,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/180573447?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1beba530-8099-484c-bd4a-f37039c951d2_1728x654.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!VJk8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1beba530-8099-484c-bd4a-f37039c951d2_1728x654.png 424w, https://substackcdn.com/image/fetch/$s_!VJk8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1beba530-8099-484c-bd4a-f37039c951d2_1728x654.png 848w, https://substackcdn.com/image/fetch/$s_!VJk8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1beba530-8099-484c-bd4a-f37039c951d2_1728x654.png 1272w, https://substackcdn.com/image/fetch/$s_!VJk8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1beba530-8099-484c-bd4a-f37039c951d2_1728x654.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>We may draw on literature from tradfi - one of the deepest lead-lag literature is between spot-futures market, such as index/etf components and such. Here is an excellent reference: <a href="https://www.tandfonline.com/doi/full/10.1080/14697688.2017.1414484">Ultra-high-frequency lead-lag relationship and information arrival</a></p><p>A typical or intuitive way to model covariances or correlations between two price series is to bin the data into fixed-time intervals (e.g., 1-second buckets) and compute deltas within those buckets. While this is acceptable for low frequency data, in HFT contexts with tick data - this is problematic; for instance - </p><ul><li><p><strong>Asynchronicity Issues:</strong> Ticks arrive asynchronously across venues. Binning forces artificial alignment and <strong>statistical bias</strong>&#8212;especially when one venue updates more frequently than another.</p></li><li><p><strong>Empty Buckets and Noise: </strong>Imputing zeros or missing data distort estimates such as Pearson correlation.</p></li></ul>
      <p>
          <a href="https://www.research.hangukquant.com/p/market-making-tooling-for-modelling-b25">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Market Making - Tooling for Modelling Latency Requirements and Microstructural Behavior - I]]></title><description><![CDATA[a tad on hft tooling, with Python code]]></description><link>https://www.research.hangukquant.com/p/market-making-tooling-for-modelling</link><guid isPermaLink="false">https://www.research.hangukquant.com/p/market-making-tooling-for-modelling</guid><dc:creator><![CDATA[HangukQuant]]></dc:creator><pubDate>Thu, 04 Dec 2025 12:02:09 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!4715!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc7eae4f-b86e-4058-95cd-568084135860_1253x680.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>One of the biggest differences between professionals and amateurs are in approach of conceiving trading strategies. A typical hft system can be anywhere between 10k~200k LOC, so what is everyone else doing in a hft firm?</p><p>Other than coming up with connectivity gateways, a large bulk of the time is spent on model iterations and challenging assumptions about active strategies. On the other hand, for most &#8216;retail traders&#8217;, a <strong>large proportion of time is spent on guesswork. For instance</strong></p><ul><li><p>I should be fast enough since my software t2t is sub10 micros.</p></li><li><p>This strategy worked on exchange A, so it should work on exchange B.</p></li><li><p>Network latency is the bulk of e2e latency so software optimisation is secondary.</p></li></ul><p>These are <strong>all just assumptions based on hunches</strong>, and while <strong>most of</strong> them may hold, the reality of competitive market making be that <strong>all of </strong>the <em>important assumptions about competition be satisfied. And they rarely are.</em></p><p>The consequence being that it is often unfathomable to a &#8216;retail trader&#8217; why said market making operation seems to bleed money, and in a fantastically consistent manner. They tweak position limits, change spreads, quote sizes, cancel thresholds and do everything conceivable without addressing any of the core issues. I have seen live, bleeding trading systems where algorithmic traders try to keep afloat <strong>when simple, diagnostic tools would have convinced them to shut it down immediately.</strong> </p><p><strong>Imagine a blind man rubbing his wife&#8217;s kneecap saying &#8220;are you close?&#8221;.</strong></p><p>You can sort of think about trading strategies at short durations as the following:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6L3R!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9b2dd43-7c0e-43de-9bcf-ef15cce9beaa_938x847.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6L3R!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9b2dd43-7c0e-43de-9bcf-ef15cce9beaa_938x847.png 424w, https://substackcdn.com/image/fetch/$s_!6L3R!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9b2dd43-7c0e-43de-9bcf-ef15cce9beaa_938x847.png 848w, https://substackcdn.com/image/fetch/$s_!6L3R!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9b2dd43-7c0e-43de-9bcf-ef15cce9beaa_938x847.png 1272w, https://substackcdn.com/image/fetch/$s_!6L3R!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9b2dd43-7c0e-43de-9bcf-ef15cce9beaa_938x847.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6L3R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9b2dd43-7c0e-43de-9bcf-ef15cce9beaa_938x847.png" width="455" height="410.85820895522386" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d9b2dd43-7c0e-43de-9bcf-ef15cce9beaa_938x847.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:847,&quot;width&quot;:938,&quot;resizeWidth&quot;:455,&quot;bytes&quot;:899917,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/180397944?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb59d0d14-942d-404f-b39f-26d7eda6ec1d_1024x1024.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!6L3R!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9b2dd43-7c0e-43de-9bcf-ef15cce9beaa_938x847.png 424w, https://substackcdn.com/image/fetch/$s_!6L3R!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9b2dd43-7c0e-43de-9bcf-ef15cce9beaa_938x847.png 848w, https://substackcdn.com/image/fetch/$s_!6L3R!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9b2dd43-7c0e-43de-9bcf-ef15cce9beaa_938x847.png 1272w, https://substackcdn.com/image/fetch/$s_!6L3R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9b2dd43-7c0e-43de-9bcf-ef15cce9beaa_938x847.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A larger threshold is required for lower cadence strategies due to the reduced number of bets, and the shape is related to the law of active portfolio management. I will speak on where a trading strategy typically lies on the duration axis.</p><p>At some duration delta, a market maker may have some internal fair pricing that gives the EV of a trade. That may look like the following:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4715!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc7eae4f-b86e-4058-95cd-568084135860_1253x680.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4715!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc7eae4f-b86e-4058-95cd-568084135860_1253x680.png 424w, https://substackcdn.com/image/fetch/$s_!4715!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc7eae4f-b86e-4058-95cd-568084135860_1253x680.png 848w, https://substackcdn.com/image/fetch/$s_!4715!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc7eae4f-b86e-4058-95cd-568084135860_1253x680.png 1272w, https://substackcdn.com/image/fetch/$s_!4715!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc7eae4f-b86e-4058-95cd-568084135860_1253x680.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4715!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc7eae4f-b86e-4058-95cd-568084135860_1253x680.png" width="629" height="341.3567438148444" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cc7eae4f-b86e-4058-95cd-568084135860_1253x680.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:680,&quot;width&quot;:1253,&quot;resizeWidth&quot;:629,&quot;bytes&quot;:59489,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/180397944?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc7eae4f-b86e-4058-95cd-568084135860_1253x680.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!4715!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc7eae4f-b86e-4058-95cd-568084135860_1253x680.png 424w, https://substackcdn.com/image/fetch/$s_!4715!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc7eae4f-b86e-4058-95cd-568084135860_1253x680.png 848w, https://substackcdn.com/image/fetch/$s_!4715!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc7eae4f-b86e-4058-95cd-568084135860_1253x680.png 1272w, https://substackcdn.com/image/fetch/$s_!4715!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc7eae4f-b86e-4058-95cd-568084135860_1253x680.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The latency sensitivity of the strategy is typically a function of the fudge factors and competition in executing the trade. For instance you can imagine that a triangular arbitrage on a single exchange has very little friction in terms of margin management and exchange-specific contract pricing. These will be extremely sensitive to latency conditions - every trader on the platform basically operate on the same bps thresholds.</p><p>Somewhere in the middle lies funding arbitrage. You can imagine that multi-exchange operations like this has fudge factors in terms of modelling (e.g. normalisation for variable funding mechanisms/margin/denominator assets) and execution (quoting, optimal leverage and margin problem, spot borrow). It is a kind-of statistical arbitrage problem where differences in the model imply competitors running similar strategies can have different fairprices - consequently these are less sensitive in terms of execution speed. If we take it abit further, such as beta-neutral funding portfolios (crypto) or fundamental pairs trading (equities in the same GICs classification) the latency requirements can become a secondary operational concern.</p><p>At any given delta, though, a well calibrated model (in shorter term trading) often faces the same execution problem: the projected model&#8217;s EV half-life is extremely dependent on which band of the threshold it is currently in. A model that suggests it is in taker-taker threshold (if well calibrated) should quickly converge to a less profitable band as other traders running similar strategies capitalise on that opportunity. It would be rather foolish to assume that such an outsized PNL basis is left hanging for more than a single second - a more reasonable conclusion is that the model&#8217;s estimation errors are correlated to some extraneous variable.</p><p>It should now be clear that different execution strategies incur different costs, and these result in different thresholds (again here different participants are subject to different costs). The latency requirements then depend on the correlated strategies of the other participants in relation to the size of the expected return.</p><p><strong>It is not too far of a step in concluding that understanding competition in a particular market (platform + instrument) for a particular strategy is crucial in deciding whether a trading strategy should be deployed in the first place.</strong></p><p>That was abit of a long rant, but that&#8217;s the whole point of this post. We shall take a look at how to model (both visually and quantitatively) the propagation latency of information between correlated assets. It will be a useful exercise for many strategies, including lead-lag/statistical/funding arbitrage type strategies, as well cross-exchange market making and derivative pricing scenarios (e.g. option price movements on Deribit after btcusdt move on Binance).</p><p>Today we will just look at writing a software harness for visually inspecting lead-lag behaviour on different markets. This can give useful information as to how traders react on different exchanges, which can be quite distinct based on factors such as venue&#8217;s dominance, tick size (and hence queue priority), and (physical) distance to the leader exchange.</p><p>The idea is just to model leader exchange as pushing triggers on these parameterisations - <strong>b, eta, m, d. </strong>The lagger reacts to these triggers.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;b, \\quad  \\eta, \\quad m,\\quad d&quot;,&quot;id&quot;:&quot;QAWNJKZWSG&quot;}" data-component-name="LatexBlockToDOM"></div><p><strong>b-</strong> represents the minimum move in basis points on a single bba tick at time <strong>t.</strong><br><strong>eta - </strong>parameterises the sensitivity/beta of response at lagger to the <strong>b</strong>-sized moved on leader. useful for comparing markets with unique betas or lead-lag correlation.<br><strong>m - </strong>the minimum lookahead to accept a response from the lagger venue. responses after <strong>t + m </strong>are invalid.<br><strong>d - </strong>debouncing parameter to ignore duplicated triggers on source exchange up to <strong>t + d</strong>.<br></p><p>Here is what such a modelling exercise may look like: (code below)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fcpx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd08cf8c1-be77-4172-80ba-60052367f25c_1728x697.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fcpx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd08cf8c1-be77-4172-80ba-60052367f25c_1728x697.png 424w, https://substackcdn.com/image/fetch/$s_!fcpx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd08cf8c1-be77-4172-80ba-60052367f25c_1728x697.png 848w, https://substackcdn.com/image/fetch/$s_!fcpx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd08cf8c1-be77-4172-80ba-60052367f25c_1728x697.png 1272w, https://substackcdn.com/image/fetch/$s_!fcpx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd08cf8c1-be77-4172-80ba-60052367f25c_1728x697.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fcpx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd08cf8c1-be77-4172-80ba-60052367f25c_1728x697.png" width="1456" height="587" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d08cf8c1-be77-4172-80ba-60052367f25c_1728x697.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:587,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:67412,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/180397944?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd08cf8c1-be77-4172-80ba-60052367f25c_1728x697.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!fcpx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd08cf8c1-be77-4172-80ba-60052367f25c_1728x697.png 424w, https://substackcdn.com/image/fetch/$s_!fcpx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd08cf8c1-be77-4172-80ba-60052367f25c_1728x697.png 848w, https://substackcdn.com/image/fetch/$s_!fcpx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd08cf8c1-be77-4172-80ba-60052367f25c_1728x697.png 1272w, https://substackcdn.com/image/fetch/$s_!fcpx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd08cf8c1-be77-4172-80ba-60052367f25c_1728x697.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In this case the tick size is identical. We can take a zoom-ed in look:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oqB6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77bbe2e7-8ae4-44d6-8a6d-2c777305fa7e_1728x697.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oqB6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77bbe2e7-8ae4-44d6-8a6d-2c777305fa7e_1728x697.png 424w, https://substackcdn.com/image/fetch/$s_!oqB6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77bbe2e7-8ae4-44d6-8a6d-2c777305fa7e_1728x697.png 848w, https://substackcdn.com/image/fetch/$s_!oqB6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77bbe2e7-8ae4-44d6-8a6d-2c777305fa7e_1728x697.png 1272w, https://substackcdn.com/image/fetch/$s_!oqB6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77bbe2e7-8ae4-44d6-8a6d-2c777305fa7e_1728x697.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oqB6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77bbe2e7-8ae4-44d6-8a6d-2c777305fa7e_1728x697.png" width="1456" height="587" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/77bbe2e7-8ae4-44d6-8a6d-2c777305fa7e_1728x697.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:587,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:69236,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/180397944?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77bbe2e7-8ae4-44d6-8a6d-2c777305fa7e_1728x697.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!oqB6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77bbe2e7-8ae4-44d6-8a6d-2c777305fa7e_1728x697.png 424w, https://substackcdn.com/image/fetch/$s_!oqB6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77bbe2e7-8ae4-44d6-8a6d-2c777305fa7e_1728x697.png 848w, https://substackcdn.com/image/fetch/$s_!oqB6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77bbe2e7-8ae4-44d6-8a6d-2c777305fa7e_1728x697.png 1272w, https://substackcdn.com/image/fetch/$s_!oqB6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77bbe2e7-8ae4-44d6-8a6d-2c777305fa7e_1728x697.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>And you can see that the reaction-trigger latencies occur <em><strong>well</strong></em> <em><strong>inside of 40ms between the two exchange timestamps. </strong></em>It doesn&#8217;t take too much effort to spin up two ec2 instances and run a ping test from Tokyo to Singapore:</p><pre><code>64 bytes from 13.230.31.102: icmp_seq=454 ttl=117 time=68.8 ms
64 bytes from 13.230.31.102: icmp_seq=455 ttl=117 time=68.8 ms
64 bytes from 13.230.31.102: icmp_seq=456 ttl=117 time=68.7 ms
64 bytes from 13.230.31.102: icmp_seq=457 ttl=117 time=68.8 ms ...</code></pre><p>Roughly between 34~35ms between the <strong>two AZs</strong>. Considering that binance fapi-streams often experience jitter up to high single digits, the latency budget is incredibly tight, and in fact a pure market making system running ultra low-latency algorithms between these two exchanges have <strong>low to zero latency budgets. </strong>Having access to fapi-mm, fstream-mm is essentially a minimum ticket.</p><p>Let&#8217;s try another one, say Deribit btc-perps with primary servers in Equinix LD4 (London). <strong>Tick sizes are five times thicker,</strong> so multiple &#8216;triggers&#8217; are consolidated into one &#8216;reaction&#8217;. This one is already zoomed-in, and you can see <strong>propagation latencies &lt;75ms.</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5zHR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf5d6859-551a-4865-b936-3ca524e2b84c_1728x720.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5zHR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf5d6859-551a-4865-b936-3ca524e2b84c_1728x720.png 424w, https://substackcdn.com/image/fetch/$s_!5zHR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf5d6859-551a-4865-b936-3ca524e2b84c_1728x720.png 848w, https://substackcdn.com/image/fetch/$s_!5zHR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf5d6859-551a-4865-b936-3ca524e2b84c_1728x720.png 1272w, https://substackcdn.com/image/fetch/$s_!5zHR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf5d6859-551a-4865-b936-3ca524e2b84c_1728x720.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5zHR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf5d6859-551a-4865-b936-3ca524e2b84c_1728x720.png" width="1456" height="607" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bf5d6859-551a-4865-b936-3ca524e2b84c_1728x720.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:607,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:49639,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.research.hangukquant.com/i/180397944?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf5d6859-551a-4865-b936-3ca524e2b84c_1728x720.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!5zHR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf5d6859-551a-4865-b936-3ca524e2b84c_1728x720.png 424w, https://substackcdn.com/image/fetch/$s_!5zHR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf5d6859-551a-4865-b936-3ca524e2b84c_1728x720.png 848w, https://substackcdn.com/image/fetch/$s_!5zHR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf5d6859-551a-4865-b936-3ca524e2b84c_1728x720.png 1272w, https://substackcdn.com/image/fetch/$s_!5zHR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf5d6859-551a-4865-b936-3ca524e2b84c_1728x720.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><pre><code>64 bytes from 13.230.31.102: icmp_seq=314 ttl=117 time=210 ms
64 bytes from 13.230.31.102: icmp_seq=315 ttl=117 time=210 ms
64 bytes from 13.230.31.102: icmp_seq=316 ttl=117 time=210 ms
64 bytes from 13.230.31.102: icmp_seq=317 ttl=117 time=210 ms...</code></pre><p>A simply proxy from eu-west2 and ap-northeast1 gives <strong>&gt;100ms on a one-way trip.</strong> The <strong>latency budget is negative.</strong> That can&#8217;t be right! Except, remember our previous post on appreciating hft network infra landscapes:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;8d8c99d2-d645-4049-bee0-da91066fbe58&quot;,&quot;caption&quot;:&quot;&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Nimble Market Maker - appreciating hft landscape&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:42788676,&quot;name&quot;:&quot;HangukQuant&quot;,&quot;bio&quot;:&quot;quant research and quant dev. not financial advice.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2025-11-25T17:16:58.724Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!f5RQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.research.hangukquant.com/p/nimble-market-maker-appreciating&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:177961940,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:9,&quot;comment_count&quot;:0,&quot;publication_id&quot;:453792,&quot;publication_name&quot;:&quot;HangukQuant Research&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!LX9y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc5718e3-074f-4c1d-a77d-f1fa609a9ea0_1280x1280.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>Between these two venues, information takes roughly 55~70ms cross-continent on a dedicated fiber path&#8230;</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;e1aa3e25-5e34-4e09-99b8-1129a31939ca&quot;,&quot;caption&quot;:&quot;&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;research.hangukquant.com sale~ into 2026&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:42788676,&quot;name&quot;:&quot;HangukQuant&quot;,&quot;bio&quot;:&quot;quant research and quant dev. not financial advice.&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/733e6c1a-d932-4d0f-8f5a-4fa0c33d8d29_4096x2528.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2025-12-01T16:30:11.147Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!ruJr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c429c1a-ab03-4144-9aa9-b1fc6a70ec33_1252x1023.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.research.hangukquant.com/p/researchhangukquantcom-sale-into&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:180379637,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:1,&quot;comment_count&quot;:0,&quot;publication_id&quot;:453792,&quot;publication_name&quot;:&quot;HangukQuant Research&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!LX9y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc5718e3-074f-4c1d-a77d-f1fa609a9ea0_1280x1280.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div>
      <p>
          <a href="https://www.research.hangukquant.com/p/market-making-tooling-for-modelling">
              Read more
          </a>
      </p>
   ]]></content:encoded></item></channel></rss>