analysis-poly 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- analysis_poly/__init__.py +3 -0
- analysis_poly/analyzer.py +587 -0
- analysis_poly/cli.py +28 -0
- analysis_poly/logging_config.py +29 -0
- analysis_poly/main.py +27 -0
- analysis_poly/market_cache.py +133 -0
- analysis_poly/market_result_cache.py +52 -0
- analysis_poly/models.py +183 -0
- analysis_poly/open_with_params.py +143 -0
- analysis_poly/polymarket_client.py +141 -0
- analysis_poly/profit_engine.py +417 -0
- analysis_poly/run_manager.py +289 -0
- analysis_poly/slugs.py +31 -0
- analysis_poly/static/dist/app.css +1 -0
- analysis_poly/static/dist/app.js +485 -0
- analysis_poly/templates/index.html +17 -0
- analysis_poly/web.py +74 -0
- analysis_poly-0.1.0.dist-info/METADATA +107 -0
- analysis_poly-0.1.0.dist-info/RECORD +22 -0
- analysis_poly-0.1.0.dist-info/WHEEL +5 -0
- analysis_poly-0.1.0.dist-info/entry_points.txt +3 -0
- analysis_poly-0.1.0.dist-info/top_level.txt +1 -0
analysis_poly/slugs.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import math
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@dataclass(frozen=True)
|
|
8
|
+
class MarketSlugSpec:
|
|
9
|
+
symbol: str
|
|
10
|
+
interval: int
|
|
11
|
+
timestamp: int
|
|
12
|
+
|
|
13
|
+
@property
|
|
14
|
+
def slug(self) -> str:
|
|
15
|
+
return f"{self.symbol}-updown-{self.interval}m-{self.timestamp}"
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def generate_market_slug_specs(
|
|
19
|
+
symbols: list[str], intervals: list[int], start_ts: int, end_ts: int
|
|
20
|
+
) -> list[MarketSlugSpec]:
|
|
21
|
+
specs: list[MarketSlugSpec] = []
|
|
22
|
+
for symbol in symbols:
|
|
23
|
+
for interval in intervals:
|
|
24
|
+
step = interval * 60
|
|
25
|
+
first_ts = math.ceil(start_ts / step) * step
|
|
26
|
+
ts = first_ts
|
|
27
|
+
while ts < end_ts:
|
|
28
|
+
specs.append(MarketSlugSpec(symbol=symbol, interval=interval, timestamp=ts))
|
|
29
|
+
ts += step
|
|
30
|
+
specs.sort(key=lambda s: (s.timestamp, s.symbol, s.interval))
|
|
31
|
+
return specs
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
html,body{width:100%;height:100%}input::-ms-clear,input::-ms-reveal{display:none}*,*:before,*:after{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}@-ms-viewport{width:device-width}body{margin:0}[tabindex="-1"]:focus{outline:none}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;font-weight:500}p{margin-top:0;margin-bottom:1em}abbr[title],abbr[data-original-title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;border-bottom:0;cursor:help}address{margin-bottom:1em;font-style:normal;line-height:inherit}input[type=text],input[type=password],input[type=number],textarea{-webkit-appearance:none}ol,ul,dl{margin-top:0;margin-bottom:1em}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}pre,code,kbd,samp{font-size:1em;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace}pre{margin-top:0;margin-bottom:1em;overflow:auto}figure{margin:0 0 1em}img{vertical-align:middle;border-style:none}a,area,button,[role=button],input:not([type=range]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75em;padding-bottom:.3em;text-align:left;caption-side:bottom}input,button,select,optgroup,textarea{margin:0;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{padding:0;border-style:none}input[type=radio],input[type=checkbox]{box-sizing:border-box;padding:0}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;margin:0;padding:0;border:0}legend{display:block;width:100%;max-width:100%;margin-bottom:.5em;padding:0;color:inherit;font-size:1.5em;line-height:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{padding:.2em;background-color:#feffe6}:root{--bg: #ecf1fa;--panel: #f6f9ff;--panel-solid: #ffffff;--line: #d5deec;--text: #1e2a3e;--muted: #607089;--teal: #2ca7b4}body{margin:0;color:var(--text);font-family:Plus Jakarta Sans,Inter,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;background:radial-gradient(circle at 10% 0%,#f7f9ff,#edf2fa 45%,#e7edf8)}html,body{width:100%}#root{min-height:100vh;width:100%}.page-layout{min-height:100vh;width:100%;background:transparent}.container{width:100%;max-width:none;margin:0;padding:12px 20px 16px}.status-card{margin-bottom:10px;border-radius:20px;border:1px solid var(--line);background:var(--panel);padding:6px;box-shadow:0 8px 26px #172d4a0d}.status-card-inner{border-radius:14px;border:1px solid #efc98f;background:linear-gradient(90deg,#f8efd8,#f2efe7);padding:8px 12px}.status-left{border-right:1px solid #ddd6c8;min-height:72px;display:flex;flex-direction:column;justify-content:center}.status-right{display:flex;flex-direction:column;justify-content:center;gap:4px}.status-title{display:inline-flex;align-items:center;gap:8px;font-size:19px;line-height:1.1;font-weight:800;margin-bottom:3px}.status-title.failed{color:#8f3240}.status-title.running{color:#1f5c93}.status-title.ok{color:#157456}.status-message{font-size:13px;color:#293549;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.status-message .ant-tag{margin-inline-start:8px}.kpi-label{color:#57657c;font-size:12px}.kpi-value{margin-top:1px;color:#0f4f77;font-size:20px;line-height:1.05;font-weight:800}.kpi-divider{border-right:1px solid #d5d8de}.progress-text{text-align:right;margin-top:-2px;color:#4c5b74;font-size:13px}.config-card{margin-bottom:10px;border-radius:18px;border:1px solid var(--line);background:var(--panel-solid);box-shadow:0 8px 24px #172d4a0d;padding:10px 14px 6px}.config-form .ant-form-item{margin-bottom:6px}.config-form .ant-form-item-label>label{color:#455267;font-size:13px;height:auto}.config-form .ant-input,.config-form .ant-input-affix-wrapper{border-radius:11px;border-color:#cfd8e7;background:#f7f9fd;min-height:40px;font-size:16px}.time-row{display:flex;align-items:center;gap:10px}.time-separator{color:#8e9cb3;font-weight:700;min-width:20px;text-align:center}.action-row{display:flex;align-items:center;justify-content:flex-end;gap:8px;height:100%}.session-btn{min-width:176px;border-radius:999px;font-weight:700}.chart-card{border-radius:20px;border:1px solid var(--line);background:var(--panel-solid);margin-bottom:10px;box-shadow:0 10px 28px #172d4a0f}.chart-wrap{height:460px;border-radius:14px;border:1px solid #d8e1ef;background:linear-gradient(180deg,#f8fbff,#f2f6fc);overflow:hidden}.market-card{border-radius:18px;border:1px solid var(--line);background:var(--panel-solid);box-shadow:0 8px 22px #172d4a0d}.market-section{padding:0 12px 10px}.market-chart-wrap{height:290px;border-radius:12px;border:1px solid #d8e1ef;background:linear-gradient(180deg,#f8fbff,#f2f6fc);overflow:hidden}.quant-card{border-radius:18px;border:1px solid var(--line);background:var(--panel-solid);margin-bottom:10px;box-shadow:0 8px 22px #172d4a0d}.metric-kpi{border:1px solid #d8e1ef;border-radius:12px;padding:10px 12px 8px;background:linear-gradient(180deg,#fbfdff,#f3f7fd);min-height:78px}.metric-kpi .ant-statistic-title{color:#607089;font-size:12px}.metric-kpi .ant-statistic-content{color:#213047;font-size:22px;line-height:1.1;font-weight:700}.metric-chart-wrap{height:290px;border-radius:12px;border:1px solid #d8e1ef;background:linear-gradient(180deg,#f8fbff,#f2f6fc);overflow:hidden}.metrics-empty{padding:18px 0 10px}@media(max-width:1280px){.chart-wrap{height:420px}.metric-chart-wrap{height:270px}.market-chart-wrap{height:260px}}@media(max-width:1024px){.status-left{border-right:0;border-bottom:1px solid #ddd6c8;padding-bottom:8px;margin-bottom:6px}.action-row{justify-content:flex-start;flex-wrap:wrap}}@media(max-width:768px){.container{padding:10px}.time-row{flex-wrap:wrap;gap:8px}.time-row .ant-input{width:100%}.time-separator{width:100%;text-align:left}.chart-wrap{height:360px}.metric-chart-wrap{height:250px}}
|