tangled
alpha
login
or
join now
ciaran.co.za
/
cumulus
0
fork
atom
A Prediction Market on the AT Protocol
0
fork
atom
overview
issues
pulls
pipelines
chore(package.json): cleanup
Ciaran
1 week ago
780d030c
17a72e11
+1
-125
3 changed files
expand all
collapse all
unified
split
example.log
package.json
t
-66
example.log
···
1
-
create {
2
-
rev: "3mg6czrjigj27",
3
-
operation: "create",
4
-
collection: "za.co.ciaran.cumulus.market",
5
-
rkey: "3mg6czrivur27",
6
-
record: {
7
-
$type: "za.co.ciaran.cumulus.market",
8
-
closesAt: "2026-05-03T17:43:56.706Z",
9
-
createdAt: "2026-03-03T17:43:56.709Z",
10
-
liquidity: 50,
11
-
question: "What will I do?",
12
-
},
13
-
cid: "bafyreihvnkc4k4x6gc2qh2paoxcig66f77kydncwqzxlqvz4gwzu6wunyu",
14
-
}
15
-
create {
16
-
rev: "3mg6czrtnxz24",
17
-
operation: "create",
18
-
collection: "za.co.ciaran.cumulus.bet",
19
-
rkey: "3mg6czrt5er24",
20
-
record: {
21
-
$type: "za.co.ciaran.cumulus.bet",
22
-
createdAt: "2026-03-03T17:43:57.522Z",
23
-
market: {
24
-
$type: "com.atproto.repo.strongRef",
25
-
cid: "bafyreihvnkc4k4x6gc2qh2paoxcig66f77kydncwqzxlqvz4gwzu6wunyu",
26
-
uri: "at://did:plc:ssntylce6aeeazwb64ol6nsj/za.co.ciaran.cumulus.market/3mg6czrivur27",
27
-
},
28
-
position: "yes",
29
-
},
30
-
cid: "bafyreib5koypyneafy5kke2qmlwvvtg5pfqmptqvha4exdbiettppkchzi",
31
-
}
32
-
create {
33
-
rev: "3mg6czs52sy2k",
34
-
operation: "create",
35
-
collection: "za.co.ciaran.cumulus.resolution",
36
-
rkey: "3mg6czs4o4q2k",
37
-
record: {
38
-
$type: "za.co.ciaran.cumulus.resolution",
39
-
answer: "yes",
40
-
createdAt: "2026-03-03T17:43:57.837Z",
41
-
market: {
42
-
$type: "com.atproto.repo.strongRef",
43
-
cid: "bafyreihvnkc4k4x6gc2qh2paoxcig66f77kydncwqzxlqvz4gwzu6wunyu",
44
-
uri: "at://did:plc:ssntylce6aeeazwb64ol6nsj/za.co.ciaran.cumulus.market/3mg6czrivur27",
45
-
},
46
-
},
47
-
cid: "bafyreigqjpvuogpowigrvknes5hpqtjrhjo46o2cl4uxdh4yirywiqvnt4",
48
-
}
49
-
delete {
50
-
rev: "3mg6d3vpiby2c",
51
-
operation: "delete",
52
-
collection: "za.co.ciaran.cumulus.bet",
53
-
rkey: "3mg6czrt5er24",
54
-
}
55
-
delete {
56
-
rev: "3mg6d3za6dy2z",
57
-
operation: "delete",
58
-
collection: "za.co.ciaran.cumulus.market",
59
-
rkey: "3mg6czrivur27",
60
-
}
61
-
delete {
62
-
rev: "3mg6d446p7o2r",
63
-
operation: "delete",
64
-
collection: "za.co.ciaran.cumulus.resolution",
65
-
rkey: "3mg6czs4o4q2k",
66
-
}
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
+1
-3
package.json
···
5
"lex:generate": "bun lex-cli export && bun lex-cli generate",
6
"lex:lint": "goat lex lint generated && goat lex check-dns generated",
7
"lex:publish": "goat lex publish generated",
8
-
"db:push": "bunx drizzle-kit push",
9
"db:generate": "bunx drizzle-kit generate",
10
"db:migrate": "bunx drizzle-kit migrate",
0
11
"jetstream:dev": "bun --watch src/jetstream/index.ts",
12
"jetstream:build": "bun build src/jetstream/index.ts --compile --outfile build/jetstream",
13
"web:dev": "vite",
14
"web:build": "vite build",
15
-
"web:preview": "vite preview",
16
"server:dev": "bun --watch src/server/index.ts",
17
"server:build": "bun build src/server/index.ts --compile --outfile build/server",
18
-
"docker:build": "sudo -E docker build --pull -t cumulus .",
19
"build": "bun jetstream:build && bun web:build && bun server:build",
20
"build:dev": "bun jetstream:build && LOCAL=1 bun web:build && bun server:build",
21
"test": "bun vitest"
···
5
"lex:generate": "bun lex-cli export && bun lex-cli generate",
6
"lex:lint": "goat lex lint generated && goat lex check-dns generated",
7
"lex:publish": "goat lex publish generated",
0
8
"db:generate": "bunx drizzle-kit generate",
9
"db:migrate": "bunx drizzle-kit migrate",
10
+
"db:push": "bunx drizzle-kit push",
11
"jetstream:dev": "bun --watch src/jetstream/index.ts",
12
"jetstream:build": "bun build src/jetstream/index.ts --compile --outfile build/jetstream",
13
"web:dev": "vite",
14
"web:build": "vite build",
0
15
"server:dev": "bun --watch src/server/index.ts",
16
"server:build": "bun build src/server/index.ts --compile --outfile build/server",
0
17
"build": "bun jetstream:build && bun web:build && bun server:build",
18
"build:dev": "bun jetstream:build && LOCAL=1 bun web:build && bun server:build",
19
"test": "bun vitest"
-56
t
···
1
-
[1mdiff --git a/src/server/index.ts b/src/server/index.ts[m
2
-
[1mindex b100294..8595011 100644[m
3
-
[1m--- a/src/server/index.ts[m
4
-
[1m+++ b/src/server/index.ts[m
5
-
[36m@@ -14,9 +14,10 @@[m [mexport const app = new Elysia()[m
6
-
.use(staticPlugin({ prefix: "/", assets: "dist" }))[m
7
-
.get("/", () => new Response(Bun.file("dist/index.html")))[m
8
-
.group("/api", (app) => ([m
9
-
[31m- app.get("/markets", async ({ params }) =>[m
10
-
[32m+[m[32m app.get("/markets", async () =>[m
11
-
Response.json(await db.query.marketsTable.findMany({[m
12
-
[31m- with: { bets: true, resolution: true }[m
13
-
[32m+[m[32m with: { bets: true, resolution: true },[m
14
-
[32m+[m[32m orderBy: (markets, { desc }) => [desc(markets.createdAt)],[m
15
-
}))[m
16
-
).group("/market", (app) => ([m
17
-
app.get("/:uri", async ({ params: { uri } }) =>[m
18
-
[1mdiff --git a/src/web/app.tsx b/src/web/app.tsx[m
19
-
[1mindex 1fdd125..ff39ead 100644[m
20
-
[1m--- a/src/web/app.tsx[m
21
-
[1m+++ b/src/web/app.tsx[m
22
-
[36m@@ -25,30 +25,22 @@[m [mexport default function App() {[m
23
-
yes,[m
24
-
no,[m
25
-
yesPrice: yesPrice(yes, no, market.liquidity),[m
26
-
[31m- testNoPrice: 1-yesPrice(yes,no,market.liquidity),[m
27
-
noPrice: noPrice(yes, no, market.liquidity),[m
28
-
}[m
29
-
})[m
30
-
[m
31
-
[31m-[m
32
-
[31m- return <div key={market.cid}>[m
33
-
[31m- <h2>{market.question}</h2>[m
34
-
[31m- <p>Closes {formatDistance(new Date(market.closesAt), new Date(), { addSuffix: true })}</p>[m
35
-
[31m- <p>{market.bets?.length} Positions</p>[m
36
-
[32m+[m[32m return <div key={market.cid} className="space-y-2">[m
37
-
[32m+[m[32m <h2 className="text-3xl font-medium">{market.question}</h2>[m
38
-
[32m+[m[32m <p className="uppercase text-sm font-bold">Closes {formatDistance(new Date(market.closesAt), new Date(), { addSuffix: true })} | {market.bets?.length} Positions</p>[m
39
-
<ChartContainer[m
40
-
[31m- className="border-2 rounded-lg"[m
41
-
config={{[m
42
-
yes: { label: "Yes" }, no: { label: "No" }[m
43
-
}}>[m
44
-
<LineChart data={mappedBets}>[m
45
-
[31m- <CartesianGrid strokeDasharray="3 3" />[m
46
-
<ChartTooltip />[m
47
-
[31m- <XAxis dataKey="createdAt" interval={8} />[m
48
-
<Line dataKey="yes" stroke="var(--color-shell-600)" />[m
49
-
<Line dataKey="no" stroke="var(--color-coral-600)" />[m
50
-
[31m- <Line dataKey="yesPrice" stroke="var(--color-coral-600)" />[m
51
-
[31m- <Line dataKey="testNoPrice" stroke="var(--color-coral-600)" />[m
52
-
[31m- <Line dataKey="noPrice" stroke="var(--color-coral-600)" />[m
53
-
[32m+[m[32m <Line dataKey="yesPrice" />[m
54
-
</LineChart>[m
55
-
</ChartContainer>[m
56
-
</div>[m
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0