1
1
#! /bin/bash
2
2
set -e
3
3
4
-
5
4
# Run the first one sync, this will generate a fresh pickle
6
5
python -m backend.scripts.generate_ucache \
7
6
asset-liability \
8
7
--mode 0 \
9
8
--perp-market-index 0
10
9
11
-
12
10
# The next ones will use the --use-snapshot flag, so they will reuse the pickle
13
11
# We can run all commands in parallel by adding & at the end
12
+
13
+ echo " Generating comprehensive price shock cache matrix..."
14
+ echo " Asset groups: ignore+stables, jlp+only"
15
+ echo " Scenarios: 5 (0.05 distortion), 10 (0.1 distortion)"
16
+ echo " Pool IDs: all, 0, 1, 3"
17
+ echo " Total combinations: 16"
18
+
19
+ # =============================================================================
20
+ # ALL POOLS (no pool filter) - 4 combinations
21
+ # =============================================================================
22
+
23
+ # ignore+stables, 5 scenarios, 0.05 distortion, all pools
14
24
python -m backend.scripts.generate_ucache \
15
25
--use-snapshot \
16
26
price-shock \
17
27
--asset-group " ignore+stables" \
18
28
--oracle-distortion 0.05 \
19
29
--n-scenarios 5 &
20
30
31
+ # ignore+stables, 10 scenarios, 0.1 distortion, all pools
32
+ python -m backend.scripts.generate_ucache \
33
+ --use-snapshot \
34
+ price-shock \
35
+ --asset-group " ignore+stables" \
36
+ --oracle-distortion 0.1 \
37
+ --n-scenarios 10 &
38
+
39
+ # jlp+only, 5 scenarios, 0.05 distortion, all pools
21
40
python -m backend.scripts.generate_ucache \
22
41
--use-snapshot \
23
42
price-shock \
24
43
--asset-group " jlp+only" \
25
44
--oracle-distortion 0.05 \
26
45
--n-scenarios 5 &
27
46
47
+ # jlp+only, 10 scenarios, 0.1 distortion, all pools
28
48
python -m backend.scripts.generate_ucache \
29
49
--use-snapshot \
30
50
price-shock \
31
51
--asset-group " jlp+only" \
32
52
--oracle-distortion 0.1 \
33
53
--n-scenarios 10 &
34
54
55
+ # =============================================================================
56
+ # MAIN POOL (pool_id = 0) - 4 combinations
57
+ # =============================================================================
58
+
59
+ # ignore+stables, 5 scenarios, 0.05 distortion, pool 0
60
+ python -m backend.scripts.generate_ucache \
61
+ --use-snapshot \
62
+ price-shock \
63
+ --asset-group " ignore+stables" \
64
+ --oracle-distortion 0.05 \
65
+ --n-scenarios 5 \
66
+ --pool-id 0 &
35
67
68
+ # ignore+stables, 10 scenarios, 0.1 distortion, pool 0
36
69
python -m backend.scripts.generate_ucache \
37
70
--use-snapshot \
38
71
price-shock \
39
72
--asset-group " ignore+stables" \
40
73
--oracle-distortion 0.1 \
41
- --n-scenarios 10 &
74
+ --n-scenarios 10 \
75
+ --pool-id 0 &
76
+
77
+ # jlp+only, 5 scenarios, 0.05 distortion, pool 0
78
+ python -m backend.scripts.generate_ucache \
79
+ --use-snapshot \
80
+ price-shock \
81
+ --asset-group " jlp+only" \
82
+ --oracle-distortion 0.05 \
83
+ --n-scenarios 5 \
84
+ --pool-id 0 &
85
+
86
+ # jlp+only, 10 scenarios, 0.1 distortion, pool 0
87
+ python -m backend.scripts.generate_ucache \
88
+ --use-snapshot \
89
+ price-shock \
90
+ --asset-group " jlp+only" \
91
+ --oracle-distortion 0.1 \
92
+ --n-scenarios 10 \
93
+ --pool-id 0 &
94
+
95
+ # =============================================================================
96
+ # ISOLATED POOL 1 (pool_id = 1) - 4 combinations
97
+ # =============================================================================
98
+
99
+ # ignore+stables, 5 scenarios, 0.05 distortion, pool 1
100
+ python -m backend.scripts.generate_ucache \
101
+ --use-snapshot \
102
+ price-shock \
103
+ --asset-group " ignore+stables" \
104
+ --oracle-distortion 0.05 \
105
+ --n-scenarios 5 \
106
+ --pool-id 1 &
107
+
108
+ # ignore+stables, 10 scenarios, 0.1 distortion, pool 1
109
+ python -m backend.scripts.generate_ucache \
110
+ --use-snapshot \
111
+ price-shock \
112
+ --asset-group " ignore+stables" \
113
+ --oracle-distortion 0.1 \
114
+ --n-scenarios 10 \
115
+ --pool-id 1 &
42
116
117
+ # jlp+only, 5 scenarios, 0.05 distortion, pool 1
118
+ python -m backend.scripts.generate_ucache \
119
+ --use-snapshot \
120
+ price-shock \
121
+ --asset-group " jlp+only" \
122
+ --oracle-distortion 0.05 \
123
+ --n-scenarios 5 \
124
+ --pool-id 1 &
125
+
126
+ # jlp+only, 10 scenarios, 0.1 distortion, pool 1
127
+ python -m backend.scripts.generate_ucache \
128
+ --use-snapshot \
129
+ price-shock \
130
+ --asset-group " jlp+only" \
131
+ --oracle-distortion 0.1 \
132
+ --n-scenarios 10 \
133
+ --pool-id 1 &
134
+
135
+ # =============================================================================
136
+ # ISOLATED POOL 3 (pool_id = 3) - 4 combinations
137
+ # =============================================================================
138
+
139
+ # ignore+stables, 5 scenarios, 0.05 distortion, pool 3
140
+ python -m backend.scripts.generate_ucache \
141
+ --use-snapshot \
142
+ price-shock \
143
+ --asset-group " ignore+stables" \
144
+ --oracle-distortion 0.05 \
145
+ --n-scenarios 5 \
146
+ --pool-id 3 &
147
+
148
+ # ignore+stables, 10 scenarios, 0.1 distortion, pool 3
149
+ python -m backend.scripts.generate_ucache \
150
+ --use-snapshot \
151
+ price-shock \
152
+ --asset-group " ignore+stables" \
153
+ --oracle-distortion 0.1 \
154
+ --n-scenarios 10 \
155
+ --pool-id 3 &
156
+
157
+ # jlp+only, 5 scenarios, 0.05 distortion, pool 3
158
+ python -m backend.scripts.generate_ucache \
159
+ --use-snapshot \
160
+ price-shock \
161
+ --asset-group " jlp+only" \
162
+ --oracle-distortion 0.05 \
163
+ --n-scenarios 5 \
164
+ --pool-id 3 &
165
+
166
+ # jlp+only, 10 scenarios, 0.1 distortion, pool 3
167
+ python -m backend.scripts.generate_ucache \
168
+ --use-snapshot \
169
+ price-shock \
170
+ --asset-group " jlp+only" \
171
+ --oracle-distortion 0.1 \
172
+ --n-scenarios 10 \
173
+ --pool-id 3 &
174
+
175
+ # =============================================================================
43
176
# Wait for all background processes to complete
177
+ # =============================================================================
178
+ echo " Waiting for all 16 price shock cache generation processes to complete..."
44
179
wait
45
180
181
+ echo " ✅ All cache generation completed successfully!"
182
+
46
183
# Delete old pickles
47
184
cd pickles && ls -t | tail -n +4 | xargs rm -rf
0 commit comments