-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.sql
76 lines (76 loc) · 1.98 KB
/
schema.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
DROP TABLE IF EXISTS market;
CREATE TABLE market (
id SERIAL PRIMARY KEY,
title VARCHAR NOT NULL,
platform VARCHAR NOT NULL,
platform_id VARCHAR NOT NULL,
url VARCHAR NOT NULL,
open_dt TIMESTAMPTZ NOT NULL,
close_dt TIMESTAMPTZ NOT NULL,
open_days REAL NOT NULL,
volume_usd REAL NOT NULL,
num_traders INTEGER NOT NULL,
category VARCHAR DEFAULT 'None' NOT NULL,
prob_at_midpoint REAL NOT NULL,
prob_at_close REAL NOT NULL,
prob_each_pct REAL [] NOT NULL,
prob_each_date JSONB NOT NULL,
prob_time_avg REAL NOT NULL,
resolution REAL NOT NULL,
CONSTRAINT platform_unique_by_id UNIQUE (platform, platform_id)
);
DROP TABLE IF EXISTS platform;
CREATE TABLE platform (
name VARCHAR PRIMARY KEY,
name_fmt VARCHAR NOT NULL,
description VARCHAR NOT NULL,
site_url VARCHAR NOT NULL,
avatar_url VARCHAR NOT NULL,
color VARCHAR NOT NULL,
color_accent VARCHAR NOT NULL
);
INSERT INTO platform (
name,
name_fmt,
description,
site_url,
avatar_url,
color,
color_accent
)
VALUES (
'manifold',
'Manifold',
'A play-money platform where anyone can make any market.',
'https://manifold.markets/',
'images/manifold.svg',
'#4337c9',
'#211b64'
),
(
'kalshi',
'Kalshi',
'A US-regulated exchange with limited real-money contracts.',
'https://kalshi.com/',
'images/kalshi.png',
'#00d298',
'#00694c'
),
(
'metaculus',
'Metaculus',
'A forecasting platform focused on calibration instead of bets.',
'https://www.metaculus.com/home/',
'images/metaculus.png',
'#283441',
'#141a20'
),
(
'polymarket',
'Polymarket',
'A high-volume cryptocurrency exchange backed by USDC.',
'https://polymarket.com/',
'images/polymarket.png',
'#0072f9',
'#00397c'
);