This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
schema.sql
108 lines (107 loc) · 2.88 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
CREATE TABLE IF NOT EXISTS pool_burn (
"evt_tx_hash" VARCHAR(64),
"evt_index" INT,
"evt_block_time" TIMESTAMP,
"evt_block_number" DECIMAL,
"amount" DECIMAL,
"amount0" DECIMAL,
"amount1" DECIMAL,
"owner" VARCHAR(40),
"tick_lower" INT,
"tick_upper" INT,
PRIMARY KEY(evt_tx_hash,evt_index)
);
CREATE TABLE IF NOT EXISTS pool_collect (
"evt_tx_hash" VARCHAR(64),
"evt_index" INT,
"evt_block_time" TIMESTAMP,
"evt_block_number" DECIMAL,
"amount0" DECIMAL,
"amount1" DECIMAL,
"owner" VARCHAR(40),
"recipient" VARCHAR(40),
"tick_lower" INT,
"tick_upper" INT,
PRIMARY KEY(evt_tx_hash,evt_index)
);
CREATE TABLE IF NOT EXISTS pool_collect_protocol (
"evt_tx_hash" VARCHAR(64),
"evt_index" INT,
"evt_block_time" TIMESTAMP,
"evt_block_number" DECIMAL,
"amount0" DECIMAL,
"amount1" DECIMAL,
"recipient" VARCHAR(40),
"sender" VARCHAR(40),
PRIMARY KEY(evt_tx_hash,evt_index)
);
CREATE TABLE IF NOT EXISTS pool_flash (
"evt_tx_hash" VARCHAR(64),
"evt_index" INT,
"evt_block_time" TIMESTAMP,
"evt_block_number" DECIMAL,
"amount0" DECIMAL,
"amount1" DECIMAL,
"paid0" DECIMAL,
"paid1" DECIMAL,
"recipient" VARCHAR(40),
"sender" VARCHAR(40),
PRIMARY KEY(evt_tx_hash,evt_index)
);
CREATE TABLE IF NOT EXISTS pool_increase_observation_cardinality_next (
"evt_tx_hash" VARCHAR(64),
"evt_index" INT,
"evt_block_time" TIMESTAMP,
"evt_block_number" DECIMAL,
"observation_cardinality_next_new" INT,
"observation_cardinality_next_old" INT,
PRIMARY KEY(evt_tx_hash,evt_index)
);
CREATE TABLE IF NOT EXISTS pool_initialize (
"evt_tx_hash" VARCHAR(64),
"evt_index" INT,
"evt_block_time" TIMESTAMP,
"evt_block_number" DECIMAL,
"sqrt_price_x96" DECIMAL,
"tick" INT,
PRIMARY KEY(evt_tx_hash,evt_index)
);
CREATE TABLE IF NOT EXISTS pool_mint (
"evt_tx_hash" VARCHAR(64),
"evt_index" INT,
"evt_block_time" TIMESTAMP,
"evt_block_number" DECIMAL,
"amount" DECIMAL,
"amount0" DECIMAL,
"amount1" DECIMAL,
"owner" VARCHAR(40),
"sender" VARCHAR(40),
"tick_lower" INT,
"tick_upper" INT,
PRIMARY KEY(evt_tx_hash,evt_index)
);
CREATE TABLE IF NOT EXISTS pool_set_fee_protocol (
"evt_tx_hash" VARCHAR(64),
"evt_index" INT,
"evt_block_time" TIMESTAMP,
"evt_block_number" DECIMAL,
"fee_protocol0_new" INT,
"fee_protocol0_old" INT,
"fee_protocol1_new" INT,
"fee_protocol1_old" INT,
PRIMARY KEY(evt_tx_hash,evt_index)
);
CREATE TABLE IF NOT EXISTS pool_swap (
"evt_tx_hash" VARCHAR(64),
"evt_index" INT,
"evt_block_time" TIMESTAMP,
"evt_block_number" DECIMAL,
"amount0" DECIMAL,
"amount1" DECIMAL,
"liquidity" DECIMAL,
"recipient" VARCHAR(40),
"sender" VARCHAR(40),
"sqrt_price_x96" DECIMAL,
"tick" INT,
PRIMARY KEY(evt_tx_hash,evt_index)
);