forked from valamidev/DataSynchronizer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sql
More file actions
243 lines (198 loc) · 8.64 KB
/
install.sql
File metadata and controls
243 lines (198 loc) · 8.64 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
CREATE DATABASE `stockml_exchange`;
CREATE DATABASE `stockml`;
USE `stockml`;
/*Table structure for table `account_balance` */
DROP TABLE IF EXISTS `account_balance`;
CREATE TABLE `account_balance` (
`symbol` varchar(30) COLLATE utf8mb4_hungarian_ci NOT NULL DEFAULT '',
`available` double NOT NULL,
`onOrder` double NOT NULL,
`time` bigint(20) NOT NULL DEFAULT '0',
PRIMARY KEY (`symbol`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_hungarian_ci;
/*Table structure for table `account_orders` */
DROP TABLE IF EXISTS `account_orders`;
CREATE TABLE `account_orders` (
`id` varchar(255) NOT NULL,
`instance_id` INT(10) NULL DEFAULT '0',
`time` bigint(20) NOT NULL DEFAULT '0',
`timestamp` bigint(20) DEFAULT NULL,
`datetime` varchar(255) DEFAULT NULL,
`lastTradeTimestamp` bigint(20) DEFAULT NULL,
`symbol` varchar(255) DEFAULT NULL,
`type` varchar(255) DEFAULT NULL,
`side` varchar(255) DEFAULT NULL,
`price` double DEFAULT NULL,
`amount` double DEFAULT NULL,
`cost` double DEFAULT NULL,
`average` double DEFAULT NULL,
`filled` double DEFAULT NULL,
`remaining` double DEFAULT NULL,
`status` varchar(255) DEFAULT NULL,
`fee` double DEFAULT NULL,
`trades` int(10) DEFAULT NULL,
`info` json DEFAULT NULL,
`closed` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `id` (`id`,`time`,`closed`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*Table structure for table `account_trader_instances` */
DROP TABLE IF EXISTS `account_trader_instances`;
CREATE TABLE `account_trader_instances` (
`guid` int(10) NOT NULL AUTO_INCREMENT,
`acc_guid` INT(10) NULL DEFAULT '0',
`name` varchar(255) COLLATE utf8mb4_hungarian_ci NOT NULL DEFAULT '',
`strategy_guid` INT(10) NULL DEFAULT '0',
`limit_order` tinyint(1) NOT NULL DEFAULT '0',
`exchange` varchar(255) COLLATE utf8mb4_hungarian_ci NOT NULL DEFAULT 'binance',
`symbol` varchar(50) COLLATE utf8mb4_hungarian_ci NOT NULL DEFAULT '',
`asset` varchar(50) COLLATE utf8mb4_hungarian_ci NOT NULL DEFAULT '',
`quote` varchar(50) COLLATE utf8mb4_hungarian_ci NOT NULL DEFAULT '',
`asset_balance` double NOT NULL DEFAULT '0',
`quote_balance` double NOT NULL DEFAULT '0',
`order_asset_balance` double NOT NULL DEFAULT '0',
`order_quote_balance` double NOT NULL DEFAULT '0',
PRIMARY KEY (`guid`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_hungarian_ci;
/*Table structure for table `accounts` */
DROP TABLE IF EXISTS `accounts`;
CREATE TABLE `accounts` (
`guid` int(10) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_hungarian_ci NOT NULL,
`label` varchar(255) COLLATE utf8mb4_hungarian_ci NOT NULL,
PRIMARY KEY (`guid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_hungarian_ci;
/*Table structure for table `market_datas` */
DROP TABLE IF EXISTS `market_datas`;
CREATE TABLE `market_datas` (
`exchange` varchar(30) NOT NULL DEFAULT '',
`limits` text NOT NULL,
`precision_data` text NOT NULL,
`tierBased` INT(10) NULL DEFAULT '0',
`percentage` INT(10) NULL DEFAULT '0',
`taker` float NOT NULL DEFAULT '0',
`maker` float NOT NULL DEFAULT '0',
`id` varchar(255) NOT NULL,
`symbol` varchar(255) NOT NULL,
`baseId` varchar(255) NOT NULL,
`quoteId` varchar(255) NOT NULL,
`base` varchar(255) NOT NULL,
`quote` varchar(255) NOT NULL,
`active` INT(10) NULL DEFAULT '0',
`info` text NOT NULL,
UNIQUE KEY `exchange` (`exchange`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*Table structure for table `price_tickers` */
DROP TABLE IF EXISTS `price_tickers`;
CREATE TABLE `price_tickers` (
`exchange` varchar(255) NOT NULL,
`symbol` varchar(255) NOT NULL,
`timestamp` bigint(20) NOT NULL DEFAULT '0',
`high` float NOT NULL DEFAULT '0',
`low` float NOT NULL DEFAULT '0',
`bid` float NOT NULL DEFAULT '0',
`ask` float NOT NULL DEFAULT '0',
`last` float NOT NULL DEFAULT '0',
`change` float DEFAULT '0',
`percentage` float DEFAULT '0',
`baseVolume` float DEFAULT '0',
`quoteVolume` float DEFAULT '0',
`info` text,
UNIQUE KEY `exchange` (`exchange`,`symbol`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*Table structure for table `quotes` */
DROP TABLE IF EXISTS `quotes`;
CREATE TABLE `quotes` (
`guid` int(10) NOT NULL AUTO_INCREMENT,
`name` varchar(30) NOT NULL DEFAULT 'BTC',
PRIMARY KEY (`guid`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
/*Table structure for table `sentiment_reddit` */
DROP TABLE IF EXISTS `sentiment_reddit`;
CREATE TABLE `sentiment_reddit` (
`time` bigint(20) NOT NULL DEFAULT '0',
`subreddit` varchar(40) NOT NULL DEFAULT '',
`sum_ups` int(11) NOT NULL DEFAULT '0',
`sum_comments` int(11) NOT NULL DEFAULT '0',
`titles` text CHARACTER SET utf8mb4 COLLATE utf8mb4_hungarian_ci NOT NULL,
UNIQUE KEY `time` (`time`,`subreddit`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Table structure for table `sentiment_twitter` */
DROP TABLE IF EXISTS `sentiment_twitter`;
CREATE TABLE `sentiment_twitter` (
`time` bigint(20) NOT NULL DEFAULT '0',
`created_at` varchar(60) NOT NULL DEFAULT 'Fri May 03 11:00:11 +0000 2019',
`asset` varchar(20) NOT NULL DEFAULT 'None',
`text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_hungarian_ci,
`id` bigint(20) NOT NULL DEFAULT '0',
`user` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_hungarian_ci NOT NULL DEFAULT '',
`followers` INT(10) NULL DEFAULT '0',
`listed` INT(10) NULL DEFAULT '0',
UNIQUE KEY `asset` (`asset`,`id`),
KEY `time` (`time`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Table structure for table `sentiments` */
DROP TABLE IF EXISTS `sentiments`;
CREATE TABLE `sentiments` (
`type` char(10) NOT NULL DEFAULT 'twitter',
`name` varchar(255) NOT NULL DEFAULT '',
UNIQUE KEY `type` (`type`,`name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Table structure for table `trade_advice` */
DROP TABLE IF EXISTS `trade_advice`;
CREATE TABLE `trade_advice` (
`strategy` varchar(64) COLLATE utf8mb4_hungarian_ci NOT NULL DEFAULT 'NEO',
`strategy_guid` INT(10) NULL DEFAULT '0',
`strategy_config` json DEFAULT NULL,
`symbol` varchar(20) COLLATE utf8mb4_hungarian_ci NOT NULL DEFAULT '',
`exchange` varchar(50) COLLATE utf8mb4_hungarian_ci NOT NULL DEFAULT '',
`action` varchar(20) COLLATE utf8mb4_hungarian_ci NOT NULL DEFAULT '',
`prevActionIfNotIdle` varchar(20) COLLATE utf8mb4_hungarian_ci NOT NULL DEFAULT '',
`time` bigint(20) NOT NULL DEFAULT '0',
`close` double NOT NULL DEFAULT '0',
UNIQUE KEY `strategy_guid` (`strategy_guid`,`symbol`,`time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_hungarian_ci;
/*Table structure for table `trade_strategies` */
DROP TABLE IF EXISTS `trade_strategies`;
CREATE TABLE `trade_strategies` (
`guid` int(10) NOT NULL AUTO_INCREMENT,
`strategy` varchar(120) NOT NULL DEFAULT 'data_gen2',
`strategy_config` json DEFAULT NULL,
`exchange` varchar(20) NOT NULL DEFAULT 'Binance',
`symbol` varchar(20) NOT NULL DEFAULT 'BTCUSDT',
`asset` varchar(20) NOT NULL DEFAULT 'BTC',
`quote` varchar(20) NOT NULL DEFAULT 'USDT',
`interval_sec` int(10) NOT NULL DEFAULT '300',
UNIQUE KEY `guid` (`guid`)
) ENGINE=InnoDB AUTO_INCREMENT=107 DEFAULT CHARSET=latin1;
/*Table structure for table `trade_strategies_evaluation` */
DROP TABLE IF EXISTS `trade_strategies_evaluation`;
CREATE TABLE `trade_strategies_evaluation` (
`symbol` varchar(20) NOT NULL DEFAULT 'BTCUSDT',
`exchange` varchar(20) NOT NULL DEFAULT 'Binance',
`interval_sec` int(10) NOT NULL DEFAULT '300',
`candle_limit` int(10) NOT NULL DEFAULT '400',
`strategy` varchar(120) NOT NULL DEFAULT 'data_gen2',
`strategy_config` json DEFAULT NULL,
`performance` float NOT NULL DEFAULT '1000',
`actions` json DEFAULT NULL,
`time` bigint(20) NOT NULL DEFAULT '0',
`guid` int(10) NOT NULL AUTO_INCREMENT,
UNIQUE KEY `guid` (`guid`),
KEY `time` (`time`),
KEY `symbol` (`symbol`,`exchange`,`interval_sec`),
KEY `performance` (`performance`)
) ENGINE=InnoDB AUTO_INCREMENT=44633 DEFAULT CHARSET=latin1;
/*Table structure for table `tradepairs` */
DROP TABLE IF EXISTS `tradepairs`;
CREATE TABLE `tradepairs` (
`exchange` varchar(20) NOT NULL DEFAULT 'Binance',
`symbol` varchar(20) NOT NULL DEFAULT 'BTCTUSD',
`id` varchar(50) DEFAULT NULL,
`asset` varchar(20) NOT NULL DEFAULT 'BTC',
`quote` varchar(20) NOT NULL DEFAULT 'TUSD',
`is_warden` tinyint(1) NOT NULL DEFAULT '0',
`time` bigint(20) NOT NULL DEFAULT '0',
UNIQUE KEY `exchange` (`exchange`,`symbol`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;