展示HN:确定性状态机用于声音化交易波动性

1作者: internintern25 天前原帖
<a href="https://liquidityfm.org" rel="nofollow">https://liquidityfm.org</a><p>我创建这个工具的原因是,现有的市场声化工具通常只是将价格映射到音高,结果产生的更多是噪音而非音乐。我希望有一个系统能够将市场情绪转化为我在工作时愿意在背景中聆听的音乐。<p>逻辑(状态机)<p>我构建了一个确定性的状态机,而不是简单的音高映射,它将实时数据标准化为60种不同的音频变体,基于三个向量:<p>1. 情绪:蜡烛颜色的变化(绝望 -> 欣喜)<p>2. 能量:动量/波动性(平静 -> 爆发)<p>3. 纹理:成交量与20日移动平均线(稀疏 -> 混乱)<p>如果市场进入“绝望/爆发/混乱”状态,系统会触发重度失真和小调。如果转变为“欣喜/平静”,则会渐变为氛围大调的和声。<p>工程实现<p>共识引擎:通过Websockets从Kraken、Binance和OKX获取数据,形成聚合价格并过滤掉“欺诈蜡烛”。我特别选择加密货币数据源,因为它们提供持续的高流量数据流,而不是在下午4点关闭,但实际上可以基于任何数据。<p>音频管道:两阶段的自主工作流程(生成 -> 评估),用于创作歌词和风格,然后在Suno中生成。为了确保零延迟并降低成本,我预生成了约500首与60种状态变体相对应的曲目库。应用程序实时处理这些状态之间的渐变。<p>技术栈:Next.js、CCXT(套接字标准化)和Cloudflare R2。<p>“时间机器”<p>我最喜欢的部分是历史播放列表。例如,您可以加载FTX崩盘(<a href="https://liquidityfm.org/replay/ftx-collapse-2022" rel="nofollow">https://liquidityfm.org/replay/ftx-collapse-2022</a>)或后疫情时期的反弹,逐根蜡烛地听听恐慌或欣喜的真实声音。我也对CRT模式感到奇怪的自豪,尽管说实话我很少使用它。<p>该工具免费使用,无需注册。如有任何问题或改进建议,请告诉我!
查看原文
<a href="https:&#x2F;&#x2F;liquidityfm.org" rel="nofollow">https:&#x2F;&#x2F;liquidityfm.org</a><p>I built this because existing market sonification tools usually just map price to pitch, resulting more noise than music. I wanted a system that translated market sentiment into music that I would actually want to listen to in the background while I work.<p>THE LOGIC (State Machine)<p>Instead of raw pitch mapping, I built a deterministic state machine that normalizes live data into 60 distinct audio permutations based on three vectors:<p>1. Sentiment: Candle color streaks (Doom -&gt; Euphoric)<p>2. Energy: Momentum&#x2F;Volatility (Still -&gt; Explosive)<p>3. Texture: Volume vs 20 MA (Sparse -&gt; Chaotic)<p>If the market enters a &quot;Doom &#x2F; Explosive &#x2F; Chaotic&quot; state, the engine triggers heavy distortion and minor keys. If it flips to &quot;Euphoric &#x2F; Still,&quot; it crossfades into ambient major pads.<p>THE ENGINEERING<p>Consensus Engine: Websockets from Kraken, Binance, and OKX to form an aggregated price and filter out &quot;scam wicks&quot;. I specifically chose crypto feeds because they offer continuous high-volume stream instead of closing at 4pm but it could really be based on anything.<p>Audio Pipeline: Two-stage agentic workflow (Generation -&gt; Critique) to create lyrics and style, which are then generated in Suno. To ensure zero latency and to reduce costs, I pre-generated a library of ~500 tracks mapped to the 60 state permutations. The app handles the crossfading between these states in real-time.<p>Stack: Next.js, CCXT (socket normalization), and Cloudflare R2.<p>THE &quot;TIME MACHINE&quot;<p>The part that I actually enjoy the most are the historical playlists. E.g. you can load the FTX crash (<a href="https:&#x2F;&#x2F;liquidityfm.org&#x2F;replay&#x2F;ftx-collapse-2022" rel="nofollow">https:&#x2F;&#x2F;liquidityfm.org&#x2F;replay&#x2F;ftx-collapse-2022</a>) or the Post-Covid rally candle-by-candle to hear what panic or euphoria actually sounds like. I&#x27;m also oddly proud of the CRT mode although tbh I rarely run with it.<p>It is free to use, no signup required. Let me know if you have any questions or suggestions for improvement!