{"id":468350,"date":"2025-07-23T15:02:09","date_gmt":"2025-07-23T15:02:09","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=468350"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=468350","title":{"rendered":"<span>\u041f\u043e\u0447\u0435\u043c\u0443 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0430\u0440\u0441\u0435\u0440 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0440\u0435\u0448\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0443: \u043c\u043e\u0439 \u043e\u043f\u044b\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441\u043f\u043e\u0440\u0442\u0438\u0432\u043d\u044b\u0445 API<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h4>\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442<\/h4>\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u043f\u043e\u0440\u0442\u0438\u0432\u043d\u043e\u0439 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438 \u044f \u0445\u043e\u0442\u0435\u043b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c real-time \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u043e \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432 \u2014 \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0441 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b pickingodds.com. \u0423 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0444\u0438\u0447\u0430 \u2014 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043b\u0438\u043d\u0438\u0438 \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u044e. \u042d\u0442\u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0445 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0439, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u0440\u0435\u0437\u043a\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u0435\u0439 \u043c\u0430\u0440\u043a\u0435\u0442-\u043c\u0435\u0439\u043a\u0435\u0440\u043e\u0432).<\/p>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043b\u0430\u043d \u0431\u044b\u043b \u043f\u0440\u043e\u0441\u0442: \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e REST API, \u0432\u044b\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0440\u0430\u0437 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0438\u043d\u0443\u0442, \u043f\u0438\u0441\u0430\u0442\u044c \u0432 TSDB, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438 \u0444\u0438\u0447\u0435\u0439 \u0432 ML-\u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430\u0445. \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0436\u0435 \u0432\u0441\u0451 \u0431\u044b\u0441\u0442\u0440\u043e \u0443\u0448\u043b\u043e \u0432 \u0437\u043e\u043d\u0443 \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<hr\/>\n<h4>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f<\/h4>\n<h4>1. Rate limit \u0438 \u00ab\u043d\u0435\u0432\u0438\u0434\u0438\u043c\u0430\u044f \u0441\u0442\u0435\u043d\u0430\u00bb<\/h4>\n<p>Pickingodds \u044f\u0432\u043d\u043e \u043d\u0435 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0441\u0442\u044c API, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0432\u0435\u0441\u044c\u043c\u0430 \u0436\u0451\u0441\u0442\u043a\u0438\u0435 \u2014 \u0434\u043e 10 rps \u043d\u0430 IP, \u0441 \u0431\u043b\u043e\u043a\u0430\u043c\u0438 \u043f\u0440\u0438 burst-\u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445. \u041f\u0440\u0438\u0447\u0451\u043c \u043b\u0438\u043c\u0438\u0442 \u043d\u0435 \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u0445 \u043e\u0442\u0432\u0435\u0442\u0430 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0432\u0438\u0434\u0435 5xx \u0438 \u0431\u0430\u043d\u043e\u0432 \u043d\u0430 10\u201315 \u043c\u0438\u043d\u0443\u0442.<\/p>\n<p><strong>\u0427\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b:<\/strong><\/p>\n<ul>\n<li>\n<p>\u043e\u0431\u0451\u0440\u0442\u043a\u0430 \u0441 <strong>token bucket rate limiter<\/strong> (\u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0447\u0435\u0440\u0435\u0437 <code>asyncio.Semaphore<\/code> + <code>aiojobs<\/code>);<\/p>\n<\/li>\n<li>\n<p><strong>adaptive throttling<\/strong> \u2014 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0434\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0434 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u0438 \u0447\u0430\u0441\u0442\u043e\u0442\u0443 429\/5xx;<\/p>\n<\/li>\n<li>\n<p><strong>IP rotation \u0447\u0435\u0440\u0435\u0437 proxy pool<\/strong> \u2014 \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443.<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<h4>2. \u041d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043e\u0442\u0432\u0435\u0442\u0430<\/h4>\n<p>API \u043e\u0442\u0434\u0430\u0451\u0442 deeply nested JSON, \u0431\u0435\u0437 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u0445\u0435\u043c. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0431\u0435\u0437 ID \u043c\u0430\u0442\u0447\u0430, \u0440\u044b\u043d\u043a\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435, \u0447\u0430\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e secondary endpoint\u2019\u0430\u043c.<\/p>\n<p><strong>\u0427\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b:<\/strong><\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043b \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0441 <code>pydantic<\/code>-\u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 fallback-\u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0438 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e\u0439 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0435\u0439;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u043b DSL-\u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440, \u043c\u0430\u043f\u043f\u044f\u0449\u0438\u0439 \u0442\u0438\u043f\u044b \u0440\u044b\u043d\u043a\u043e\u0432 \u043d\u0430 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 (<code>@register_market('1X2') \u2192 parse_mainline()<\/code> \u0438 \u0442.\u0434.);<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u0438\u043b <strong>schema-aware \u043a\u0435\u0448<\/strong> \u2014 raw JSON \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 Redis \u0441 TTL, \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043f\u043e SHA256-\u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0435 payload\u2019a.<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<h4>3. \u041d\u0435\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 \/ push-\u0444\u0438\u0434\u0430<\/h4>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 WebSocket \u0438\u043b\u0438 \u0445\u043e\u0442\u044f \u0431\u044b Server-Sent Events \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0433\u043e pull-\u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043c\u0430\u0442\u0447\u0435\u0439 \u044d\u0442\u043e \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e \u2014 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u0435\u043d \u0447\u0430\u0441\u0442\u044b\u0439 \u043e\u043f\u0440\u043e\u0441 (\u0440\u0430\u0437 \u0432 10\u201330 \u0441\u0435\u043a).<\/p>\n<p><strong>\u0427\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b:<\/strong><\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u0434\u043d\u044f\u043b \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 <code>fetch_orchestrator<\/code> \u043d\u0430 <code>aiohttp + trio<\/code>, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u0430\u0442\u0447 \u2014 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f coroutine, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u0430\u044f \u0447\u0435\u0440\u0435\u0437 event loop;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0430\u043f\u0438\u0441\u0430\u043b mini-FSM \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430: <code>INIT \u2192 WAITING \u2192 FETCHING \u2192 BACKOFF \u2192 IDLE<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b <strong>\u0441\u043b\u043e\u0438\u0441\u0442\u0443\u044e \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0437\u0430\u0446\u0438\u044e<\/strong> \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u2014 top-\u043b\u0438\u0433\u0438 \u0438 \u201c\u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435\u201d \u0441\u043e\u0431\u044b\u0442\u0438\u044f (\u043f\u043e ML-\u0444\u043b\u0430\u0433\u0443) \u0438\u043c\u0435\u044e\u0442 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u0438\u0439 polling rate;<\/p>\n<\/li>\n<li>\n<p>\u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f \u0438 \u0441\u0442\u0440\u0438\u043c\u044f\u0442\u0441\u044f \u0432 Kafka \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u0438 \u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430.<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<h4>ML \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435: \u043e\u0442 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0434\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u0430<\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0442\u044f\u043d\u0443\u0442\u044c 1000+ \u043c\u0430\u0442\u0447\u0435\u0439 \u0438 \u043d\u0435 \u0437\u0430\u0431\u0438\u0432\u0430\u0442\u044c \u043b\u0438\u043c\u0438\u0442, \u044f \u0432\u043d\u0435\u0434\u0440\u0438\u043b \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 ML-\u0444\u0438\u043b\u044c\u0442\u0440.<\/p>\n<p> \u041e\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u043a\u0430\u043a\u0438\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b (\u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u043b\u0438\u043d\u0438\u0438 \u0432 \u043f\u0435\u0440\u0432\u044b\u0435 3\u20135 \u043c\u0438\u043d\u0443\u0442 \u0438 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432).<\/p>\n<p><strong>\u041c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044f:<\/strong><\/p>\n<ul>\n<li>\n<p>pipeline \u043d\u0430 Scikit-Learn \/ LightGBM;<\/p>\n<\/li>\n<li>\n<p>\u0444\u0438\u0447\u0438: <code>delta_coef<\/code>, <code>volatility_window<\/code>, <code>source_count<\/code>, <code>market_spread<\/code>, <code>momentum_score<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u043c\u0435\u0442\u043a\u0430 \u2014 <code>is_significant_move<\/code> (\u0431\u0438\u043d\u0430\u0440\u043d\u0430\u044f, \u0440\u0430\u0437\u043c\u0435\u0447\u0435\u043d\u043e \u043f\u043e \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u043c);<\/p>\n<\/li>\n<li>\n<p>\u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441 \u2014 \u0432 \u043e\u043d\u043b\u0430\u0439\u043d\u0435, \u043a\u0430\u0436\u0434\u044b\u0435 5 \u043c\u0438\u043d\u0443\u0442 \u043f\u0435\u0440\u0435\u0441\u0447\u0451\u0442 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 event\u2019\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u0424\u0438\u043b\u044c\u0442\u0440 \u0441\u043d\u0438\u0437\u0438\u043b \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0442\u0440\u0435\u043a\u0435\u0440\u043e\u0432 \u043d\u0430 ~60% \u0431\u0435\u0437 \u043f\u043e\u0442\u0435\u0440\u0438 \u0446\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432.<\/p>\n<hr\/>\n<h4>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/h4>\n<pre><code>[PickingOdds API]         |     [Fetcher Pool]         |   [Async Orchestrator]         | +-------+--------+ |                | Redis (raw)    Kafka (events) |                | TimescaleDB     ML worker pool |                |  Grafana         Alert Engine <\/code><\/pre>\n<hr\/>\n<h4>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0442\u0435\u043a<\/h4>\n<ul>\n<li>\n<p><strong>Python 3.11<\/strong>, <strong>Trio<\/strong>, <strong>aiohttp<\/strong>, <strong>Pydantic v2<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>Redis<\/strong> (\u0441\u0436\u0430\u0442\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 LZ4)<\/p>\n<\/li>\n<li>\n<p><strong>Kafka + Faust<\/strong> \u0434\u043b\u044f \u0441\u0442\u0440\u0438\u043c-\u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u043e\u0432<\/p>\n<\/li>\n<li>\n<p><strong>TimescaleDB<\/strong> \u0434\u043b\u044f \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043e\u0432 \u0438 \u0440\u0435\u0442\u0440\u043e\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430<\/p>\n<\/li>\n<li>\n<p><strong>Prometheus + Grafana<\/strong> \u0434\u043b\u044f realtime \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430<\/p>\n<\/li>\n<li>\n<p><strong>ML inference<\/strong> \u043d\u0430 <strong>FastAPI<\/strong> \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c inference layer<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<h4>\u0412\u044b\u0432\u043e\u0434\u044b<\/h4>\n<p>\u041e\u0436\u0438\u0434\u0430\u043b \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e, \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0432\u044b\u0441\u043e\u043a\u043e\u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043d\u044b\u043c \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u043e\u043c, ML-\u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0435\u0439 \u0438 rate-aware \u043e\u0440\u043a\u0435\u0441\u0442\u0440\u0430\u0446\u0438\u0435\u0439.<\/p>\n<p><strong>TL;DR<\/strong>:<\/p>\n<ul>\n<li>\n<p>REST API \u2014 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u00ab\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u00bb, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0431\u0435\u0437 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 \u0438 \u043f\u0440\u0438 \u0430\u0433\u0440\u0435\u0441\u0441\u0438\u0432\u043d\u044b\u0445 \u043b\u0438\u043c\u0438\u0442\u0430\u0445.<\/p>\n<\/li>\n<li>\n<p>\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c, \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 ML-\u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u0441\u043f\u0430\u0441\u0430\u044e\u0442 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043e\u0442 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>Pickingodds \u2014 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a, \u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0439 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0431\u044b\u043b \u043e\u043f\u044b\u0442 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u043f\u043e\u0440\u0442\u0438\u0432\u043d\u044b\u0445 \u0444\u0438\u0434\u043e\u0432 \u2014 \u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445. \u0421\u0440\u0430\u0432\u043d\u0438\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u044b.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/930360\/\"> https:\/\/habr.com\/ru\/articles\/930360\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h4>\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442<\/h4>\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u043f\u043e\u0440\u0442\u0438\u0432\u043d\u043e\u0439 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438 \u044f \u0445\u043e\u0442\u0435\u043b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c real-time \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u043e \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432 \u2014 \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0441 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b pickingodds.com. \u0423 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0444\u0438\u0447\u0430 \u2014 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043b\u0438\u043d\u0438\u0438 \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u044e. \u042d\u0442\u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0445 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0439, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u0440\u0435\u0437\u043a\u043e\u0439 \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u0435\u0439 \u043c\u0430\u0440\u043a\u0435\u0442-\u043c\u0435\u0439\u043a\u0435\u0440\u043e\u0432).<\/p>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043b\u0430\u043d \u0431\u044b\u043b \u043f\u0440\u043e\u0441\u0442: \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e REST API, \u0432\u044b\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0440\u0430\u0437 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0438\u043d\u0443\u0442, \u043f\u0438\u0441\u0430\u0442\u044c \u0432 TSDB, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438 \u0444\u0438\u0447\u0435\u0439 \u0432 ML-\u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430\u0445. \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0436\u0435 \u0432\u0441\u0451 \u0431\u044b\u0441\u0442\u0440\u043e \u0443\u0448\u043b\u043e \u0432 \u0437\u043e\u043d\u0443 \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<hr\/>\n<h4>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f<\/h4>\n<h4>1. Rate limit \u0438 \u00ab\u043d\u0435\u0432\u0438\u0434\u0438\u043c\u0430\u044f \u0441\u0442\u0435\u043d\u0430\u00bb<\/h4>\n<p>Pickingodds \u044f\u0432\u043d\u043e \u043d\u0435 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0441\u0442\u044c API, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0432\u0435\u0441\u044c\u043c\u0430 \u0436\u0451\u0441\u0442\u043a\u0438\u0435 \u2014 \u0434\u043e 10 rps \u043d\u0430 IP, \u0441 \u0431\u043b\u043e\u043a\u0430\u043c\u0438 \u043f\u0440\u0438 burst-\u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445. \u041f\u0440\u0438\u0447\u0451\u043c \u043b\u0438\u043c\u0438\u0442 \u043d\u0435 \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u0445 \u043e\u0442\u0432\u0435\u0442\u0430 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0432\u0438\u0434\u0435 5xx \u0438 \u0431\u0430\u043d\u043e\u0432 \u043d\u0430 10\u201315 \u043c\u0438\u043d\u0443\u0442.<\/p>\n<p><strong>\u0427\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b:<\/strong><\/p>\n<ul>\n<li>\n<p>\u043e\u0431\u0451\u0440\u0442\u043a\u0430 \u0441 <strong>token bucket rate limiter<\/strong> (\u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0447\u0435\u0440\u0435\u0437 <code>asyncio.Semaphore<\/code> + <code>aiojobs<\/code>);<\/p>\n<\/li>\n<li>\n<p><strong>adaptive throttling<\/strong> \u2014 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0434\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0434 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u0438 \u0447\u0430\u0441\u0442\u043e\u0442\u0443 429\/5xx;<\/p>\n<\/li>\n<li>\n<p><strong>IP rotation \u0447\u0435\u0440\u0435\u0437 proxy pool<\/strong> \u2014 \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443.<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<h4>2. \u041d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043e\u0442\u0432\u0435\u0442\u0430<\/h4>\n<p>API \u043e\u0442\u0434\u0430\u0451\u0442 deeply nested JSON, \u0431\u0435\u0437 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u0445\u0435\u043c. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0431\u0435\u0437 ID \u043c\u0430\u0442\u0447\u0430, \u0440\u044b\u043d\u043a\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435, \u0447\u0430\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e secondary endpoint\u2019\u0430\u043c.<\/p>\n<p><strong>\u0427\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b:<\/strong><\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043b \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0441 <code>pydantic<\/code>-\u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 fallback-\u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0438 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e\u0439 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0435\u0439;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u043b DSL-\u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440, \u043c\u0430\u043f\u043f\u044f\u0449\u0438\u0439 \u0442\u0438\u043f\u044b \u0440\u044b\u043d\u043a\u043e\u0432 \u043d\u0430 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 (<code>@register_market('1X2') \u2192 parse_mainline()<\/code> \u0438 \u0442.\u0434.);<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u0438\u043b <strong>schema-aware \u043a\u0435\u0448<\/strong> \u2014 raw JSON \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 Redis \u0441 TTL, \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043f\u043e SHA256-\u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0435 payload\u2019a.<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<h4>3. \u041d\u0435\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 \/ push-\u0444\u0438\u0434\u0430<\/h4>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 WebSocket \u0438\u043b\u0438 \u0445\u043e\u0442\u044f \u0431\u044b Server-Sent Events \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0433\u043e pull-\u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043c\u0430\u0442\u0447\u0435\u0439 \u044d\u0442\u043e \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e \u2014 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u0435\u043d \u0447\u0430\u0441\u0442\u044b\u0439 \u043e\u043f\u0440\u043e\u0441 (\u0440\u0430\u0437 \u0432 10\u201330 \u0441\u0435\u043a).<\/p>\n<p><strong>\u0427\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b:<\/strong><\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u0434\u043d\u044f\u043b \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 <code>fetch_orchestrator<\/code> \u043d\u0430 <code>aiohttp + trio<\/code>, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u0430\u0442\u0447 \u2014 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f coroutine, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u0430\u044f \u0447\u0435\u0440\u0435\u0437 event loop;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0430\u043f\u0438\u0441\u0430\u043b mini-FSM \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430: <code>INIT \u2192 WAITING \u2192 FETCHING \u2192 BACKOFF \u2192 IDLE<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b <strong>\u0441\u043b\u043e\u0438\u0441\u0442\u0443\u044e \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0437\u0430\u0446\u0438\u044e<\/strong> \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u2014 top-\u043b\u0438\u0433\u0438 \u0438 \u201c\u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435\u201d \u0441\u043e\u0431\u044b\u0442\u0438\u044f (\u043f\u043e ML-\u0444\u043b\u0430\u0433\u0443) \u0438\u043c\u0435\u044e\u0442 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u0438\u0439 polling rate;<\/p>\n<\/li>\n<li>\n<p>\u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f \u0438 \u0441\u0442\u0440\u0438\u043c\u044f\u0442\u0441\u044f \u0432 Kafka \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u0438 \u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430.<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<h4>ML \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435: \u043e\u0442 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0434\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u0430<\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0442\u044f\u043d\u0443\u0442\u044c 1000+ \u043c\u0430\u0442\u0447\u0435\u0439 \u0438 \u043d\u0435 \u0437\u0430\u0431\u0438\u0432\u0430\u0442\u044c \u043b\u0438\u043c\u0438\u0442, \u044f \u0432\u043d\u0435\u0434\u0440\u0438\u043b \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 ML-\u0444\u0438\u043b\u044c\u0442\u0440.<\/p>\n<p> \u041e\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u043a\u0430\u043a\u0438\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b (\u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u043b\u0438\u043d\u0438\u0438 \u0432 \u043f\u0435\u0440\u0432\u044b\u0435 3\u20135 \u043c\u0438\u043d\u0443\u0442 \u0438 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432).<\/p>\n<p><strong>\u041c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044f:<\/strong><\/p>\n<ul>\n<li>\n<p>pipeline \u043d\u0430 Scikit-Learn \/ LightGBM;<\/p>\n<\/li>\n<li>\n<p>\u0444\u0438\u0447\u0438: <code>delta_coef<\/code>, <code>volatility_window<\/code>, <code>source_count<\/code>, <code>market_spread<\/code>, <code>momentum_score<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u043c\u0435\u0442\u043a\u0430 \u2014 <code>is_significant_move<\/code> (\u0431\u0438\u043d\u0430\u0440\u043d\u0430\u044f, \u0440\u0430\u0437\u043c\u0435\u0447\u0435\u043d\u043e \u043f\u043e \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u043c);<\/p>\n<\/li>\n<li>\n<p>\u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441 \u2014 \u0432 \u043e\u043d\u043b\u0430\u0439\u043d\u0435, \u043a\u0430\u0436\u0434\u044b\u0435 5 \u043c\u0438\u043d\u0443\u0442 \u043f\u0435\u0440\u0435\u0441\u0447\u0451\u0442 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 event\u2019\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u0424\u0438\u043b\u044c\u0442\u0440 \u0441\u043d\u0438\u0437\u0438\u043b \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0442\u0440\u0435\u043a\u0435\u0440\u043e\u0432 \u043d\u0430 ~60% \u0431\u0435\u0437 \u043f\u043e\u0442\u0435\u0440\u0438 \u0446\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432.<\/p>\n<hr\/>\n<h4>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/h4>\n<pre><code>[PickingOdds API]         |     [Fetcher Pool]         |   [Async Orchestrator]         | +-------+--------+ |                | Redis (raw)    Kafka (events) |                | TimescaleDB     ML worker pool |                |  Grafana         Alert Engine <\/code><\/pre>\n<hr\/>\n<h4>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0442\u0435\u043a<\/h4>\n<ul>\n<li>\n<p><strong>Python 3.11<\/strong>, <strong>Trio<\/strong>, <strong>aiohttp<\/strong>, <strong>Pydantic v2<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>Redis<\/strong> (\u0441\u0436\u0430\u0442\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 LZ4)<\/p>\n<\/li>\n<li>\n<p><strong>Kafka + Faust<\/strong> \u0434\u043b\u044f \u0441\u0442\u0440\u0438\u043c-\u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u043e\u0432<\/p>\n<\/li>\n<li>\n<p><strong>TimescaleDB<\/strong> \u0434\u043b\u044f \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043e\u0432 \u0438 \u0440\u0435\u0442\u0440\u043e\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430<\/p>\n<\/li>\n<li>\n<p><strong>Prometheus + Grafana<\/strong> \u0434\u043b\u044f realtime \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430<\/p>\n<\/li>\n<li>\n<p><strong>ML inference<\/strong> \u043d\u0430 <strong>FastAPI<\/strong> \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c inference layer<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<h4>\u0412\u044b\u0432\u043e\u0434\u044b<\/h4>\n<p>\u041e\u0436\u0438\u0434\u0430\u043b \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e, \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0432\u044b\u0441\u043e\u043a\u043e\u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043d\u044b\u043c \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u043e\u043c, ML-\u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0435\u0439 \u0438 rate-aware \u043e\u0440\u043a\u0435\u0441\u0442\u0440\u0430\u0446\u0438\u0435\u0439.<\/p>\n<p><strong>TL;DR<\/strong>:<\/p>\n<ul>\n<li>\n<p>REST API \u2014 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u00ab\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u00bb, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0431\u0435\u0437 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 \u0438 \u043f\u0440\u0438 \u0430\u0433\u0440\u0435\u0441\u0441\u0438\u0432\u043d\u044b\u0445 \u043b\u0438\u043c\u0438\u0442\u0430\u0445.<\/p>\n<\/li>\n<li>\n<p>\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c, \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 ML-\u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u0441\u043f\u0430\u0441\u0430\u044e\u0442 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043e\u0442 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>Pickingodds \u2014 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a, \u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0439 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0431\u044b\u043b \u043e\u043f\u044b\u0442 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u043f\u043e\u0440\u0442\u0438\u0432\u043d\u044b\u0445 \u0444\u0438\u0434\u043e\u0432 \u2014 \u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445. \u0421\u0440\u0430\u0432\u043d\u0438\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u044b.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/930360\/\"> https:\/\/habr.com\/ru\/articles\/930360\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-468350","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/468350","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=468350"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/468350\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=468350"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=468350"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=468350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}