Tag Archives: #crypto

FPGA Triggers for Ultra Low Latency Trading

December 2022

Currently I consult for Magmio.com, a leading FPGA development firm, touting value of C++/HLS development for ULL with Magmio API’s.

https://www.magmio.com/news/91-the-new-magmio-product-video  –click on ‘High-frequency trading acceleration with…

HLS

FPGA IP Cores in blue; Access & set up Triggers via Magmio C++/HLS API’s

https://www.youtube.com/watch?v=4Wklh0XS5i0  — click skip adds to view *** Optimizing Trading Strategies for FPGAs in C/C++ | Milan Dvorak – in detail describes C++ coding modifications, that lead to 15 ns and why.  I strongly recommend viewing this video.  Decreasing variable sizes to what is absolutely necessary and using a reciprocal for multiplication instead of division, lead to the significant reduction from 224 ns to 15 ns.

micro price

Key indicators leading to ULL trading successes:

Capture Ratio – % of all relevant Symbol quotes from last trade to exact point your app creates an order.  For Best Execution, to fill trades at best current price, Sell Side execution brokers should be at least 80%, while Prop Trading firms should be at least 90%.

Fill Rate – % of your order quantities being executed.  In out NYU ULL class, Our ‘tuned’ LSTM Recurrent Neural Network Machine Learning (ML) model accurately projected Fill Rates +/- 4%.  Utilizing same input data, our Decision Tree Machine Learning model identified what factors determined higher fill rates, such as specific venues to route to, specific orders by size and type (ML-enhanced SOR).

Add another key indicator that Magmio optimizes – ‘Algo-Trading Hit Rate’ – defined as follows:

  • How often are your real time analytics inferences or triggers timely hitting your algo trading strategies at most opportune times – to BEAT YOUR COMPETITORS?  Analytics inferences and triggers can ne derived from ULL ML/AI in FPGA’s or non ML/AL – simply deriving triggers from live and historical data.
  • Way below I list many triggers that can lead to high algp-trading hit rates.

Common HFT-Trigger: micro-price

However, for a quick Magmio enhanced example let’s focus on a common HFT trigger — ‘microprice’– actually a weighted mid-price.  Microprice is defined by formula:

 (Pa × Qb + Pb × Qa )/(Qb + Qa ),

 where Pa is ask price, Pb is bid price, Qa is ask quantity, and Qb is bid quantity. 

https://www.magmio.com/white-papers  click on ‘Acceleration of trading algorithms with MAGMIO’ for a quick review of how microprice calculations, with C++/HSL decreased from 224 ns to 15 ns .

Triggers – 100 ns for Trigger based strategies

Consider then many other triggers that can be created via C++/HLS running as FPGA in a FPGA card in an over-clocked server.  Then forward them to your algo strategy in approximately 100 ns.  Triggers can include following:

  1. Specific bid/ask price spreads
  2. Specific microprice levels
  3. Immediate action on momentum-based analytics (as we learned in ULL class – RSI, MACD, Fast Quant)
  4. Specific variances in real time vs historical volumes for specific symbols at precise times in the trading day  — ex: 9:45:00 AM.  Volume – Participation algo model may be set up to trade larger volumes in a symbol, index, future option, ETF, FX, T-Bills, etc ..  as volume rates increase, subsequent to real time risk analytics
  5. Variances or anomalies in Pairs Trading
  6. ‘Density’ signals – ex: ML/AI Anomaly Engine identifies specific symbol # of quotes in  rolling windows 100 ms, that per prior analysis indicates certain actions to optimize trading.
  7. LSTM Recurrent Neural Network predicts ‘density’ signal based on deep ML analysis (recent data strongly correlates with prior)
  8. Our Decision Tree or Random Forest ML identifies that Venue A, and definitely not Venues B or C, for best Fill Rates; hence triggers can optimize an SOR
  9. A trigger on a precise VIX level or a specific rapid change to VIX –ex: calculus 1st or2nd derivative VIX rate where prior analysis points to specific trading to take advantage of volatility.
    • Crypto exchanges & Traders: After determining VIX & BitCoin correlations, a trigger on a precise VIX level or a specific rapid change to VIX –ex: calculus 1st or2nd derivative VIX rate where prior analysis points to specific trading to take advantage of volatility.
  10. Set special triggers on market data
  11. Set special triggers on alternate data -ex: http://RavenPack.com or – https://www.cloudquant.com/products/

We can add many more; these are just samples.

Key point is:

Take advantage of Magmio C/C++/HLS API accessing FPGA IP Cores to identify triggers to act on in 100 ns

Other key ULL aspects of MAGMIO include:

  • CME Tick-2-Trade < 300 ns
  • Book Builds < 350 ns
  • Test framework before you decide to buy; this is via software simulator that evaluates C++/ HLS compiler
  • A partner of Cisco; work to extend Cisco/ExaBlaze Smart NIC’s – ex: NEXUS V9P-3 FPGA SmartNIC Adapter
    • Pre-allocate buffers of FIX order messages ready in FPGA
  • Set up Level 4 market data in FPGA to determine your places all book levels (are you first in line for best prices?)

Whether your firm is HFT, Prop Trading, Market Making, Quant Hedge, Sell Side Execution Broker, Buy Side, Crypto Exchange – Broker -or Liquidity Aggregator or SOR, 100% dedicated for BestEx for clients, Magmio.com solutions can catapult you past your competition.

To speed up understanding how a Magmio solution can best work for your trading, please contact me at ai-fit@ai-fit.org

Best regards,

Ted Hruzd

CEO of AI-Fit LLC & a Magmio partner