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.clickhouse.sql
99 lines (98 loc) · 3.07 KB
/
schema.clickhouse.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
CREATE TABLE IF NOT EXISTS pool_burn (
"evt_tx_hash" VARCHAR(64),
"evt_index" INT,
"evt_block_time" TIMESTAMP,
"evt_block_number" UInt64,
"amount" UInt128,
"amount0" UInt256,
"amount1" UInt256,
"owner" VARCHAR(40),
"tick_lower" Int32,
"tick_upper" Int32
) ENGINE = MergeTree 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" UInt64,
"amount0" UInt128,
"amount1" UInt128,
"owner" VARCHAR(40),
"recipient" VARCHAR(40),
"tick_lower" Int32,
"tick_upper" Int32
) ENGINE = MergeTree 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" UInt64,
"amount0" UInt128,
"amount1" UInt128,
"recipient" VARCHAR(40),
"sender" VARCHAR(40)
) ENGINE = MergeTree 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" UInt64,
"amount0" UInt256,
"amount1" UInt256,
"paid0" UInt256,
"paid1" UInt256,
"recipient" VARCHAR(40),
"sender" VARCHAR(40)
) ENGINE = MergeTree 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" UInt64,
"observation_cardinality_next_new" UInt16,
"observation_cardinality_next_old" UInt16
) ENGINE = MergeTree 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" UInt64,
"sqrt_price_x96" UInt256,
"tick" Int32
) ENGINE = MergeTree 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" UInt64,
"amount" UInt128,
"amount0" UInt256,
"amount1" UInt256,
"owner" VARCHAR(40),
"sender" VARCHAR(40),
"tick_lower" Int32,
"tick_upper" Int32
) ENGINE = MergeTree 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" UInt64,
"fee_protocol0_new" UInt8,
"fee_protocol0_old" UInt8,
"fee_protocol1_new" UInt8,
"fee_protocol1_old" UInt8
) ENGINE = MergeTree 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" UInt64,
"amount0" Int256,
"amount1" Int256,
"liquidity" UInt128,
"recipient" VARCHAR(40),
"sender" VARCHAR(40),
"sqrt_price_x96" UInt256,
"tick" Int32
) ENGINE = MergeTree PRIMARY KEY ("evt_tx_hash","evt_index");