HEAT: A Hybrid Homomorphic Encryption Framework for Secure and Efficient Algorithmic Trading Strategy Hosting
Abstract
With the rise of algorithmic trading, code-hosting platforms such as TradingView have become increasingly popular for strategy development and deployment. However, these platforms typically store and execute user-submitted strategies in plaintext, which introduces significant risks of data leakage. While fully homomorphic encryption (FHE) presents a promising avenue for secure execution, existing FHE-based schemes face two challenges in strategy hosting: (i) incomplete privacy protection that exposes sensitive user-defined parameters, and (ii) prohibitive real-time execution overhead. To address these challenges, we present HEAT, a hybrid FHE framework for secure and efficient strategy hosting. HEAT achieves this through two techniques: first, secure indicator construction combined with FHE-aware load optimization, which protects strategy parameters while eliminating redundant overhead; second, an automated AST-based computation reordering method that minimizes real-time latency by globally offloading precomputable and deferrable code segments. Experiments using Binance Ethereum contract data demonstrate that HEAT achieves average real-time speedups of 280.1× for financial indicators and 12.9× for trading strategies, compared to a baseline that directly uses the state-of-the-art HEIR compiler without our framework. Furthermore, after decryption, HEAT’s indicator results have a relative error below 0.1%, while its trading decisions exactly match those of the corresponding plaintext strategies.