opentradex 0.1.3 → 0.1.4
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.
- package/.env.example +8 -0
- package/README.md +3 -1
- package/gossip/__pycache__/polymarket.cpython-314.pyc +0 -0
- package/main.py +38 -7
- package/package.json +1 -1
- package/src/catalog.mjs +76 -4
- package/src/cli.mjs +44 -18
- package/src/index.mjs +433 -19
- package/web/next-env.d.ts +1 -1
- package/web/src/app/api/workspace/route.ts +12 -0
- package/web/src/app/globals.css +28 -0
- package/web/src/app/guide/page.tsx +262 -0
- package/web/src/app/layout.tsx +2 -1
- package/web/src/app/page.tsx +15 -0
- package/web/src/components/DashboardApp.tsx +192 -88
- package/web/src/components/HarnessBootPanel.tsx +160 -0
- package/web/src/components/LiveStream.tsx +632 -255
- package/web/src/components/TopBar.tsx +135 -82
- package/web/src/lib/demo-data.ts +25 -0
- package/web/src/lib/trading-guide-content.ts +337 -0
- package/web/src/lib/types.ts +30 -0
- package/web/src/lib/workspace.ts +117 -0
package/web/next-env.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="next" />
|
|
2
2
|
/// <reference types="next/image-types/global" />
|
|
3
|
-
import "./.next/types/routes.d.ts";
|
|
3
|
+
import "./.next/dev/types/routes.d.ts";
|
|
4
4
|
|
|
5
5
|
// NOTE: This file should not be edited
|
|
6
6
|
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NextResponse } from "next/server";
|
|
2
|
+
import { getDemoWorkspaceSummary } from "@/lib/demo-data";
|
|
3
|
+
import { readWorkspaceSummary } from "@/lib/workspace";
|
|
4
|
+
|
|
5
|
+
export async function GET() {
|
|
6
|
+
if (process.env.VERCEL) {
|
|
7
|
+
return NextResponse.json(getDemoWorkspaceSummary());
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const summary = readWorkspaceSummary();
|
|
11
|
+
return NextResponse.json(summary || getDemoWorkspaceSummary());
|
|
12
|
+
}
|
package/web/src/app/globals.css
CHANGED
|
@@ -228,3 +228,31 @@
|
|
|
228
228
|
border-radius: 2rem;
|
|
229
229
|
box-shadow: 0 20px 80px rgba(15, 23, 42, 0.06);
|
|
230
230
|
}
|
|
231
|
+
|
|
232
|
+
.dashboard-shell {
|
|
233
|
+
background-image:
|
|
234
|
+
radial-gradient(circle at top left, rgba(20, 184, 166, 0.08), transparent 20%),
|
|
235
|
+
radial-gradient(circle at 80% 0%, rgba(249, 115, 22, 0.07), transparent 18%),
|
|
236
|
+
linear-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 1px),
|
|
237
|
+
linear-gradient(90deg, rgba(15, 23, 42, 0.04) 1px, transparent 1px);
|
|
238
|
+
background-size: auto, auto, 26px 26px, 26px 26px;
|
|
239
|
+
background-position: center;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.harness-boot {
|
|
243
|
+
position: relative;
|
|
244
|
+
overflow: hidden;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.harness-boot::before {
|
|
248
|
+
content: "";
|
|
249
|
+
position: absolute;
|
|
250
|
+
inset: 0;
|
|
251
|
+
pointer-events: none;
|
|
252
|
+
background:
|
|
253
|
+
radial-gradient(circle at top right, rgba(34, 197, 94, 0.12), transparent 24%),
|
|
254
|
+
linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
|
|
255
|
+
linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
|
|
256
|
+
background-size: auto, 22px 22px, 22px 22px;
|
|
257
|
+
opacity: 0.8;
|
|
258
|
+
}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import type { Metadata } from "next";
|
|
2
|
+
import Link from "next/link";
|
|
3
|
+
import {
|
|
4
|
+
guideBenchmarks,
|
|
5
|
+
guideInstallCommands,
|
|
6
|
+
guidePrinciples,
|
|
7
|
+
guideResearchNotes,
|
|
8
|
+
guideSteps,
|
|
9
|
+
type GuideCodeSample,
|
|
10
|
+
} from "@/lib/trading-guide-content";
|
|
11
|
+
|
|
12
|
+
export const metadata: Metadata = {
|
|
13
|
+
title: "Financial Freedom in 6 Steps | OpenTradex",
|
|
14
|
+
description:
|
|
15
|
+
"A six-step OpenTradex guide for building a trading LLM workflow: prompting, backtesting, fine-tuning, RAG, multi-agent debate, and production controls.",
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default function GuidePage() {
|
|
19
|
+
return (
|
|
20
|
+
<main className="relative overflow-hidden">
|
|
21
|
+
<div className="pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_top_left,_rgba(20,184,166,0.18),_transparent_34%),radial-gradient(circle_at_80%_8%,_rgba(249,115,22,0.16),_transparent_26%),linear-gradient(180deg,_rgba(255,255,255,0.35),_transparent_22%)]" />
|
|
22
|
+
<div className="pointer-events-none absolute inset-x-0 top-0 h-[560px] chart-grid-bg opacity-60" />
|
|
23
|
+
|
|
24
|
+
<section className="relative mx-auto max-w-7xl px-5 pb-14 pt-6 sm:px-8 lg:px-12">
|
|
25
|
+
<header className="mb-10 flex flex-wrap items-center justify-between gap-4 rounded-full border border-border/70 bg-white/82 px-4 py-3 shadow-[0_18px_80px_rgba(16,24,40,0.06)] backdrop-blur">
|
|
26
|
+
<Link href="/" className="flex items-center gap-3">
|
|
27
|
+
<div className="flex h-11 w-11 items-center justify-center rounded-full bg-[linear-gradient(135deg,#0f766e,#14b8a6_55%,#f97316)] font-mono text-xs font-semibold uppercase tracking-[0.25em] text-white">
|
|
28
|
+
OTX
|
|
29
|
+
</div>
|
|
30
|
+
<div>
|
|
31
|
+
<p className="text-[0.7rem] uppercase tracking-[0.32em] text-muted-foreground">
|
|
32
|
+
OpenTradex Guide
|
|
33
|
+
</p>
|
|
34
|
+
<h1 className="text-lg font-semibold tracking-tight text-foreground">
|
|
35
|
+
Financial Freedom in 6 Steps
|
|
36
|
+
</h1>
|
|
37
|
+
</div>
|
|
38
|
+
</Link>
|
|
39
|
+
|
|
40
|
+
<nav className="flex flex-wrap items-center gap-3 text-sm text-muted-foreground">
|
|
41
|
+
<Link href="/" className="rounded-full px-3 py-2 transition-colors hover:bg-secondary hover:text-foreground">
|
|
42
|
+
Home
|
|
43
|
+
</Link>
|
|
44
|
+
<Link href="/dashboard" className="rounded-full px-3 py-2 transition-colors hover:bg-secondary hover:text-foreground">
|
|
45
|
+
Dashboard
|
|
46
|
+
</Link>
|
|
47
|
+
<a
|
|
48
|
+
href="#steps"
|
|
49
|
+
className="rounded-full px-3 py-2 transition-colors hover:bg-secondary hover:text-foreground"
|
|
50
|
+
>
|
|
51
|
+
Six Steps
|
|
52
|
+
</a>
|
|
53
|
+
</nav>
|
|
54
|
+
</header>
|
|
55
|
+
|
|
56
|
+
<div className="grid gap-8 lg:grid-cols-[minmax(0,1.08fr)_minmax(360px,0.92fr)] lg:items-start">
|
|
57
|
+
<div className="max-w-4xl">
|
|
58
|
+
<div className="mb-5 inline-flex items-center gap-2 rounded-full border border-primary/20 bg-primary/8 px-3 py-1 font-mono text-[0.7rem] uppercase tracking-[0.28em] text-primary">
|
|
59
|
+
How to build an LLM for trading
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<h2 className="max-w-5xl text-5xl font-semibold leading-[0.94] tracking-[-0.05em] text-foreground sm:text-6xl lg:text-7xl">
|
|
63
|
+
Financial Freedom in 6 Steps.
|
|
64
|
+
</h2>
|
|
65
|
+
|
|
66
|
+
<p className="mt-6 max-w-3xl text-lg leading-8 text-muted-foreground sm:text-xl">
|
|
67
|
+
Hedge funds spend real money assembling the same building blocks this guide walks
|
|
68
|
+
through: prompting, validation, domain adaptation, retrieval, debate, monitoring,
|
|
69
|
+
and risk controls. The goal here is not fantasy returns. The goal is to help you
|
|
70
|
+
build a serious trading-LLM workflow from first signal to production guardrails.
|
|
71
|
+
</p>
|
|
72
|
+
|
|
73
|
+
<div className="mt-8 flex flex-wrap gap-3">
|
|
74
|
+
<Link
|
|
75
|
+
href="#steps"
|
|
76
|
+
className="inline-flex items-center justify-center rounded-full bg-foreground px-6 py-3 text-sm font-semibold text-background transition-transform hover:-translate-y-0.5"
|
|
77
|
+
>
|
|
78
|
+
Read the six levels
|
|
79
|
+
</Link>
|
|
80
|
+
<Link
|
|
81
|
+
href="/dashboard"
|
|
82
|
+
className="inline-flex items-center justify-center rounded-full border border-border bg-white/80 px-6 py-3 text-sm font-semibold text-foreground transition-transform hover:-translate-y-0.5"
|
|
83
|
+
>
|
|
84
|
+
Open dashboard
|
|
85
|
+
</Link>
|
|
86
|
+
<Link
|
|
87
|
+
href="/"
|
|
88
|
+
className="inline-flex items-center justify-center rounded-full border border-border bg-white/80 px-6 py-3 text-sm font-semibold text-foreground transition-transform hover:-translate-y-0.5"
|
|
89
|
+
>
|
|
90
|
+
Back to homepage
|
|
91
|
+
</Link>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
<aside className="section-frame p-6">
|
|
96
|
+
<p className="font-mono text-[0.72rem] uppercase tracking-[0.28em] text-primary">
|
|
97
|
+
Before you trust any chart
|
|
98
|
+
</p>
|
|
99
|
+
<ul className="mt-4 space-y-3 text-sm leading-6 text-muted-foreground">
|
|
100
|
+
{guideResearchNotes.map((note) => (
|
|
101
|
+
<li key={note} className="flex items-start gap-3">
|
|
102
|
+
<span className="mt-1 inline-block h-2.5 w-2.5 rounded-full bg-amber-500" />
|
|
103
|
+
<span>{note}</span>
|
|
104
|
+
</li>
|
|
105
|
+
))}
|
|
106
|
+
</ul>
|
|
107
|
+
</aside>
|
|
108
|
+
</div>
|
|
109
|
+
</section>
|
|
110
|
+
|
|
111
|
+
<section className="relative mx-auto max-w-7xl px-5 pb-18 sm:px-8 lg:px-12">
|
|
112
|
+
<div className="grid gap-4 md:grid-cols-2 xl:grid-cols-4">
|
|
113
|
+
{guideBenchmarks.map((item) => (
|
|
114
|
+
<article key={item.label} className="section-frame p-5">
|
|
115
|
+
<p className="font-mono text-[0.68rem] uppercase tracking-[0.28em] text-muted-foreground">
|
|
116
|
+
{item.label}
|
|
117
|
+
</p>
|
|
118
|
+
<p className="mt-3 text-3xl font-semibold tracking-tight text-foreground">{item.value}</p>
|
|
119
|
+
<p className="mt-3 text-sm leading-6 text-muted-foreground">{item.note}</p>
|
|
120
|
+
</article>
|
|
121
|
+
))}
|
|
122
|
+
</div>
|
|
123
|
+
</section>
|
|
124
|
+
|
|
125
|
+
<section className="relative border-y border-border/70 bg-white/65 py-4 backdrop-blur">
|
|
126
|
+
<div className="ticker-shell">
|
|
127
|
+
<div className="ticker-track">
|
|
128
|
+
{[...guidePrinciples, ...guidePrinciples].map((item, index) => (
|
|
129
|
+
<span key={`${item}-${index}`} className="ticker-chip">
|
|
130
|
+
{item}
|
|
131
|
+
</span>
|
|
132
|
+
))}
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</section>
|
|
136
|
+
|
|
137
|
+
<section id="steps" className="relative mx-auto max-w-7xl px-5 py-24 sm:px-8 lg:px-12">
|
|
138
|
+
<div className="mb-12 max-w-3xl">
|
|
139
|
+
<p className="font-mono text-[0.75rem] uppercase tracking-[0.32em] text-primary">
|
|
140
|
+
Six build levels
|
|
141
|
+
</p>
|
|
142
|
+
<h3 className="mt-3 text-4xl font-semibold tracking-[-0.04em] text-foreground sm:text-5xl">
|
|
143
|
+
Each step should deliver a working result.
|
|
144
|
+
</h3>
|
|
145
|
+
<p className="mt-4 text-lg leading-8 text-muted-foreground">
|
|
146
|
+
The red-line version is a raw LLM with no optimization. The stronger system adds data
|
|
147
|
+
hygiene, task adaptation, retrieval, debate, and production controls one layer at a
|
|
148
|
+
time.
|
|
149
|
+
</p>
|
|
150
|
+
</div>
|
|
151
|
+
|
|
152
|
+
<div className="space-y-8">
|
|
153
|
+
{guideSteps.map((step) => (
|
|
154
|
+
<article key={step.level} className="section-frame overflow-hidden p-6 sm:p-8">
|
|
155
|
+
<div className="grid gap-8 lg:grid-cols-[minmax(0,0.9fr)_minmax(0,1.1fr)]">
|
|
156
|
+
<div>
|
|
157
|
+
<p className="font-mono text-[0.76rem] uppercase tracking-[0.28em] text-primary">
|
|
158
|
+
{step.level}
|
|
159
|
+
</p>
|
|
160
|
+
<h4 className="mt-4 text-3xl font-semibold tracking-tight text-foreground">
|
|
161
|
+
{step.title}
|
|
162
|
+
</h4>
|
|
163
|
+
<p className="mt-4 text-base leading-7 text-muted-foreground">{step.summary}</p>
|
|
164
|
+
|
|
165
|
+
<div className="mt-6 rounded-[1.6rem] border border-primary/15 bg-primary/6 p-5">
|
|
166
|
+
<p className="font-mono text-[0.68rem] uppercase tracking-[0.26em] text-primary">
|
|
167
|
+
Working result
|
|
168
|
+
</p>
|
|
169
|
+
<p className="mt-3 text-sm leading-6 text-foreground">{step.outcome}</p>
|
|
170
|
+
</div>
|
|
171
|
+
|
|
172
|
+
<ul className="mt-6 space-y-3 text-sm leading-6 text-muted-foreground">
|
|
173
|
+
{step.highlights.map((highlight) => (
|
|
174
|
+
<li key={highlight} className="flex items-start gap-3">
|
|
175
|
+
<span className="mt-1 inline-block h-2.5 w-2.5 rounded-full bg-primary" />
|
|
176
|
+
<span>{highlight}</span>
|
|
177
|
+
</li>
|
|
178
|
+
))}
|
|
179
|
+
</ul>
|
|
180
|
+
</div>
|
|
181
|
+
|
|
182
|
+
<div className="space-y-4">
|
|
183
|
+
{step.codeSamples.map((sample) => (
|
|
184
|
+
<CodePanel key={`${step.level}-${sample.label}`} sample={sample} />
|
|
185
|
+
))}
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
188
|
+
</article>
|
|
189
|
+
))}
|
|
190
|
+
</div>
|
|
191
|
+
</section>
|
|
192
|
+
|
|
193
|
+
<section className="relative mx-auto max-w-7xl px-5 pb-24 sm:px-8 lg:px-12">
|
|
194
|
+
<div className="grid gap-5 lg:grid-cols-[minmax(0,0.82fr)_minmax(0,1.18fr)]">
|
|
195
|
+
<div className="section-frame p-6">
|
|
196
|
+
<p className="font-mono text-[0.75rem] uppercase tracking-[0.3em] text-primary">
|
|
197
|
+
What stays honest
|
|
198
|
+
</p>
|
|
199
|
+
<h3 className="mt-3 text-3xl font-semibold tracking-[-0.04em] text-foreground">
|
|
200
|
+
This is a build guide, not a promise.
|
|
201
|
+
</h3>
|
|
202
|
+
<p className="mt-4 text-base leading-7 text-muted-foreground">
|
|
203
|
+
The strongest systems still fail when data leaks, costs are ignored, or models drift
|
|
204
|
+
into a new market regime. Good architecture helps. Good evaluation and hard risk
|
|
205
|
+
boundaries matter more.
|
|
206
|
+
</p>
|
|
207
|
+
</div>
|
|
208
|
+
|
|
209
|
+
<div className="section-frame p-6">
|
|
210
|
+
<p className="font-mono text-[0.75rem] uppercase tracking-[0.3em] text-primary">
|
|
211
|
+
Start building
|
|
212
|
+
</p>
|
|
213
|
+
<div className="mt-5 grid gap-4 md:grid-cols-2">
|
|
214
|
+
{guideInstallCommands.map((item) => (
|
|
215
|
+
<div key={item.label} className="rounded-[1.5rem] border border-border/80 bg-white/80 p-4">
|
|
216
|
+
<p className="font-mono text-[0.66rem] uppercase tracking-[0.26em] text-muted-foreground">
|
|
217
|
+
{item.label}
|
|
218
|
+
</p>
|
|
219
|
+
<pre className="mt-3 overflow-x-auto whitespace-pre-wrap rounded-[1.2rem] bg-slate-950 px-4 py-3 font-mono text-[0.78rem] leading-6 text-slate-100">
|
|
220
|
+
<code>{item.command}</code>
|
|
221
|
+
</pre>
|
|
222
|
+
</div>
|
|
223
|
+
))}
|
|
224
|
+
</div>
|
|
225
|
+
<div className="mt-6 flex flex-wrap gap-3">
|
|
226
|
+
<Link
|
|
227
|
+
href="/"
|
|
228
|
+
className="inline-flex items-center justify-center rounded-full bg-foreground px-5 py-3 text-sm font-semibold text-background transition-transform hover:-translate-y-0.5"
|
|
229
|
+
>
|
|
230
|
+
Open onboarding
|
|
231
|
+
</Link>
|
|
232
|
+
<Link
|
|
233
|
+
href="/dashboard"
|
|
234
|
+
className="inline-flex items-center justify-center rounded-full border border-border bg-white/80 px-5 py-3 text-sm font-semibold text-foreground transition-transform hover:-translate-y-0.5"
|
|
235
|
+
>
|
|
236
|
+
Watch the dashboard
|
|
237
|
+
</Link>
|
|
238
|
+
</div>
|
|
239
|
+
</div>
|
|
240
|
+
</div>
|
|
241
|
+
</section>
|
|
242
|
+
</main>
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function CodePanel({ sample }: { sample: GuideCodeSample }) {
|
|
247
|
+
return (
|
|
248
|
+
<div className="rounded-[1.8rem] border border-slate-200/80 bg-slate-950 text-slate-100 shadow-[0_22px_80px_rgba(15,23,42,0.18)]">
|
|
249
|
+
<div className="flex items-center justify-between border-b border-white/10 px-4 py-3">
|
|
250
|
+
<p className="font-mono text-[0.68rem] uppercase tracking-[0.26em] text-slate-300">
|
|
251
|
+
{sample.label}
|
|
252
|
+
</p>
|
|
253
|
+
<span className="rounded-full border border-white/10 px-3 py-1 font-mono text-[0.66rem] uppercase tracking-[0.24em] text-slate-400">
|
|
254
|
+
{sample.language}
|
|
255
|
+
</span>
|
|
256
|
+
</div>
|
|
257
|
+
<pre className="overflow-x-auto px-4 py-4 font-mono text-[0.78rem] leading-6 text-slate-100">
|
|
258
|
+
<code>{sample.code}</code>
|
|
259
|
+
</pre>
|
|
260
|
+
</div>
|
|
261
|
+
);
|
|
262
|
+
}
|
package/web/src/app/layout.tsx
CHANGED
|
@@ -16,7 +16,8 @@ const plexMono = IBM_Plex_Mono({
|
|
|
16
16
|
|
|
17
17
|
export const metadata: Metadata = {
|
|
18
18
|
title: "OpenTradex",
|
|
19
|
-
description:
|
|
19
|
+
description:
|
|
20
|
+
"Our implementation. Your strategy. Open-source onboarding, market rails, and a six-step guide for building AI-assisted trading systems.",
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
export default function RootLayout({
|
package/web/src/app/page.tsx
CHANGED
|
@@ -122,6 +122,11 @@ const liveLinks = [
|
|
|
122
122
|
href: LIVE_BASE_URL,
|
|
123
123
|
value: LIVE_BASE_URL,
|
|
124
124
|
},
|
|
125
|
+
{
|
|
126
|
+
label: "Guide",
|
|
127
|
+
href: `${LIVE_BASE_URL}/guide`,
|
|
128
|
+
value: `${LIVE_BASE_URL}/guide`,
|
|
129
|
+
},
|
|
125
130
|
{
|
|
126
131
|
label: "Dashboard",
|
|
127
132
|
href: `${LIVE_BASE_URL}/dashboard`,
|
|
@@ -154,6 +159,7 @@ const setupCommands = [
|
|
|
154
159
|
|
|
155
160
|
const curlChecks = [
|
|
156
161
|
"curl.exe -I https://opentradex.vercel.app/",
|
|
162
|
+
"curl.exe -I https://opentradex.vercel.app/guide",
|
|
157
163
|
"curl.exe -I https://opentradex.vercel.app/dashboard",
|
|
158
164
|
"curl.exe -I https://opentradex.vercel.app/install.sh",
|
|
159
165
|
"curl.exe https://opentradex.vercel.app/api/news/live",
|
|
@@ -188,6 +194,9 @@ export default function HomePage() {
|
|
|
188
194
|
<a href="#onboard" className="transition-colors hover:text-foreground">
|
|
189
195
|
Onboard
|
|
190
196
|
</a>
|
|
197
|
+
<Link href="/guide" className="transition-colors hover:text-foreground">
|
|
198
|
+
Guide
|
|
199
|
+
</Link>
|
|
191
200
|
<a href="#launch" className="transition-colors hover:text-foreground">
|
|
192
201
|
Launch
|
|
193
202
|
</a>
|
|
@@ -230,6 +239,12 @@ export default function HomePage() {
|
|
|
230
239
|
>
|
|
231
240
|
Start onboarding
|
|
232
241
|
</a>
|
|
242
|
+
<Link
|
|
243
|
+
href="/guide"
|
|
244
|
+
className="inline-flex items-center justify-center rounded-full border border-border bg-white/80 px-6 py-3 text-sm font-semibold text-foreground transition-transform hover:-translate-y-0.5"
|
|
245
|
+
>
|
|
246
|
+
Read the 6-step guide
|
|
247
|
+
</Link>
|
|
233
248
|
<Link
|
|
234
249
|
href="/dashboard"
|
|
235
250
|
className="inline-flex items-center justify-center rounded-full border border-border bg-white/80 px-6 py-3 text-sm font-semibold text-foreground transition-transform hover:-translate-y-0.5"
|