forked from mento-protocol/simulation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmock_data.py
29 lines (26 loc) · 952 Bytes
/
mock_data.py
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
"""
Creating mock data to test historical simulation
"""
from pathlib import Path
import pandas as pd
import numpy as np
CUSD_USD_VARIANCE_PER_BLOCK = 0.01 / (365 * 24 * 60 * 12)
CELO_USD_VARIANCE_PER_BLOCK = 1 / (365 * 24 * 60 * 12)
BTC_USD_VARIANCE_PER_BLOCK = 0.1 / (365 * 24 * 60 * 12)
ETH_USD_VARIANCE_PER_BLOCK = 0.2 / (365 * 24 * 60 * 12)
samples = np.random.multivariate_normal(
[0, 0, 0, 0],
np.array([
[CUSD_USD_VARIANCE_PER_BLOCK, 0, 0, 0],
[0, CELO_USD_VARIANCE_PER_BLOCK, 0, 0],
[0, 0, BTC_USD_VARIANCE_PER_BLOCK, 0],
[0, 0, 0, ETH_USD_VARIANCE_PER_BLOCK]]
),
120 * 60 * 12 + 1
)
# mock data single depeg event
#samples = np.array([[0.05, 0] if x == 0 else [0, 0] for x in range(0, 125)])
temp = pd.DataFrame(samples, columns=('cusd_usd', 'celo_usd', 'btc_usd', 'eth_usd'))
temp.index += 1
data_path = Path(__file__, "../mock_logreturns.prq")
temp = temp.to_parquet(data_path.resolve())