diff --git a/README.md b/README.md index 2506c26..4104065 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,3 @@ The full README can be found at [go-client/README.md](./go-client/README.md) The py-visualizer is a FTSO Fast Updates Visualizer implemented in Python. It is used to provide a real-time visualization of the time-series feeds generated by the Fast Updates client. The full README can be found at [py-visualizer/README.md](./py-visualizer/README.md) - -## ts-simulation - -The ts-simulation is a FTSO Fast Updates Simulation implemented in TypeScript. It is used to optimize and test new contract parameters. It can be used alongside py-visualizer to visualize the Fast Updates protocol in action. - -The full README can be found at [ts-simulation/README.md](./ts-simulation/README.md) diff --git a/flare-smart-contracts-v2 b/flare-smart-contracts-v2 index cd79c44..19d109c 160000 --- a/flare-smart-contracts-v2 +++ b/flare-smart-contracts-v2 @@ -1 +1 @@ -Subproject commit cd79c446fbfba1f8454c5176dda2a6b171697bb8 +Subproject commit 19d109c8f03718eaba6624fc7e7debd9e0478fe6 diff --git a/go-client/config/config.go b/go-client/config/config.go index 806f139..dfdbc0f 100644 --- a/go-client/config/config.go +++ b/go-client/config/config.go @@ -77,6 +77,10 @@ func BuildConfig() (*Config, error) { if err != nil { return nil, err } + err = ReadEnv(cfg) + if err != nil { + return nil, err + } _, err = url.ParseRequestURI(cfg.Client.ValueProviderUrl) if err != nil { diff --git a/ts-simulation/.gitignore b/ts-simulation/.gitignore deleted file mode 100644 index ddd220e..0000000 --- a/ts-simulation/.gitignore +++ /dev/null @@ -1,94 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -.pnpm-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variable files -.env -.env.development.local -.env.test.local -.env.production.local -.env.local - - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test -.DS_Store -.idea -.vscode - -# yarn v2 -.yarn -.pnp.* - -# coverage -coverage -coverage.json - -# typing - -# typing -typechain -typechain-types -typechain-truffle -typechain-web3 -typechain-truffle -typechain-web3 - -# Hardhat files -cache -artifacts -nul - -# other files -go-client/sig.out -go-client/keys.out diff --git a/ts-simulation/.prettierrc b/ts-simulation/.prettierrc deleted file mode 100644 index 038f116..0000000 --- a/ts-simulation/.prettierrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "semi": false, - "singleQuote": true, - "trailingComma": "es5", - "tabWidth": 4 -} diff --git a/ts-simulation/README.md b/ts-simulation/README.md deleted file mode 100644 index abe285b..0000000 --- a/ts-simulation/README.md +++ /dev/null @@ -1,99 +0,0 @@ -# FTSO Fast Updates Simulation - -This repo contains MVP of an implementation of the new Fast Updates proposal. - -## Setup - -### Node.JS - -Install [NVM](https://github.com/nvm-sh/nvm), and Node v18 (LTS): - -```bash -nvm install 18 -``` - -### Yarn - -Install dependencies with `yarn`: - -```bash -corepack enable -yarn install -``` - -### Project - -To compile smart contracts: - -```bash -yarn compile -``` - -To format with prettier: - -```bash -yarn format -``` - -To lint with eslint: - -```bash -yarn lint -``` - -## Docker - -To build a docker image, run: - -```bash -docker build -t fast-updates . -``` - -To test the protocol using docker, navigate to the `test` directory and run docker compose: - -```bash -cd test -docker compose up -``` - -## Simulating locally - -Start the chain: - -```bash -yarn hardhat node -``` - -Deploy the contracts and run the admin daemon: - -```bash -yarn hardhat deploy-contracts --network localhost && yarn hardhat run-admin-daemon --network localhost -``` - -Run the fast updates providers: - -```bash -yarn ts-node client/run-fast-updates-provider.ts $ID --network localhost -``` - -where `$ID` is the ID of the provider (1, 2, ...) - -## Simulating with Docker - -A simulation of the protocol using docker is available. It includes deploying and setting a chain node, -deploying contracts, running a daemon, and running multiple fast updates providers. Navigate to -`deployment/simulation` (assuming that the docker image `fast-updates` was build, as explained above) -and run docker compose: - -```bash -cd deployment -docker compose up -``` - -## Notes - -Strict type checked (in addition to strict mode) is enforced throughout the project (see `tsconfig.json` and `.eslintrc.js`). - -For testing purposes (under `test/`), `typechain-truffle` is used to generate typechain artifacts from the contracts. The contracts are locally instantiated and used in the tests. - -For deployment purposes (under `deployment/`), `typechain-web3-v1` is used to interact with the contracts. diff --git a/ts-simulation/client/config/example-price-feeds/arbusdt.json b/ts-simulation/client/config/example-price-feeds/arbusdt.json deleted file mode 100644 index 4b94b99..0000000 --- a/ts-simulation/client/config/example-price-feeds/arbusdt.json +++ /dev/null @@ -1,502 +0,0 @@ -{ - "0": 1.6636, - "5": 1.6629, - "10": 1.664, - "15": 1.664, - "20": 1.6635, - "25": 1.6642, - "30": 1.6642, - "35": 1.6641, - "40": 1.6628, - "45": 1.6629, - "50": 1.6631, - "55": 1.6631, - "60": 1.6628, - "65": 1.6627, - "70": 1.6638, - "75": 1.6638, - "80": 1.6626, - "85": 1.6636, - "90": 1.6632, - "95": 1.6635, - "100": 1.6638, - "105": 1.6639, - "110": 1.6636, - "115": 1.6632, - "120": 1.6635, - "125": 1.663, - "130": 1.663, - "135": 1.663, - "140": 1.6633, - "145": 1.6628, - "150": 1.6631, - "155": 1.6633, - "160": 1.6636, - "165": 1.6639, - "170": 1.6629, - "175": 1.6625, - "180": 1.6626, - "185": 1.6626, - "190": 1.6618, - "195": 1.661, - "200": 1.6612, - "205": 1.6604, - "210": 1.6603, - "215": 1.6614, - "220": 1.6596, - "225": 1.6583, - "230": 1.6585, - "235": 1.6583, - "240": 1.6584, - "245": 1.6579, - "250": 1.6586, - "255": 1.6582, - "260": 1.6591, - "265": 1.6584, - "270": 1.6589, - "275": 1.6576, - "280": 1.6576, - "285": 1.6582, - "290": 1.6592, - "295": 1.6593, - "300": 1.6599, - "305": 1.6585, - "310": 1.6586, - "315": 1.6579, - "320": 1.6576, - "325": 1.6578, - "330": 1.6571, - "335": 1.6574, - "340": 1.6566, - "345": 1.6561, - "350": 1.6557, - "355": 1.6556, - "360": 1.6547, - "365": 1.6549, - "370": 1.6545, - "375": 1.6544, - "380": 1.6547, - "385": 1.654, - "390": 1.6545, - "395": 1.6548, - "400": 1.6553, - "405": 1.655, - "410": 1.6545, - "415": 1.654, - "420": 1.6544, - "425": 1.6552, - "430": 1.6552, - "435": 1.6549, - "440": 1.655, - "445": 1.6558, - "450": 1.6545, - "455": 1.6541, - "460": 1.6539, - "465": 1.6533, - "470": 1.6547, - "475": 1.6545, - "480": 1.654, - "485": 1.6535, - "490": 1.6543, - "495": 1.6541, - "500": 1.653, - "505": 1.6525, - "510": 1.6523, - "515": 1.6523, - "520": 1.6525, - "525": 1.6501, - "530": 1.6503, - "535": 1.6506, - "540": 1.6499, - "545": 1.6511, - "550": 1.6531, - "555": 1.6539, - "560": 1.6533, - "565": 1.6533, - "570": 1.6537, - "575": 1.6532, - "580": 1.6527, - "585": 1.6527, - "590": 1.6518, - "595": 1.6525, - "600": 1.6511, - "605": 1.6506, - "610": 1.6509, - "615": 1.6506, - "620": 1.6506, - "625": 1.6507, - "630": 1.6513, - "635": 1.6516, - "640": 1.6512, - "645": 1.6514, - "650": 1.6513, - "655": 1.6506, - "660": 1.651, - "665": 1.6509, - "670": 1.6513, - "675": 1.6507, - "680": 1.6507, - "685": 1.6505, - "690": 1.6497, - "695": 1.6499, - "700": 1.6497, - "705": 1.6497, - "710": 1.6497, - "715": 1.6501, - "720": 1.6491, - "725": 1.6501, - "730": 1.6498, - "735": 1.6502, - "740": 1.6502, - "745": 1.6507, - "750": 1.6507, - "755": 1.6505, - "760": 1.65, - "765": 1.6494, - "770": 1.6493, - "775": 1.6489, - "780": 1.6481, - "785": 1.6484, - "790": 1.649, - "795": 1.6484, - "800": 1.6482, - "805": 1.6473, - "810": 1.6469, - "815": 1.6471, - "820": 1.6471, - "825": 1.6468, - "830": 1.6464, - "835": 1.6456, - "840": 1.6474, - "845": 1.6468, - "850": 1.6461, - "855": 1.6483, - "860": 1.6471, - "865": 1.6478, - "870": 1.6467, - "875": 1.6471, - "880": 1.6467, - "885": 1.6452, - "890": 1.6452, - "895": 1.6452, - "900": 1.6464, - "905": 1.6462, - "910": 1.646, - "915": 1.6455, - "920": 1.6465, - "925": 1.647, - "930": 1.6458, - "935": 1.6464, - "940": 1.6462, - "945": 1.6465, - "950": 1.6458, - "955": 1.6469, - "960": 1.6468, - "965": 1.6481, - "970": 1.6473, - "975": 1.6474, - "980": 1.6487, - "985": 1.6489, - "990": 1.6488, - "995": 1.6482, - "1000": 1.6475, - "1005": 1.6469, - "1010": 1.6462, - "1015": 1.6459, - "1020": 1.6453, - "1025": 1.6457, - "1030": 1.6442, - "1035": 1.6439, - "1040": 1.6448, - "1045": 1.6441, - "1050": 1.6446, - "1055": 1.6436, - "1060": 1.644, - "1065": 1.6439, - "1070": 1.6429, - "1075": 1.6437, - "1080": 1.6432, - "1085": 1.643, - "1090": 1.643, - "1095": 1.6435, - "1100": 1.6432, - "1105": 1.6442, - "1110": 1.6437, - "1115": 1.644, - "1120": 1.644, - "1125": 1.6447, - "1130": 1.6445, - "1135": 1.644, - "1140": 1.6439, - "1145": 1.6439, - "1150": 1.6444, - "1155": 1.6441, - "1160": 1.6443, - "1165": 1.6437, - "1170": 1.6429, - "1175": 1.6428, - "1180": 1.643, - "1185": 1.6431, - "1190": 1.6426, - "1195": 1.6429, - "1200": 1.6437, - "1205": 1.6444, - "1210": 1.6443, - "1215": 1.6441, - "1220": 1.6445, - "1225": 1.643, - "1230": 1.643, - "1235": 1.6435, - "1240": 1.6437, - "1245": 1.6435, - "1250": 1.6426, - "1255": 1.6427, - "1260": 1.6421, - "1265": 1.6428, - "1270": 1.6428, - "1275": 1.6427, - "1280": 1.6425, - "1285": 1.6424, - "1290": 1.6424, - "1295": 1.642, - "1300": 1.6404, - "1305": 1.6403, - "1310": 1.6415, - "1315": 1.6411, - "1320": 1.6405, - "1325": 1.6406, - "1330": 1.641, - "1335": 1.6421, - "1340": 1.6435, - "1345": 1.6457, - "1350": 1.6455, - "1355": 1.6474, - "1360": 1.6482, - "1365": 1.6471, - "1370": 1.6464, - "1375": 1.6471, - "1380": 1.6461, - "1385": 1.6465, - "1390": 1.6477, - "1395": 1.6479, - "1400": 1.6484, - "1405": 1.6484, - "1410": 1.6482, - "1415": 1.6471, - "1420": 1.6471, - "1425": 1.6475, - "1430": 1.6475, - "1435": 1.6481, - "1440": 1.6483, - "1445": 1.649, - "1450": 1.6481, - "1455": 1.6475, - "1460": 1.6471, - "1465": 1.6466, - "1470": 1.6472, - "1475": 1.6468, - "1480": 1.6481, - "1485": 1.6477, - "1490": 1.6494, - "1495": 1.6497, - "1500": 1.65, - "1505": 1.6509, - "1510": 1.6504, - "1515": 1.6504, - "1520": 1.6512, - "1525": 1.6512, - "1530": 1.6514, - "1535": 1.6519, - "1540": 1.6519, - "1545": 1.6525, - "1550": 1.652, - "1555": 1.6519, - "1560": 1.6521, - "1565": 1.6532, - "1570": 1.653, - "1575": 1.6528, - "1580": 1.6532, - "1585": 1.6529, - "1590": 1.6538, - "1595": 1.6531, - "1600": 1.6537, - "1605": 1.6525, - "1610": 1.6523, - "1615": 1.6514, - "1620": 1.6528, - "1625": 1.6536, - "1630": 1.6537, - "1635": 1.6532, - "1640": 1.6531, - "1645": 1.6536, - "1650": 1.6536, - "1655": 1.6537, - "1660": 1.6541, - "1665": 1.6529, - "1670": 1.6542, - "1675": 1.6541, - "1680": 1.6547, - "1685": 1.6541, - "1690": 1.654, - "1695": 1.6551, - "1700": 1.6545, - "1705": 1.6542, - "1710": 1.6542, - "1715": 1.6542, - "1720": 1.6542, - "1725": 1.6535, - "1730": 1.6526, - "1735": 1.6527, - "1740": 1.653, - "1745": 1.6538, - "1750": 1.6543, - "1755": 1.6543, - "1760": 1.6541, - "1765": 1.6537, - "1770": 1.6533, - "1775": 1.6536, - "1780": 1.6524, - "1785": 1.652, - "1790": 1.6519, - "1795": 1.6518, - "1800": 1.6515, - "1805": 1.6515, - "1810": 1.6513, - "1815": 1.6507, - "1820": 1.6507, - "1825": 1.6488, - "1830": 1.6476, - "1835": 1.6469, - "1840": 1.6467, - "1845": 1.6467, - "1850": 1.6463, - "1855": 1.6466, - "1860": 1.6481, - "1865": 1.648, - "1870": 1.6498, - "1875": 1.6504, - "1880": 1.6505, - "1885": 1.6503, - "1890": 1.6492, - "1895": 1.6502, - "1900": 1.6506, - "1905": 1.6508, - "1910": 1.6507, - "1915": 1.6496, - "1920": 1.6489, - "1925": 1.6486, - "1930": 1.6464, - "1935": 1.6453, - "1940": 1.6458, - "1945": 1.6443, - "1950": 1.6444, - "1955": 1.6442, - "1960": 1.644, - "1965": 1.6448, - "1970": 1.6444, - "1975": 1.6439, - "1980": 1.6437, - "1985": 1.6443, - "1990": 1.644, - "1995": 1.6436, - "2000": 1.6433, - "2005": 1.6429, - "2010": 1.6426, - "2015": 1.6425, - "2020": 1.6424, - "2025": 1.6411, - "2030": 1.642, - "2035": 1.6407, - "2040": 1.6409, - "2045": 1.6401, - "2050": 1.64, - "2055": 1.6403, - "2060": 1.6401, - "2065": 1.6396, - "2070": 1.6392, - "2075": 1.6388, - "2080": 1.6383, - "2085": 1.6379, - "2090": 1.6355, - "2095": 1.636, - "2100": 1.6338, - "2105": 1.6335, - "2110": 1.6329, - "2115": 1.6315, - "2120": 1.6334, - "2125": 1.6302, - "2130": 1.6321, - "2135": 1.6314, - "2140": 1.6342, - "2145": 1.6336, - "2150": 1.632, - "2155": 1.6334, - "2160": 1.6346, - "2165": 1.6367, - "2170": 1.6365, - "2175": 1.6348, - "2180": 1.6353, - "2185": 1.6338, - "2190": 1.6349, - "2195": 1.6352, - "2200": 1.6353, - "2205": 1.6355, - "2210": 1.6339, - "2215": 1.6341, - "2220": 1.6349, - "2225": 1.6357, - "2230": 1.6364, - "2235": 1.6357, - "2240": 1.6352, - "2245": 1.6359, - "2250": 1.6366, - "2255": 1.6352, - "2260": 1.6353, - "2265": 1.6353, - "2270": 1.6338, - "2275": 1.635, - "2280": 1.6334, - "2285": 1.6338, - "2290": 1.6366, - "2295": 1.6356, - "2300": 1.6361, - "2305": 1.6347, - "2310": 1.637, - "2315": 1.6357, - "2320": 1.6373, - "2325": 1.6379, - "2330": 1.6368, - "2335": 1.6372, - "2340": 1.6379, - "2345": 1.6376, - "2350": 1.6368, - "2355": 1.6367, - "2360": 1.636, - "2365": 1.637, - "2370": 1.637, - "2375": 1.6353, - "2380": 1.6355, - "2385": 1.6357, - "2390": 1.6366, - "2395": 1.6358, - "2400": 1.6374, - "2405": 1.6379, - "2410": 1.6389, - "2415": 1.6391, - "2420": 1.6396, - "2425": 1.64, - "2430": 1.6403, - "2435": 1.6413, - "2440": 1.6416, - "2445": 1.6419, - "2450": 1.6416, - "2455": 1.6426, - "2460": 1.6434, - "2465": 1.6453, - "2470": 1.6458, - "2475": 1.6445, - "2480": 1.6445, - "2485": 1.6443, - "2490": 1.643, - "2495": 1.6445 -} diff --git a/ts-simulation/client/config/example-price-feeds/btcusdt.json b/ts-simulation/client/config/example-price-feeds/btcusdt.json deleted file mode 100644 index 7b167a2..0000000 --- a/ts-simulation/client/config/example-price-feeds/btcusdt.json +++ /dev/null @@ -1,502 +0,0 @@ -{ - "0": 69321.98, - "5": 69290.0, - "10": 69306.01, - "15": 69315.59, - "20": 69280.01, - "25": 69349.12, - "30": 69336.0, - "35": 69334.01, - "40": 69304.01, - "45": 69304.13, - "50": 69304.01, - "55": 69312.0, - "60": 69304.0, - "65": 69304.51, - "70": 69324.0, - "75": 69326.97, - "80": 69304.0, - "85": 69315.29, - "90": 69308.0, - "95": 69308.0, - "100": 69319.99, - "105": 69350.0, - "110": 69331.47, - "115": 69331.45, - "120": 69336.0, - "125": 69335.99, - "130": 69331.45, - "135": 69353.51, - "140": 69351.56, - "145": 69338.32, - "150": 69351.77, - "155": 69360.6, - "160": 69400.0, - "165": 69373.61, - "170": 69350.01, - "175": 69338.12, - "180": 69326.01, - "185": 69322.01, - "190": 69307.6, - "195": 69250.0, - "200": 69256.41, - "205": 69230.01, - "210": 69226.13, - "215": 69225.86, - "220": 69170.01, - "225": 69103.67, - "230": 69137.23, - "235": 69126.0, - "240": 69125.99, - "245": 69149.6, - "250": 69157.57, - "255": 69142.19, - "260": 69153.21, - "265": 69136.43, - "270": 69166.0, - "275": 69132.0, - "280": 69128.0, - "285": 69148.15, - "290": 69179.99, - "295": 69169.45, - "300": 69187.3, - "305": 69169.41, - "310": 69169.41, - "315": 69150.6, - "320": 69150.6, - "325": 69150.01, - "330": 69147.99, - "335": 69157.52, - "340": 69147.99, - "345": 69148.01, - "350": 69150.01, - "355": 69140.45, - "360": 69112.08, - "365": 69094.01, - "370": 69082.56, - "375": 69084.08, - "380": 69080.01, - "385": 69042.86, - "390": 69053.99, - "395": 69080.0, - "400": 69097.99, - "405": 69091.07, - "410": 69080.91, - "415": 69080.91, - "420": 69092.3, - "425": 69105.33, - "430": 69100.13, - "435": 69092.45, - "440": 69106.0, - "445": 69092.44, - "450": 69047.8, - "455": 69038.0, - "460": 69067.99, - "465": 69040.36, - "470": 69095.99, - "475": 69089.08, - "480": 69086.0, - "485": 69062.08, - "490": 69105.59, - "495": 69105.32, - "500": 69078.99, - "505": 69118.45, - "510": 69106.01, - "515": 69117.66, - "520": 69124.58, - "525": 69080.02, - "530": 69106.91, - "535": 69106.48, - "540": 69085.38, - "545": 69123.63, - "550": 69154.48, - "555": 69199.99, - "560": 69189.99, - "565": 69176.45, - "570": 69185.76, - "575": 69172.0, - "580": 69171.39, - "585": 69158.0, - "590": 69157.77, - "595": 69159.99, - "600": 69116.15, - "605": 69103.5, - "610": 69118.0, - "615": 69114.0, - "620": 69111.18, - "625": 69117.89, - "630": 69121.46, - "635": 69114.55, - "640": 69105.77, - "645": 69114.53, - "650": 69105.76, - "655": 69114.0, - "660": 69113.99, - "665": 69124.13, - "670": 69128.45, - "675": 69118.0, - "680": 69115.97, - "685": 69107.72, - "690": 69084.0, - "695": 69091.5, - "700": 69096.0, - "705": 69083.83, - "710": 69062.08, - "715": 69060.61, - "720": 69043.06, - "725": 69075.49, - "730": 69075.49, - "735": 69091.02, - "740": 69095.93, - "745": 69110.0, - "750": 69113.3, - "755": 69091.02, - "760": 69074.7, - "765": 69053.99, - "770": 69044.02, - "775": 69033.97, - "780": 69008.72, - "785": 69014.14, - "790": 69046.01, - "795": 69035.99, - "800": 69027.17, - "805": 69009.99, - "810": 69000.01, - "815": 69010.0, - "820": 69005.99, - "825": 69004.02, - "830": 68959.99, - "835": 68935.25, - "840": 68986.0, - "845": 68981.57, - "850": 68970.0, - "855": 69053.99, - "860": 69030.61, - "865": 69043.99, - "870": 69029.29, - "875": 69022.38, - "880": 69025.99, - "885": 68979.03, - "890": 68987.51, - "895": 68977.94, - "900": 69001.24, - "905": 69011.28, - "910": 69002.2, - "915": 68973.33, - "920": 68986.0, - "925": 69007.96, - "930": 68985.04, - "935": 69003.66, - "940": 69015.75, - "945": 69028.66, - "950": 69011.37, - "955": 69033.12, - "960": 69054.98, - "965": 69080.9, - "970": 69060.21, - "975": 69061.99, - "980": 69089.96, - "985": 69120.01, - "990": 69106.01, - "995": 69080.23, - "1000": 69067.12, - "1005": 69050.01, - "1010": 69036.01, - "1015": 69005.17, - "1020": 68995.99, - "1025": 69000.0, - "1030": 68949.03, - "1035": 68937.47, - "1040": 68986.0, - "1045": 68961.49, - "1050": 68974.85, - "1055": 68940.61, - "1060": 68961.42, - "1065": 68966.0, - "1070": 68946.0, - "1075": 68944.0, - "1080": 68912.01, - "1085": 68909.99, - "1090": 68940.0, - "1095": 68962.65, - "1100": 68960.01, - "1105": 68964.28, - "1110": 68972.11, - "1115": 68980.0, - "1120": 69000.0, - "1125": 69013.99, - "1130": 69000.01, - "1135": 68968.24, - "1140": 68974.36, - "1145": 68967.18, - "1150": 68984.45, - "1155": 68983.53, - "1160": 68974.91, - "1165": 68970.0, - "1170": 68926.01, - "1175": 68911.99, - "1180": 68932.69, - "1185": 68929.99, - "1190": 68924.0, - "1195": 68926.0, - "1200": 68925.99, - "1205": 68950.0, - "1210": 68930.0, - "1215": 68926.89, - "1220": 68934.52, - "1225": 68889.81, - "1230": 68926.0, - "1235": 68934.56, - "1240": 68940.02, - "1245": 68920.01, - "1250": 68886.0, - "1255": 68910.0, - "1260": 68890.01, - "1265": 68911.01, - "1270": 68899.65, - "1275": 68890.01, - "1280": 68876.01, - "1285": 68868.75, - "1290": 68872.01, - "1295": 68857.59, - "1300": 68828.05, - "1305": 68809.5, - "1310": 68856.0, - "1315": 68854.33, - "1320": 68824.52, - "1325": 68810.0, - "1330": 68837.99, - "1335": 68873.54, - "1340": 68928.57, - "1345": 68999.98, - "1350": 69029.31, - "1355": 69086.04, - "1360": 69075.98, - "1365": 69031.99, - "1370": 69008.13, - "1375": 69025.99, - "1380": 68982.23, - "1385": 68987.99, - "1390": 69034.9, - "1395": 69073.78, - "1400": 69083.96, - "1405": 69082.0, - "1410": 69087.99, - "1415": 69060.01, - "1420": 69059.99, - "1425": 69093.99, - "1430": 69070.0, - "1435": 69099.99, - "1440": 69109.73, - "1445": 69106.0, - "1450": 69076.0, - "1455": 69079.99, - "1460": 69076.0, - "1465": 69088.0, - "1470": 69101.86, - "1475": 69100.14, - "1480": 69113.43, - "1485": 69122.0, - "1490": 69162.6, - "1495": 69176.05, - "1500": 69189.93, - "1505": 69197.09, - "1510": 69182.36, - "1515": 69180.01, - "1520": 69197.01, - "1525": 69213.46, - "1530": 69208.4, - "1535": 69250.0, - "1540": 69250.0, - "1545": 69270.4, - "1550": 69227.23, - "1555": 69218.0, - "1560": 69239.95, - "1565": 69258.61, - "1570": 69242.27, - "1575": 69221.94, - "1580": 69224.0, - "1585": 69223.97, - "1590": 69233.99, - "1595": 69228.7, - "1600": 69233.5, - "1605": 69194.0, - "1610": 69180.91, - "1615": 69180.01, - "1620": 69223.95, - "1625": 69242.02, - "1630": 69264.01, - "1635": 69207.21, - "1640": 69221.99, - "1645": 69245.99, - "1650": 69233.86, - "1655": 69220.0, - "1660": 69233.38, - "1665": 69220.0, - "1670": 69263.46, - "1675": 69273.95, - "1680": 69291.56, - "1685": 69285.79, - "1690": 69274.96, - "1695": 69309.99, - "1700": 69292.52, - "1705": 69273.15, - "1710": 69290.0, - "1715": 69298.51, - "1720": 69298.5, - "1725": 69280.0, - "1730": 69252.01, - "1735": 69275.99, - "1740": 69276.93, - "1745": 69288.72, - "1750": 69292.67, - "1755": 69290.01, - "1760": 69262.01, - "1765": 69246.01, - "1770": 69240.6, - "1775": 69244.88, - "1780": 69230.0, - "1785": 69210.0, - "1790": 69219.51, - "1795": 69206.01, - "1800": 69217.99, - "1805": 69213.37, - "1810": 69211.07, - "1815": 69192.01, - "1820": 69192.01, - "1825": 69147.15, - "1830": 69110.0, - "1835": 69095.0, - "1840": 69060.0, - "1845": 69080.44, - "1850": 69050.0, - "1855": 69033.25, - "1860": 69080.0, - "1865": 69109.99, - "1870": 69143.27, - "1875": 69149.25, - "1880": 69173.76, - "1885": 69125.2, - "1890": 69115.31, - "1895": 69135.6, - "1900": 69157.31, - "1905": 69163.99, - "1910": 69153.08, - "1915": 69120.0, - "1920": 69096.99, - "1925": 69071.99, - "1930": 68970.89, - "1935": 68925.4, - "1940": 68943.99, - "1945": 68901.01, - "1950": 68925.99, - "1955": 68952.17, - "1960": 68946.87, - "1965": 68959.99, - "1970": 68950.0, - "1975": 68926.01, - "1980": 68931.16, - "1985": 68967.44, - "1990": 68940.0, - "1995": 68910.02, - "2000": 68904.01, - "2005": 68886.02, - "2010": 68865.07, - "2015": 68850.0, - "2020": 68858.99, - "2025": 68816.0, - "2030": 68876.08, - "2035": 68820.91, - "2040": 68841.99, - "2045": 68808.01, - "2050": 68808.01, - "2055": 68816.64, - "2060": 68812.73, - "2065": 68788.46, - "2070": 68784.0, - "2075": 68777.11, - "2080": 68740.0, - "2085": 68740.0, - "2090": 68720.05, - "2095": 68680.01, - "2100": 68668.16, - "2105": 68675.87, - "2110": 68657.27, - "2115": 68630.56, - "2120": 68596.0, - "2125": 68372.16, - "2130": 68495.21, - "2135": 68496.85, - "2140": 68550.6, - "2145": 68540.5, - "2150": 68514.0, - "2155": 68575.2, - "2160": 68600.01, - "2165": 68678.57, - "2170": 68666.5, - "2175": 68631.16, - "2180": 68637.99, - "2185": 68600.0, - "2190": 68634.01, - "2195": 68640.0, - "2200": 68644.62, - "2205": 68648.06, - "2210": 68600.34, - "2215": 68587.73, - "2220": 68607.36, - "2225": 68649.65, - "2230": 68655.05, - "2235": 68636.91, - "2240": 68627.18, - "2245": 68641.14, - "2250": 68634.0, - "2255": 68587.2, - "2260": 68583.76, - "2265": 68581.31, - "2270": 68526.4, - "2275": 68542.35, - "2280": 68538.32, - "2285": 68566.0, - "2290": 68634.29, - "2295": 68607.99, - "2300": 68617.44, - "2305": 68571.99, - "2310": 68640.59, - "2315": 68624.51, - "2320": 68660.0, - "2325": 68658.26, - "2330": 68634.49, - "2335": 68649.99, - "2340": 68680.0, - "2345": 68677.0, - "2350": 68643.99, - "2355": 68649.99, - "2360": 68611.43, - "2365": 68637.99, - "2370": 68645.77, - "2375": 68602.32, - "2380": 68597.79, - "2385": 68610.01, - "2390": 68634.0, - "2395": 68633.99, - "2400": 68684.01, - "2405": 68697.58, - "2410": 68717.6, - "2415": 68724.0, - "2420": 68740.69, - "2425": 68729.99, - "2430": 68744.0, - "2435": 68772.8, - "2440": 68772.81, - "2445": 68770.01, - "2450": 68746.0, - "2455": 68773.55, - "2460": 68800.0, - "2465": 68846.0, - "2470": 68879.99, - "2475": 68824.01, - "2480": 68816.87, - "2485": 68818.01, - "2490": 68784.36, - "2495": 68822.0 -} diff --git a/ts-simulation/client/config/example-price-feeds/ethusdt.json b/ts-simulation/client/config/example-price-feeds/ethusdt.json deleted file mode 100644 index 5b8981b..0000000 --- a/ts-simulation/client/config/example-price-feeds/ethusdt.json +++ /dev/null @@ -1,502 +0,0 @@ -{ - "0": 3537.78, - "5": 3536.29, - "10": 3537.6, - "15": 3537.97, - "20": 3535.29, - "25": 3538.35, - "30": 3537.64, - "35": 3538.03, - "40": 3536.18, - "45": 3536.19, - "50": 3536.14, - "55": 3537.34, - "60": 3536.95, - "65": 3536.76, - "70": 3538.27, - "75": 3538.23, - "80": 3536.01, - "85": 3538.36, - "90": 3537.99, - "95": 3538.26, - "100": 3538.89, - "105": 3540.34, - "110": 3539.32, - "115": 3539.03, - "120": 3539.8, - "125": 3539.14, - "130": 3539.26, - "135": 3540.22, - "140": 3539.89, - "145": 3539.44, - "150": 3540.45, - "155": 3540.81, - "160": 3541.9, - "165": 3540.94, - "170": 3539.61, - "175": 3538.72, - "180": 3538.28, - "185": 3538.28, - "190": 3537.78, - "195": 3536.28, - "200": 3537.07, - "205": 3535.65, - "210": 3535.66, - "215": 3540.08, - "220": 3537.02, - "225": 3533.87, - "230": 3535.21, - "235": 3533.51, - "240": 3533.17, - "245": 3533.5, - "250": 3534.59, - "255": 3533.67, - "260": 3534.96, - "265": 3532.86, - "270": 3534.4, - "275": 3532.63, - "280": 3532.24, - "285": 3532.99, - "290": 3534.61, - "295": 3534.72, - "300": 3535.68, - "305": 3534.16, - "310": 3533.94, - "315": 3532.39, - "320": 3532.39, - "325": 3532.02, - "330": 3531.6, - "335": 3532.29, - "340": 3531.25, - "345": 3530.26, - "350": 3529.74, - "355": 3529.43, - "360": 3527.39, - "365": 3527.3, - "370": 3527.81, - "375": 3527.55, - "380": 3527.63, - "385": 3526.15, - "390": 3526.71, - "395": 3527.7, - "400": 3528.06, - "405": 3528.12, - "410": 3527.45, - "415": 3527.45, - "420": 3528.3, - "425": 3528.85, - "430": 3529.38, - "435": 3528.56, - "440": 3529.38, - "445": 3530.0, - "450": 3526.0, - "455": 3526.0, - "460": 3527.01, - "465": 3525.11, - "470": 3527.99, - "475": 3526.99, - "480": 3526.99, - "485": 3525.9, - "490": 3527.99, - "495": 3527.47, - "500": 3525.83, - "505": 3527.04, - "510": 3526.43, - "515": 3526.43, - "520": 3527.62, - "525": 3524.76, - "530": 3525.95, - "535": 3526.42, - "540": 3525.36, - "545": 3527.17, - "550": 3529.43, - "555": 3531.7, - "560": 3530.8, - "565": 3530.87, - "570": 3531.47, - "575": 3530.31, - "580": 3529.97, - "585": 3529.25, - "590": 3528.71, - "595": 3529.44, - "600": 3527.11, - "605": 3526.12, - "610": 3526.85, - "615": 3526.15, - "620": 3525.88, - "625": 3526.24, - "630": 3526.96, - "635": 3526.54, - "640": 3526.2, - "645": 3526.54, - "650": 3526.21, - "655": 3526.37, - "660": 3526.37, - "665": 3526.57, - "670": 3526.91, - "675": 3525.94, - "680": 3525.61, - "685": 3524.71, - "690": 3523.53, - "695": 3524.59, - "700": 3524.07, - "705": 3523.58, - "710": 3523.32, - "715": 3522.85, - "720": 3522.05, - "725": 3523.08, - "730": 3523.0, - "735": 3523.4, - "740": 3523.4, - "745": 3524.31, - "750": 3524.37, - "755": 3523.48, - "760": 3522.95, - "765": 3521.53, - "770": 3521.1, - "775": 3520.47, - "780": 3519.25, - "785": 3519.91, - "790": 3521.59, - "795": 3521.56, - "800": 3519.78, - "805": 3518.28, - "810": 3517.52, - "815": 3518.23, - "820": 3518.24, - "825": 3517.67, - "830": 3515.34, - "835": 3514.52, - "840": 3517.07, - "845": 3515.4, - "850": 3515.68, - "855": 3518.95, - "860": 3518.22, - "865": 3519.44, - "870": 3518.38, - "875": 3518.32, - "880": 3518.27, - "885": 3516.54, - "890": 3516.69, - "895": 3516.91, - "900": 3518.26, - "905": 3517.88, - "910": 3517.8, - "915": 3516.4, - "920": 3517.56, - "925": 3518.62, - "930": 3517.26, - "935": 3517.95, - "940": 3518.04, - "945": 3518.82, - "950": 3517.54, - "955": 3518.58, - "960": 3519.48, - "965": 3520.94, - "970": 3520.4, - "975": 3520.24, - "980": 3522.03, - "985": 3522.35, - "990": 3521.29, - "995": 3520.5, - "1000": 3519.9, - "1005": 3518.72, - "1010": 3517.27, - "1015": 3516.82, - "1020": 3516.02, - "1025": 3516.38, - "1030": 3513.05, - "1035": 3512.6, - "1040": 3515.01, - "1045": 3514.37, - "1050": 3515.22, - "1055": 3513.68, - "1060": 3514.64, - "1065": 3514.95, - "1070": 3514.07, - "1075": 3514.71, - "1080": 3513.53, - "1085": 3513.38, - "1090": 3514.32, - "1095": 3515.37, - "1100": 3514.93, - "1105": 3516.21, - "1110": 3516.66, - "1115": 3516.85, - "1120": 3517.95, - "1125": 3518.24, - "1130": 3516.85, - "1135": 3515.15, - "1140": 3515.79, - "1145": 3515.93, - "1150": 3516.94, - "1155": 3517.09, - "1160": 3516.57, - "1165": 3516.46, - "1170": 3514.05, - "1175": 3514.02, - "1180": 3515.33, - "1185": 3515.58, - "1190": 3515.33, - "1195": 3515.54, - "1200": 3515.78, - "1205": 3517.78, - "1210": 3517.35, - "1215": 3517.36, - "1220": 3517.36, - "1225": 3515.32, - "1230": 3516.58, - "1235": 3516.78, - "1240": 3517.15, - "1245": 3517.32, - "1250": 3515.9, - "1255": 3515.91, - "1260": 3515.03, - "1265": 3516.01, - "1270": 3515.5, - "1275": 3515.5, - "1280": 3514.3, - "1285": 3514.3, - "1290": 3514.01, - "1295": 3513.9, - "1300": 3512.23, - "1305": 3511.15, - "1310": 3514.11, - "1315": 3514.67, - "1320": 3515.57, - "1325": 3514.06, - "1330": 3516.14, - "1335": 3517.02, - "1340": 3520.12, - "1345": 3522.38, - "1350": 3522.33, - "1355": 3524.49, - "1360": 3523.77, - "1365": 3521.22, - "1370": 3520.45, - "1375": 3521.72, - "1380": 3518.77, - "1385": 3520.38, - "1390": 3522.0, - "1395": 3523.32, - "1400": 3524.11, - "1405": 3524.34, - "1410": 3524.03, - "1415": 3522.85, - "1420": 3523.21, - "1425": 3524.68, - "1430": 3523.01, - "1435": 3524.67, - "1440": 3524.6, - "1445": 3523.9, - "1450": 3521.6, - "1455": 3520.23, - "1460": 3520.41, - "1465": 3519.86, - "1470": 3520.41, - "1475": 3520.11, - "1480": 3521.22, - "1485": 3522.23, - "1490": 3524.07, - "1495": 3524.97, - "1500": 3526.11, - "1505": 3527.05, - "1510": 3525.41, - "1515": 3525.01, - "1520": 3526.38, - "1525": 3526.69, - "1530": 3526.18, - "1535": 3527.38, - "1540": 3527.32, - "1545": 3527.83, - "1550": 3526.57, - "1555": 3525.82, - "1560": 3526.7, - "1565": 3527.32, - "1570": 3525.91, - "1575": 3525.18, - "1580": 3525.19, - "1585": 3524.84, - "1590": 3525.74, - "1595": 3525.63, - "1600": 3525.48, - "1605": 3523.16, - "1610": 3522.39, - "1615": 3521.42, - "1620": 3524.06, - "1625": 3525.02, - "1630": 3525.97, - "1635": 3523.12, - "1640": 3524.0, - "1645": 3525.39, - "1650": 3524.56, - "1655": 3524.44, - "1660": 3524.95, - "1665": 3521.19, - "1670": 3523.51, - "1675": 3524.06, - "1680": 3525.19, - "1685": 3524.49, - "1690": 3524.06, - "1695": 3525.73, - "1700": 3525.11, - "1705": 3524.84, - "1710": 3526.0, - "1715": 3526.0, - "1720": 3526.16, - "1725": 3525.02, - "1730": 3523.02, - "1735": 3523.81, - "1740": 3523.85, - "1745": 3524.85, - "1750": 3525.35, - "1755": 3525.86, - "1760": 3524.63, - "1765": 3524.28, - "1770": 3523.32, - "1775": 3523.23, - "1780": 3522.17, - "1785": 3521.63, - "1790": 3521.99, - "1795": 3520.78, - "1800": 3520.99, - "1805": 3521.0, - "1810": 3521.0, - "1815": 3520.0, - "1820": 3520.0, - "1825": 3516.82, - "1830": 3514.62, - "1835": 3512.97, - "1840": 3511.83, - "1845": 3512.69, - "1850": 3511.72, - "1855": 3510.85, - "1860": 3513.35, - "1865": 3514.11, - "1870": 3516.43, - "1875": 3516.59, - "1880": 3517.48, - "1885": 3514.95, - "1890": 3514.72, - "1895": 3516.19, - "1900": 3516.73, - "1905": 3516.84, - "1910": 3516.71, - "1915": 3514.53, - "1920": 3513.95, - "1925": 3512.5, - "1930": 3509.45, - "1935": 3506.76, - "1940": 3506.77, - "1945": 3505.25, - "1950": 3506.12, - "1955": 3506.11, - "1960": 3506.75, - "1965": 3506.89, - "1970": 3506.57, - "1975": 3506.45, - "1980": 3506.93, - "1985": 3507.95, - "1990": 3506.75, - "1995": 3506.29, - "2000": 3505.8, - "2005": 3505.26, - "2010": 3504.31, - "2015": 3504.29, - "2020": 3503.96, - "2025": 3502.71, - "2030": 3504.71, - "2035": 3501.3, - "2040": 3501.61, - "2045": 3500.55, - "2050": 3501.01, - "2055": 3501.52, - "2060": 3501.01, - "2065": 3500.55, - "2070": 3500.73, - "2075": 3500.93, - "2080": 3500.01, - "2085": 3500.23, - "2090": 3498.66, - "2095": 3498.0, - "2100": 3492.86, - "2105": 3493.98, - "2110": 3491.52, - "2115": 3486.35, - "2120": 3489.97, - "2125": 3486.04, - "2130": 3489.09, - "2135": 3488.04, - "2140": 3490.63, - "2145": 3490.1, - "2150": 3487.48, - "2155": 3489.58, - "2160": 3492.09, - "2165": 3495.5, - "2170": 3494.0, - "2175": 3492.34, - "2180": 3493.5, - "2185": 3490.71, - "2190": 3492.3, - "2195": 3493.1, - "2200": 3492.78, - "2205": 3492.31, - "2210": 3489.3, - "2215": 3488.88, - "2220": 3489.49, - "2225": 3491.88, - "2230": 3491.74, - "2235": 3490.67, - "2240": 3489.15, - "2245": 3490.14, - "2250": 3490.33, - "2255": 3488.14, - "2260": 3487.77, - "2265": 3488.71, - "2270": 3485.82, - "2275": 3486.39, - "2280": 3485.22, - "2285": 3486.8, - "2290": 3491.65, - "2295": 3489.67, - "2300": 3490.78, - "2305": 3488.37, - "2310": 3492.06, - "2315": 3490.51, - "2320": 3492.17, - "2325": 3492.01, - "2330": 3490.69, - "2335": 3490.72, - "2340": 3492.48, - "2345": 3491.99, - "2350": 3489.58, - "2355": 3490.4, - "2360": 3487.81, - "2365": 3488.8, - "2370": 3488.45, - "2375": 3486.43, - "2380": 3486.6, - "2385": 3486.74, - "2390": 3488.86, - "2395": 3489.36, - "2400": 3492.81, - "2405": 3493.62, - "2410": 3494.74, - "2415": 3494.57, - "2420": 3495.05, - "2425": 3495.2, - "2430": 3495.69, - "2435": 3498.22, - "2440": 3498.41, - "2445": 3498.1, - "2450": 3497.11, - "2455": 3498.78, - "2460": 3499.99, - "2465": 3501.54, - "2470": 3503.06, - "2475": 3500.39, - "2480": 3500.29, - "2485": 3500.14, - "2490": 3498.02, - "2495": 3500.01 -} diff --git a/ts-simulation/client/config/example-price-feeds/linkusdt.json b/ts-simulation/client/config/example-price-feeds/linkusdt.json deleted file mode 100644 index af4d9a6..0000000 --- a/ts-simulation/client/config/example-price-feeds/linkusdt.json +++ /dev/null @@ -1,502 +0,0 @@ -{ - "0": 19.363, - "5": 19.357, - "10": 19.362, - "15": 19.362, - "20": 19.354, - "25": 19.362, - "30": 19.362, - "35": 19.36, - "40": 19.348, - "45": 19.351, - "50": 19.351, - "55": 19.356, - "60": 19.35, - "65": 19.349, - "70": 19.35, - "75": 19.342, - "80": 19.331, - "85": 19.339, - "90": 19.337, - "95": 19.337, - "100": 19.339, - "105": 19.345, - "110": 19.343, - "115": 19.343, - "120": 19.343, - "125": 19.342, - "130": 19.341, - "135": 19.346, - "140": 19.349, - "145": 19.344, - "150": 19.349, - "155": 19.352, - "160": 19.36, - "165": 19.367, - "170": 19.362, - "175": 19.359, - "180": 19.356, - "185": 19.352, - "190": 19.355, - "195": 19.344, - "200": 19.344, - "205": 19.337, - "210": 19.331, - "215": 19.337, - "220": 19.313, - "225": 19.298, - "230": 19.3, - "235": 19.292, - "240": 19.292, - "245": 19.293, - "250": 19.295, - "255": 19.287, - "260": 19.296, - "265": 19.284, - "270": 19.286, - "275": 19.275, - "280": 19.276, - "285": 19.278, - "290": 19.284, - "295": 19.284, - "300": 19.293, - "305": 19.287, - "310": 19.284, - "315": 19.277, - "320": 19.277, - "325": 19.275, - "330": 19.27, - "335": 19.274, - "340": 19.268, - "345": 19.264, - "350": 19.264, - "355": 19.258, - "360": 19.251, - "365": 19.248, - "370": 19.255, - "375": 19.258, - "380": 19.259, - "385": 19.256, - "390": 19.277, - "395": 19.272, - "400": 19.273, - "405": 19.27, - "410": 19.268, - "415": 19.268, - "420": 19.272, - "425": 19.255, - "430": 19.257, - "435": 19.248, - "440": 19.255, - "445": 19.256, - "450": 19.244, - "455": 19.24, - "460": 19.24, - "465": 19.231, - "470": 19.248, - "475": 19.24, - "480": 19.239, - "485": 19.23, - "490": 19.236, - "495": 19.233, - "500": 19.227, - "505": 19.231, - "510": 19.229, - "515": 19.229, - "520": 19.234, - "525": 19.219, - "530": 19.222, - "535": 19.224, - "540": 19.219, - "545": 19.229, - "550": 19.239, - "555": 19.248, - "560": 19.243, - "565": 19.246, - "570": 19.247, - "575": 19.245, - "580": 19.241, - "585": 19.238, - "590": 19.231, - "595": 19.235, - "600": 19.226, - "605": 19.22, - "610": 19.227, - "615": 19.224, - "620": 19.225, - "625": 19.23, - "630": 19.236, - "635": 19.234, - "640": 19.234, - "645": 19.234, - "650": 19.232, - "655": 19.23, - "660": 19.231, - "665": 19.228, - "670": 19.233, - "675": 19.226, - "680": 19.224, - "685": 19.224, - "690": 19.215, - "695": 19.217, - "700": 19.217, - "705": 19.217, - "710": 19.216, - "715": 19.225, - "720": 19.22, - "725": 19.22, - "730": 19.219, - "735": 19.221, - "740": 19.221, - "745": 19.226, - "750": 19.226, - "755": 19.224, - "760": 19.224, - "765": 19.224, - "770": 19.224, - "775": 19.228, - "780": 19.219, - "785": 19.218, - "790": 19.217, - "795": 19.216, - "800": 19.211, - "805": 19.203, - "810": 19.193, - "815": 19.188, - "820": 19.188, - "825": 19.188, - "830": 19.18, - "835": 19.168, - "840": 19.185, - "845": 19.185, - "850": 19.178, - "855": 19.204, - "860": 19.198, - "865": 19.201, - "870": 19.201, - "875": 19.192, - "880": 19.193, - "885": 19.183, - "890": 19.179, - "895": 19.177, - "900": 19.186, - "905": 19.19, - "910": 19.187, - "915": 19.187, - "920": 19.19, - "925": 19.195, - "930": 19.192, - "935": 19.205, - "940": 19.196, - "945": 19.2, - "950": 19.199, - "955": 19.198, - "960": 19.202, - "965": 19.214, - "970": 19.204, - "975": 19.204, - "980": 19.212, - "985": 19.219, - "990": 19.22, - "995": 19.22, - "1000": 19.21, - "1005": 19.2, - "1010": 19.193, - "1015": 19.189, - "1020": 19.183, - "1025": 19.184, - "1030": 19.17, - "1035": 19.17, - "1040": 19.182, - "1045": 19.175, - "1050": 19.182, - "1055": 19.166, - "1060": 19.17, - "1065": 19.172, - "1070": 19.168, - "1075": 19.164, - "1080": 19.158, - "1085": 19.157, - "1090": 19.167, - "1095": 19.177, - "1100": 19.177, - "1105": 19.182, - "1110": 19.175, - "1115": 19.175, - "1120": 19.176, - "1125": 19.177, - "1130": 19.176, - "1135": 19.171, - "1140": 19.164, - "1145": 19.163, - "1150": 19.166, - "1155": 19.169, - "1160": 19.176, - "1165": 19.174, - "1170": 19.167, - "1175": 19.165, - "1180": 19.166, - "1185": 19.171, - "1190": 19.17, - "1195": 19.17, - "1200": 19.172, - "1205": 19.183, - "1210": 19.173, - "1215": 19.173, - "1220": 19.176, - "1225": 19.164, - "1230": 19.164, - "1235": 19.168, - "1240": 19.169, - "1245": 19.162, - "1250": 19.153, - "1255": 19.151, - "1260": 19.149, - "1265": 19.152, - "1270": 19.152, - "1275": 19.149, - "1280": 19.138, - "1285": 19.142, - "1290": 19.141, - "1295": 19.14, - "1300": 19.128, - "1305": 19.12, - "1310": 19.137, - "1315": 19.145, - "1320": 19.147, - "1325": 19.147, - "1330": 19.145, - "1335": 19.151, - "1340": 19.169, - "1345": 19.184, - "1350": 19.189, - "1355": 19.2, - "1360": 19.202, - "1365": 19.192, - "1370": 19.189, - "1375": 19.196, - "1380": 19.184, - "1385": 19.193, - "1390": 19.202, - "1395": 19.211, - "1400": 19.218, - "1405": 19.222, - "1410": 19.223, - "1415": 19.219, - "1420": 19.214, - "1425": 19.211, - "1430": 19.207, - "1435": 19.216, - "1440": 19.223, - "1445": 19.231, - "1450": 19.217, - "1455": 19.213, - "1460": 19.212, - "1465": 19.21, - "1470": 19.21, - "1475": 19.209, - "1480": 19.216, - "1485": 19.222, - "1490": 19.234, - "1495": 19.236, - "1500": 19.242, - "1505": 19.252, - "1510": 19.246, - "1515": 19.248, - "1520": 19.252, - "1525": 19.255, - "1530": 19.255, - "1535": 19.27, - "1540": 19.269, - "1545": 19.274, - "1550": 19.264, - "1555": 19.257, - "1560": 19.266, - "1565": 19.269, - "1570": 19.262, - "1575": 19.254, - "1580": 19.253, - "1585": 19.252, - "1590": 19.267, - "1595": 19.26, - "1600": 19.263, - "1605": 19.252, - "1610": 19.249, - "1615": 19.246, - "1620": 19.259, - "1625": 19.269, - "1630": 19.276, - "1635": 19.266, - "1640": 19.274, - "1645": 19.279, - "1650": 19.271, - "1655": 19.268, - "1660": 19.268, - "1665": 19.256, - "1670": 19.276, - "1675": 19.278, - "1680": 19.282, - "1685": 19.281, - "1690": 19.28, - "1695": 19.29, - "1700": 19.285, - "1705": 19.277, - "1710": 19.279, - "1715": 19.282, - "1720": 19.281, - "1725": 19.283, - "1730": 19.276, - "1735": 19.281, - "1740": 19.283, - "1745": 19.29, - "1750": 19.298, - "1755": 19.296, - "1760": 19.294, - "1765": 19.288, - "1770": 19.286, - "1775": 19.288, - "1780": 19.278, - "1785": 19.271, - "1790": 19.268, - "1795": 19.259, - "1800": 19.265, - "1805": 19.266, - "1810": 19.269, - "1815": 19.256, - "1820": 19.259, - "1825": 19.234, - "1830": 19.222, - "1835": 19.216, - "1840": 19.208, - "1845": 19.211, - "1850": 19.216, - "1855": 19.213, - "1860": 19.227, - "1865": 19.232, - "1870": 19.248, - "1875": 19.246, - "1880": 19.245, - "1885": 19.219, - "1890": 19.22, - "1895": 19.216, - "1900": 19.218, - "1905": 19.219, - "1910": 19.215, - "1915": 19.196, - "1920": 19.193, - "1925": 19.185, - "1930": 19.17, - "1935": 19.164, - "1940": 19.165, - "1945": 19.158, - "1950": 19.163, - "1955": 19.164, - "1960": 19.164, - "1965": 19.165, - "1970": 19.16, - "1975": 19.159, - "1980": 19.157, - "1985": 19.164, - "1990": 19.161, - "1995": 19.158, - "2000": 19.151, - "2005": 19.141, - "2010": 19.144, - "2015": 19.142, - "2020": 19.143, - "2025": 19.134, - "2030": 19.138, - "2035": 19.126, - "2040": 19.129, - "2045": 19.117, - "2050": 19.12, - "2055": 19.119, - "2060": 19.115, - "2065": 19.115, - "2070": 19.115, - "2075": 19.113, - "2080": 19.104, - "2085": 19.102, - "2090": 19.103, - "2095": 19.088, - "2100": 19.07, - "2105": 19.073, - "2110": 19.054, - "2115": 19.028, - "2120": 19.048, - "2125": 19.032, - "2130": 19.043, - "2135": 19.044, - "2140": 19.055, - "2145": 19.052, - "2150": 19.036, - "2155": 19.054, - "2160": 19.064, - "2165": 19.089, - "2170": 19.089, - "2175": 19.068, - "2180": 19.074, - "2185": 19.052, - "2190": 19.071, - "2195": 19.072, - "2200": 19.073, - "2205": 19.064, - "2210": 19.053, - "2215": 19.058, - "2220": 19.069, - "2225": 19.08, - "2230": 19.081, - "2235": 19.077, - "2240": 19.074, - "2245": 19.074, - "2250": 19.081, - "2255": 19.066, - "2260": 19.072, - "2265": 19.076, - "2270": 19.059, - "2275": 19.065, - "2280": 19.056, - "2285": 19.058, - "2290": 19.085, - "2295": 19.079, - "2300": 19.083, - "2305": 19.067, - "2310": 19.089, - "2315": 19.081, - "2320": 19.094, - "2325": 19.096, - "2330": 19.086, - "2335": 19.1, - "2340": 19.107, - "2345": 19.104, - "2350": 19.097, - "2355": 19.094, - "2360": 19.084, - "2365": 19.087, - "2370": 19.092, - "2375": 19.085, - "2380": 19.082, - "2385": 19.085, - "2390": 19.092, - "2395": 19.093, - "2400": 19.112, - "2405": 19.116, - "2410": 19.128, - "2415": 19.132, - "2420": 19.137, - "2425": 19.132, - "2430": 19.132, - "2435": 19.145, - "2440": 19.145, - "2445": 19.145, - "2450": 19.136, - "2455": 19.145, - "2460": 19.154, - "2465": 19.164, - "2470": 19.172, - "2475": 19.159, - "2480": 19.159, - "2485": 19.16, - "2490": 19.146, - "2495": 19.152 -} diff --git a/ts-simulation/client/config/example-price-feeds/offchain_btcusd_prices.json b/ts-simulation/client/config/example-price-feeds/offchain_btcusd_prices.json deleted file mode 100644 index f75279d..0000000 --- a/ts-simulation/client/config/example-price-feeds/offchain_btcusd_prices.json +++ /dev/null @@ -1,2635 +0,0 @@ -{ - "0": 7562, - "5": 7564, - "10": 7563, - "15": 7562, - "20": 7562, - "25": 7562, - "30": 7559, - "35": 7559, - "40": 7560, - "45": 7560, - "50": 7555, - "55": 7559, - "60": 7559, - "65": 7559, - "70": 7560, - "75": 7565, - "80": 7567, - "85": 7566, - "90": 7566, - "95": 7566, - "100": 7566, - "105": 7570, - "110": 7568, - "115": 7568, - "120": 7566, - "125": 7567, - "130": 7567, - "135": 7569, - "140": 7570, - "145": 7573, - "150": 7573, - "155": 7574, - "160": 7574, - "165": 7575, - "170": 7574, - "175": 7573, - "180": 7576, - "185": 7563, - "190": 7558, - "195": 7559, - "200": 7561, - "205": 7557, - "210": 7558, - "215": 7560, - "220": 7559, - "225": 7560, - "230": 7558, - "235": 7556, - "240": 7558, - "245": 7562, - "250": 7563, - "255": 7564, - "260": 7562, - "265": 7558, - "270": 7558, - "275": 7560, - "280": 7558, - "285": 7562, - "290": 7564, - "295": 7563, - "300": 7562, - "305": 7559, - "310": 7566, - "315": 7559, - "320": 7563, - "325": 7561, - "330": 7561, - "335": 7561, - "340": 7560, - "345": 7561, - "350": 7561, - "355": 7562, - "360": 7564, - "365": 7566, - "370": 7565, - "375": 7562, - "380": 7563, - "385": 7561, - "390": 7561, - "395": 7560, - "400": 7559, - "405": 7559, - "410": 7559, - "415": 7558, - "420": 7556, - "425": 7558, - "430": 7557, - "435": 7556, - "440": 7558, - "445": 7556, - "450": 7556, - "455": 7557, - "460": 7557, - "465": 7557, - "470": 7557, - "475": 7557, - "480": 7558, - "485": 7557, - "490": 7558, - "495": 7556, - "500": 7556, - "505": 7557, - "510": 7559, - "515": 7561, - "520": 7560, - "525": 7561, - "530": 7559, - "535": 7561, - "540": 7567, - "545": 7559, - "550": 7571, - "555": 7567, - "560": 7567, - "565": 7571, - "570": 7567, - "575": 7567, - "580": 7571, - "585": 7570, - "590": 7568, - "595": 7569, - "600": 7571, - "605": 7569, - "610": 7570, - "615": 7571, - "620": 7570, - "625": 7570, - "630": 7571, - "635": 7570, - "640": 7571, - "645": 7570, - "650": 7570, - "655": 7570, - "660": 7570, - "665": 7570, - "670": 7568, - "675": 7570, - "680": 7569, - "685": 7570, - "690": 7568, - "695": 7568, - "700": 7568, - "705": 7566, - "710": 7563, - "715": 7563, - "720": 7562, - "725": 7562, - "730": 7564, - "735": 7565, - "740": 7565, - "745": 7564, - "750": 7565, - "755": 7567, - "760": 7568, - "765": 7567, - "770": 7562, - "775": 7563, - "780": 7563, - "785": 7563, - "790": 7564, - "795": 7565, - "800": 7567, - "805": 7567, - "810": 7567, - "815": 7569, - "820": 7567, - "825": 7569, - "830": 7569, - "835": 7569, - "840": 7568, - "845": 7569, - "850": 7569, - "855": 7569, - "860": 7570, - "865": 7569, - "870": 7570, - "875": 7570, - "880": 7570, - "885": 7570, - "890": 7570, - "895": 7570, - "900": 7571, - "905": 7570, - "910": 7571, - "915": 7572, - "920": 7572, - "925": 7572, - "930": 7573, - "935": 7572, - "940": 7573, - "945": 7572, - "950": 7573, - "955": 7573, - "960": 7573, - "965": 7573, - "970": 7573, - "975": 7573, - "980": 7565, - "985": 7573, - "990": 7567, - "995": 7565, - "1000": 7568, - "1005": 7567, - "1010": 7567, - "1015": 7567, - "1020": 7567, - "1025": 7568, - "1030": 7569, - "1035": 7569, - "1040": 7569, - "1045": 7582, - "1050": 7569, - "1055": 7577, - "1060": 7575, - "1065": 7575, - "1070": 7576, - "1075": 7577, - "1080": 7578, - "1085": 7578, - "1090": 7579, - "1095": 7578, - "1100": 7574, - "1105": 7569, - "1110": 7574, - "1115": 7572, - "1120": 7572, - "1125": 7573, - "1130": 7573, - "1135": 7572, - "1140": 7571, - "1145": 7570, - "1150": 7570, - "1155": 7569, - "1160": 7570, - "1165": 7568, - "1170": 7569, - "1175": 7567, - "1180": 7566, - "1185": 7566, - "1190": 7567, - "1195": 7566, - "1200": 7568, - "1205": 7566, - "1210": 7566, - "1215": 7569, - "1220": 7569, - "1225": 7567, - "1230": 7567, - "1235": 7569, - "1240": 7568, - "1245": 7567, - "1250": 7567, - "1255": 7567, - "1260": 7568, - "1265": 7567, - "1270": 7567, - "1275": 7568, - "1280": 7566, - "1285": 7568, - "1290": 7568, - "1295": 7560, - "1300": 7560, - "1305": 7562, - "1310": 7563, - "1315": 7562, - "1320": 7562, - "1325": 7562, - "1330": 7562, - "1335": 7561, - "1340": 7559, - "1345": 7557, - "1350": 7557, - "1355": 7555, - "1360": 7557, - "1365": 7555, - "1370": 7555, - "1375": 7555, - "1380": 7555, - "1385": 7552, - "1390": 7554, - "1395": 7552, - "1400": 7554, - "1405": 7552, - "1410": 7545, - "1415": 7547, - "1420": 7543, - "1425": 7543, - "1430": 7546, - "1435": 7544, - "1440": 7548, - "1445": 7554, - "1450": 7555, - "1455": 7555, - "1460": 7555, - "1465": 7551, - "1470": 7551, - "1475": 7551, - "1480": 7553, - "1485": 7553, - "1490": 7549, - "1495": 7548, - "1500": 7548, - "1505": 7548, - "1510": 7548, - "1515": 7548, - "1520": 7548, - "1525": 7548, - "1530": 7546, - "1535": 7547, - "1540": 7548, - "1545": 7548, - "1550": 7549, - "1555": 7549, - "1560": 7548, - "1565": 7548, - "1570": 7549, - "1575": 7548, - "1580": 7548, - "1585": 7548, - "1590": 7548, - "1595": 7546, - "1600": 7542, - "1605": 7541, - "1610": 7536, - "1615": 7536, - "1620": 7541, - "1625": 7538, - "1630": 7542, - "1635": 7538, - "1640": 7543, - "1645": 7540, - "1650": 7539, - "1655": 7536, - "1660": 7538, - "1665": 7539, - "1670": 7536, - "1675": 7538, - "1680": 7538, - "1685": 7537, - "1690": 7536, - "1695": 7541, - "1700": 7544, - "1705": 7539, - "1710": 7540, - "1715": 7538, - "1720": 7540, - "1725": 7540, - "1730": 7540, - "1735": 7537, - "1740": 7539, - "1745": 7537, - "1750": 7537, - "1755": 7531, - "1760": 7527, - "1765": 7532, - "1770": 7530, - "1775": 7532, - "1780": 7530, - "1785": 7536, - "1790": 7536, - "1795": 7533, - "1800": 7530, - "1805": 7532, - "1810": 7532, - "1815": 7530, - "1820": 7532, - "1825": 7530, - "1830": 7532, - "1835": 7533, - "1840": 7533, - "1845": 7533, - "1850": 7535, - "1855": 7537, - "1860": 7536, - "1865": 7537, - "1870": 7536, - "1875": 7537, - "1880": 7539, - "1885": 7539, - "1890": 7539, - "1895": 7541, - "1900": 7539, - "1905": 7542, - "1910": 7542, - "1915": 7542, - "1920": 7542, - "1925": 7538, - "1930": 7542, - "1935": 7538, - "1940": 7537, - "1945": 7533, - "1950": 7533, - "1955": 7537, - "1960": 7537, - "1965": 7533, - "1970": 7533, - "1975": 7531, - "1980": 7532, - "1985": 7533, - "1990": 7531, - "1995": 7531, - "2000": 7532, - "2005": 7530, - "2010": 7531, - "2015": 7531, - "2020": 7533, - "2025": 7533, - "2030": 7538, - "2035": 7533, - "2040": 7538, - "2045": 7538, - "2050": 7532, - "2055": 7534, - "2060": 7537, - "2065": 7537, - "2070": 7534, - "2075": 7538, - "2080": 7536, - "2085": 7534, - "2090": 7538, - "2095": 7537, - "2100": 7537, - "2105": 7537, - "2110": 7537, - "2115": 7538, - "2120": 7538, - "2125": 7538, - "2130": 7535, - "2135": 7534, - "2140": 7535, - "2145": 7536, - "2150": 7535, - "2155": 7539, - "2160": 7539, - "2165": 7538, - "2170": 7539, - "2175": 7540, - "2180": 7539, - "2185": 7541, - "2190": 7540, - "2195": 7540, - "2200": 7547, - "2205": 7547, - "2210": 7549, - "2215": 7549, - "2220": 7549, - "2225": 7549, - "2230": 7550, - "2235": 7549, - "2240": 7549, - "2245": 7550, - "2250": 7550, - "2255": 7551, - "2260": 7550, - "2265": 7550, - "2270": 7551, - "2275": 7550, - "2280": 7550, - "2285": 7550, - "2290": 7552, - "2295": 7552, - "2300": 7553, - "2305": 7554, - "2310": 7555, - "2315": 7557, - "2320": 7557, - "2325": 7553, - "2330": 7554, - "2335": 7555, - "2340": 7555, - "2345": 7556, - "2350": 7558, - "2355": 7558, - "2360": 7558, - "2365": 7557, - "2370": 7557, - "2375": 7554, - "2380": 7554, - "2385": 7552, - "2390": 7551, - "2395": 7551, - "2400": 7551, - "2405": 7551, - "2410": 7551, - "2415": 7550, - "2420": 7552, - "2425": 7550, - "2430": 7550, - "2435": 7550, - "2440": 7550, - "2445": 7550, - "2450": 7551, - "2455": 7552, - "2460": 7554, - "2465": 7555, - "2470": 7557, - "2475": 7557, - "2480": 7556, - "2485": 7555, - "2490": 7554, - "2495": 7556, - "2500": 7556, - "2505": 7554, - "2510": 7556, - "2515": 7555, - "2520": 7551, - "2525": 7553, - "2530": 7553, - "2535": 7552, - "2540": 7553, - "2545": 7552, - "2550": 7552, - "2555": 7552, - "2560": 7552, - "2565": 7556, - "2570": 7556, - "2575": 7555, - "2580": 7555, - "2585": 7555, - "2590": 7555, - "2595": 7559, - "2600": 7560, - "2605": 7559, - "2610": 7561, - "2615": 7561, - "2620": 7563, - "2625": 7563, - "2630": 7565, - "2635": 7566, - "2640": 7566, - "2645": 7566, - "2650": 7566, - "2655": 7567, - "2660": 7566, - "2665": 7564, - "2670": 7567, - "2675": 7566, - "2680": 7566, - "2685": 7569, - "2690": 7568, - "2695": 7568, - "2700": 7566, - "2705": 7567, - "2710": 7566, - "2715": 7567, - "2720": 7564, - "2725": 7563, - "2730": 7563, - "2735": 7564, - "2740": 7563, - "2745": 7560, - "2750": 7561, - "2755": 7560, - "2760": 7563, - "2765": 7561, - "2770": 7566, - "2775": 7563, - "2780": 7565, - "2785": 7565, - "2790": 7567, - "2795": 7565, - "2800": 7566, - "2805": 7567, - "2810": 7566, - "2815": 7570, - "2820": 7570, - "2825": 7567, - "2830": 7569, - "2835": 7569, - "2840": 7566, - "2845": 7565, - "2850": 7565, - "2855": 7565, - "2860": 7564, - "2865": 7565, - "2870": 7564, - "2875": 7564, - "2880": 7564, - "2885": 7564, - "2890": 7563, - "2895": 7561, - "2900": 7563, - "2905": 7563, - "2910": 7561, - "2915": 7563, - "2920": 7563, - "2925": 7563, - "2930": 7563, - "2935": 7563, - "2940": 7563, - "2945": 7563, - "2950": 7561, - "2955": 7562, - "2960": 7563, - "2965": 7563, - "2970": 7566, - "2975": 7567, - "2980": 7567, - "2985": 7568, - "2990": 7567, - "2995": 7568, - "3000": 7568, - "3005": 7570, - "3010": 7568, - "3015": 7569, - "3020": 7569, - "3025": 7568, - "3030": 7568, - "3035": 7569, - "3040": 7568, - "3045": 7569, - "3050": 7569, - "3055": 7569, - "3060": 7569, - "3065": 7569, - "3070": 7568, - "3075": 7568, - "3080": 7565, - "3085": 7561, - "3090": 7565, - "3095": 7563, - "3100": 7564, - "3105": 7563, - "3110": 7565, - "3115": 7563, - "3120": 7565, - "3125": 7565, - "3130": 7565, - "3135": 7566, - "3140": 7566, - "3145": 7568, - "3150": 7568, - "3155": 7568, - "3160": 7571, - "3165": 7571, - "3170": 7571, - "3175": 7572, - "3180": 7572, - "3185": 7572, - "3190": 7571, - "3195": 7572, - "3200": 7571, - "3205": 7573, - "3210": 7574, - "3215": 7571, - "3220": 7572, - "3225": 7574, - "3230": 7573, - "3235": 7573, - "3240": 7573, - "3245": 7570, - "3250": 7570, - "3255": 7570, - "3260": 7570, - "3265": 7570, - "3270": 7569, - "3275": 7570, - "3280": 7569, - "3285": 7569, - "3290": 7568, - "3295": 7569, - "3300": 7569, - "3305": 7569, - "3310": 7569, - "3315": 7569, - "3320": 7573, - "3325": 7573, - "3330": 7574, - "3335": 7575, - "3340": 7574, - "3345": 7573, - "3350": 7573, - "3355": 7574, - "3360": 7573, - "3365": 7572, - "3370": 7573, - "3375": 7572, - "3380": 7573, - "3385": 7572, - "3390": 7573, - "3395": 7574, - "3400": 7574, - "3405": 7570, - "3410": 7570, - "3415": 7569, - "3420": 7568, - "3425": 7569, - "3430": 7569, - "3435": 7569, - "3440": 7569, - "3445": 7570, - "3450": 7569, - "3455": 7568, - "3460": 7569, - "3465": 7569, - "3470": 7569, - "3475": 7569, - "3480": 7571, - "3485": 7569, - "3490": 7572, - "3495": 7575, - "3500": 7574, - "3505": 7574, - "3510": 7574, - "3515": 7574, - "3520": 7575, - "3525": 7576, - "3530": 7575, - "3535": 7575, - "3540": 7576, - "3545": 7576, - "3550": 7575, - "3555": 7576, - "3560": 7575, - "3565": 7576, - "3570": 7573, - "3575": 7570, - "3580": 7570, - "3585": 7573, - "3590": 7570, - "3595": 7571, - "3600": 7571, - "3605": 7570, - "3610": 7571, - "3615": 7571, - "3620": 7571, - "3625": 7571, - "3630": 7574, - "3635": 7576, - "3640": 7575, - "3645": 7575, - "3650": 7575, - "3655": 7578, - "3660": 7576, - "3665": 7576, - "3670": 7582, - "3675": 7582, - "3680": 7581, - "3685": 7580, - "3690": 7581, - "3695": 7580, - "3700": 7592, - "3705": 7597, - "3710": 7595, - "3715": 7595, - "3720": 7597, - "3725": 7595, - "3730": 7595, - "3735": 7595, - "3740": 7597, - "3745": 7597, - "3750": 7597, - "3755": 7604, - "3760": 7605, - "3765": 7607, - "3770": 7602, - "3775": 7602, - "3780": 7602, - "3785": 7595, - "3790": 7595, - "3795": 7592, - "3800": 7592, - "3805": 7599, - "3810": 7599, - "3815": 7599, - "3820": 7599, - "3825": 7603, - "3830": 7606, - "3835": 7603, - "3840": 7603, - "3845": 7603, - "3850": 7600, - "3855": 7603, - "3860": 7603, - "3865": 7600, - "3870": 7603, - "3875": 7600, - "3880": 7602, - "3885": 7605, - "3890": 7603, - "3895": 7605, - "3900": 7603, - "3905": 7603, - "3910": 7604, - "3915": 7604, - "3920": 7602, - "3925": 7602, - "3930": 7598, - "3935": 7600, - "3940": 7601, - "3945": 7600, - "3950": 7600, - "3955": 7600, - "3960": 7598, - "3965": 7598, - "3970": 7595, - "3975": 7592, - "3980": 7593, - "3985": 7593, - "3990": 7592, - "3995": 7591, - "4000": 7591, - "4005": 7589, - "4010": 7592, - "4015": 7592, - "4020": 7594, - "4025": 7595, - "4030": 7596, - "4035": 7599, - "4040": 7600, - "4045": 7600, - "4050": 7608, - "4055": 7602, - "4060": 7603, - "4065": 7604, - "4070": 7605, - "4075": 7604, - "4080": 7599, - "4085": 7600, - "4090": 7600, - "4095": 7600, - "4100": 7600, - "4105": 7600, - "4110": 7596, - "4115": 7595, - "4120": 7596, - "4125": 7596, - "4130": 7595, - "4135": 7596, - "4140": 7596, - "4145": 7596, - "4150": 7598, - "4155": 7597, - "4160": 7596, - "4165": 7596, - "4170": 7596, - "4175": 7598, - "4180": 7598, - "4185": 7598, - "4190": 7597, - "4195": 7598, - "4200": 7596, - "4205": 7596, - "4210": 7594, - "4215": 7596, - "4220": 7593, - "4225": 7590, - "4230": 7591, - "4235": 7591, - "4240": 7592, - "4245": 7592, - "4250": 7594, - "4255": 7592, - "4260": 7594, - "4265": 7594, - "4270": 7593, - "4275": 7594, - "4280": 7594, - "4285": 7594, - "4290": 7595, - "4295": 7595, - "4300": 7594, - "4305": 7594, - "4310": 7600, - "4315": 7601, - "4320": 7594, - "4325": 7600, - "4330": 7601, - "4335": 7599, - "4340": 7600, - "4345": 7598, - "4350": 7598, - "4355": 7598, - "4360": 7595, - "4365": 7597, - "4370": 7598, - "4375": 7595, - "4380": 7593, - "4385": 7595, - "4390": 7593, - "4395": 7591, - "4400": 7595, - "4405": 7591, - "4410": 7592, - "4415": 7591, - "4420": 7589, - "4425": 7589, - "4430": 7589, - "4435": 7589, - "4440": 7589, - "4445": 7589, - "4450": 7588, - "4455": 7586, - "4460": 7587, - "4465": 7587, - "4470": 7587, - "4475": 7586, - "4480": 7587, - "4485": 7585, - "4490": 7584, - "4495": 7584, - "4500": 7584, - "4505": 7582, - "4510": 7582, - "4515": 7584, - "4520": 7586, - "4525": 7586, - "4530": 7588, - "4535": 7586, - "4540": 7584, - "4545": 7588, - "4550": 7589, - "4555": 7589, - "4560": 7589, - "4565": 7587, - "4570": 7589, - "4575": 7584, - "4580": 7581, - "4585": 7579, - "4590": 7582, - "4595": 7580, - "4600": 7582, - "4605": 7580, - "4610": 7578, - "4615": 7577, - "4620": 7578, - "4625": 7577, - "4630": 7578, - "4635": 7576, - "4640": 7578, - "4645": 7578, - "4650": 7573, - "4655": 7578, - "4660": 7576, - "4665": 7574, - "4670": 7574, - "4675": 7575, - "4680": 7574, - "4685": 7575, - "4690": 7574, - "4695": 7575, - "4700": 7578, - "4705": 7578, - "4710": 7575, - "4715": 7587, - "4720": 7588, - "4725": 7584, - "4730": 7584, - "4735": 7583, - "4740": 7583, - "4745": 7583, - "4750": 7584, - "4755": 7584, - "4760": 7583, - "4765": 7579, - "4770": 7580, - "4775": 7580, - "4780": 7580, - "4785": 7581, - "4790": 7581, - "4795": 7580, - "4800": 7581, - "4805": 7581, - "4810": 7580, - "4815": 7584, - "4820": 7581, - "4825": 7583, - "4830": 7586, - "4835": 7583, - "4840": 7588, - "4845": 7588, - "4850": 7591, - "4855": 7593, - "4860": 7593, - "4865": 7593, - "4870": 7593, - "4875": 7593, - "4880": 7596, - "4885": 7596, - "4890": 7598, - "4895": 7598, - "4900": 7600, - "4905": 7600, - "4910": 7600, - "4915": 7600, - "4920": 7602, - "4925": 7602, - "4930": 7602, - "4935": 7603, - "4940": 7602, - "4945": 7604, - "4950": 7606, - "4955": 7606, - "4960": 7610, - "4965": 7606, - "4970": 7607, - "4975": 7606, - "4980": 7606, - "4985": 7606, - "4990": 7606, - "4995": 7606, - "5000": 7604, - "5005": 7602, - "5010": 7602, - "5015": 7596, - "5020": 7597, - "5025": 7597, - "5030": 7599, - "5035": 7600, - "5040": 7598, - "5045": 7599, - "5050": 7601, - "5055": 7601, - "5060": 7598, - "5065": 7598, - "5070": 7598, - "5075": 7598, - "5080": 7598, - "5085": 7597, - "5090": 7598, - "5095": 7598, - "5100": 7595, - "5105": 7594, - "5110": 7594, - "5115": 7590, - "5120": 7590, - "5125": 7592, - "5130": 7590, - "5135": 7589, - "5140": 7589, - "5145": 7590, - "5150": 7589, - "5155": 7591, - "5160": 7594, - "5165": 7594, - "5170": 7592, - "5175": 7592, - "5180": 7590, - "5185": 7590, - "5190": 7588, - "5195": 7586, - "5200": 7584, - "5205": 7584, - "5210": 7584, - "5215": 7584, - "5220": 7584, - "5225": 7581, - "5230": 7581, - "5235": 7583, - "5240": 7583, - "5245": 7582, - "5250": 7581, - "5255": 7582, - "5260": 7582, - "5265": 7581, - "5270": 7580, - "5275": 7581, - "5280": 7580, - "5285": 7580, - "5290": 7581, - "5295": 7577, - "5300": 7581, - "5305": 7581, - "5310": 7581, - "5315": 7581, - "5320": 7581, - "5325": 7578, - "5330": 7580, - "5335": 7579, - "5340": 7580, - "5345": 7583, - "5350": 7582, - "5355": 7583, - "5360": 7582, - "5365": 7583, - "5370": 7581, - "5375": 7580, - "5380": 7580, - "5385": 7580, - "5390": 7579, - "5395": 7578, - "5400": 7579, - "5405": 7578, - "5410": 7578, - "5415": 7575, - "5420": 7575, - "5425": 7575, - "5430": 7576, - "5435": 7576, - "5440": 7576, - "5445": 7576, - "5450": 7579, - "5455": 7583, - "5460": 7582, - "5465": 7582, - "5470": 7580, - "5475": 7580, - "5480": 7579, - "5485": 7579, - "5490": 7578, - "5495": 7577, - "5500": 7576, - "5505": 7577, - "5510": 7577, - "5515": 7577, - "5520": 7580, - "5525": 7578, - "5530": 7576, - "5535": 7578, - "5540": 7577, - "5545": 7577, - "5550": 7577, - "5555": 7577, - "5560": 7576, - "5565": 7576, - "5570": 7576, - "5575": 7576, - "5580": 7575, - "5585": 7575, - "5590": 7575, - "5595": 7575, - "5600": 7576, - "5605": 7575, - "5610": 7576, - "5615": 7576, - "5620": 7575, - "5625": 7575, - "5630": 7576, - "5635": 7573, - "5640": 7573, - "5645": 7572, - "5650": 7573, - "5655": 7572, - "5660": 7573, - "5665": 7575, - "5670": 7573, - "5675": 7575, - "5680": 7575, - "5685": 7575, - "5690": 7578, - "5695": 7575, - "5700": 7577, - "5705": 7577, - "5710": 7577, - "5715": 7577, - "5720": 7576, - "5725": 7576, - "5730": 7579, - "5735": 7581, - "5740": 7582, - "5745": 7580, - "5750": 7580, - "5755": 7577, - "5760": 7576, - "5765": 7576, - "5770": 7576, - "5775": 7576, - "5780": 7575, - "5785": 7576, - "5790": 7575, - "5795": 7576, - "5800": 7576, - "5805": 7575, - "5810": 7576, - "5815": 7575, - "5820": 7573, - "5825": 7574, - "5830": 7576, - "5835": 7576, - "5840": 7577, - "5845": 7579, - "5850": 7578, - "5855": 7576, - "5860": 7578, - "5865": 7572, - "5870": 7574, - "5875": 7577, - "5880": 7578, - "5885": 7577, - "5890": 7578, - "5895": 7580, - "5900": 7583, - "5905": 7580, - "5910": 7587, - "5915": 7588, - "5920": 7587, - "5925": 7587, - "5930": 7586, - "5935": 7586, - "5940": 7586, - "5945": 7585, - "5950": 7586, - "5955": 7586, - "5960": 7585, - "5965": 7582, - "5970": 7582, - "5975": 7582, - "5980": 7580, - "5985": 7580, - "5990": 7581, - "5995": 7580, - "6000": 7579, - "6005": 7577, - "6010": 7576, - "6015": 7577, - "6020": 7577, - "6025": 7577, - "6030": 7576, - "6035": 7576, - "6040": 7576, - "6045": 7576, - "6050": 7577, - "6055": 7576, - "6060": 7577, - "6065": 7577, - "6070": 7576, - "6075": 7578, - "6080": 7578, - "6085": 7578, - "6090": 7579, - "6095": 7579, - "6100": 7580, - "6105": 7580, - "6110": 7580, - "6115": 7580, - "6120": 7580, - "6125": 7580, - "6130": 7580, - "6135": 7580, - "6140": 7580, - "6145": 7580, - "6150": 7584, - "6155": 7583, - "6160": 7584, - "6165": 7585, - "6170": 7584, - "6175": 7584, - "6180": 7584, - "6185": 7584, - "6190": 7583, - "6195": 7584, - "6200": 7582, - "6205": 7583, - "6210": 7581, - "6215": 7581, - "6220": 7581, - "6225": 7581, - "6230": 7581, - "6235": 7583, - "6240": 7583, - "6245": 7581, - "6250": 7583, - "6255": 7585, - "6260": 7584, - "6265": 7585, - "6270": 7584, - "6275": 7585, - "6280": 7584, - "6285": 7585, - "6290": 7584, - "6295": 7593, - "6300": 7592, - "6305": 7592, - "6310": 7592, - "6315": 7588, - "6320": 7589, - "6325": 7588, - "6330": 7587, - "6335": 7587, - "6340": 7587, - "6345": 7588, - "6350": 7587, - "6355": 7586, - "6360": 7587, - "6365": 7587, - "6370": 7590, - "6375": 7591, - "6380": 7591, - "6385": 7591, - "6390": 7599, - "6395": 7596, - "6400": 7596, - "6405": 7599, - "6410": 7597, - "6415": 7595, - "6420": 7595, - "6425": 7595, - "6430": 7595, - "6435": 7594, - "6440": 7595, - "6445": 7595, - "6450": 7595, - "6455": 7594, - "6460": 7594, - "6465": 7594, - "6470": 7594, - "6475": 7594, - "6480": 7594, - "6485": 7596, - "6490": 7596, - "6495": 7596, - "6500": 7595, - "6505": 7596, - "6510": 7596, - "6515": 7596, - "6520": 7598, - "6525": 7596, - "6530": 7598, - "6535": 7598, - "6540": 7600, - "6545": 7599, - "6550": 7600, - "6555": 7599, - "6560": 7600, - "6565": 7600, - "6570": 7600, - "6575": 7600, - "6580": 7600, - "6585": 7602, - "6590": 7602, - "6595": 7602, - "6600": 7602, - "6605": 7600, - "6610": 7598, - "6615": 7597, - "6620": 7597, - "6625": 7597, - "6630": 7597, - "6635": 7597, - "6640": 7597, - "6645": 7597, - "6650": 7597, - "6655": 7597, - "6660": 7597, - "6665": 7594, - "6670": 7592, - "6675": 7590, - "6680": 7591, - "6685": 7591, - "6690": 7590, - "6695": 7590, - "6700": 7591, - "6705": 7590, - "6710": 7590, - "6715": 7590, - "6720": 7588, - "6725": 7586, - "6730": 7586, - "6735": 7586, - "6740": 7586, - "6745": 7586, - "6750": 7585, - "6755": 7581, - "6760": 7583, - "6765": 7581, - "6770": 7581, - "6775": 7581, - "6780": 7580, - "6785": 7580, - "6790": 7578, - "6795": 7579, - "6800": 7577, - "6805": 7577, - "6810": 7577, - "6815": 7577, - "6820": 7577, - "6825": 7577, - "6830": 7577, - "6835": 7577, - "6840": 7577, - "6845": 7577, - "6850": 7574, - "6855": 7574, - "6860": 7575, - "6865": 7581, - "6870": 7580, - "6875": 7580, - "6880": 7581, - "6885": 7587, - "6890": 7580, - "6895": 7587, - "6900": 7587, - "6905": 7587, - "6910": 7586, - "6915": 7585, - "6920": 7585, - "6925": 7583, - "6930": 7585, - "6935": 7585, - "6940": 7586, - "6945": 7586, - "6950": 7584, - "6955": 7585, - "6960": 7585, - "6965": 7585, - "6970": 7585, - "6975": 7585, - "6980": 7589, - "6985": 7590, - "6990": 7590, - "6995": 7591, - "7000": 7592, - "7005": 7592, - "7010": 7593, - "7015": 7593, - "7020": 7593, - "7025": 7593, - "7030": 7592, - "7035": 7592, - "7040": 7591, - "7045": 7589, - "7050": 7587, - "7055": 7587, - "7060": 7586, - "7065": 7585, - "7070": 7585, - "7075": 7584, - "7080": 7585, - "7085": 7585, - "7090": 7584, - "7095": 7585, - "7100": 7582, - "7105": 7584, - "7110": 7588, - "7115": 7587, - "7120": 7587, - "7125": 7586, - "7130": 7586, - "7135": 7587, - "7140": 7586, - "7145": 7587, - "7150": 7586, - "7155": 7589, - "7160": 7588, - "7165": 7588, - "7170": 7589, - "7175": 7587, - "7180": 7587, - "7185": 7587, - "7190": 7587, - "7195": 7587, - "7200": 7587, - "7205": 7587, - "7210": 7586, - "7215": 7586, - "7220": 7584, - "7225": 7582, - "7230": 7586, - "7235": 7579, - "7240": 7579, - "7245": 7579, - "7250": 7579, - "7255": 7584, - "7260": 7584, - "7265": 7586, - "7270": 7584, - "7275": 7585, - "7280": 7585, - "7285": 7585, - "7290": 7585, - "7295": 7585, - "7300": 7585, - "7305": 7587, - "7310": 7591, - "7315": 7593, - "7320": 7593, - "7325": 7594, - "7330": 7591, - "7335": 7590, - "7340": 7591, - "7345": 7590, - "7350": 7591, - "7355": 7590, - "7360": 7587, - "7365": 7586, - "7370": 7586, - "7375": 7586, - "7380": 7586, - "7385": 7586, - "7390": 7586, - "7395": 7587, - "7400": 7586, - "7405": 7586, - "7410": 7587, - "7415": 7587, - "7420": 7589, - "7425": 7589, - "7430": 7590, - "7435": 7589, - "7440": 7591, - "7445": 7590, - "7450": 7591, - "7455": 7591, - "7460": 7591, - "7465": 7585, - "7470": 7585, - "7475": 7585, - "7480": 7585, - "7485": 7587, - "7490": 7587, - "7495": 7587, - "7500": 7587, - "7505": 7587, - "7510": 7587, - "7515": 7587, - "7520": 7587, - "7525": 7587, - "7530": 7586, - "7535": 7588, - "7540": 7589, - "7545": 7589, - "7550": 7589, - "7555": 7589, - "7560": 7589, - "7565": 7590, - "7570": 7590, - "7575": 7589, - "7580": 7589, - "7585": 7589, - "7590": 7590, - "7595": 7590, - "7600": 7590, - "7605": 7590, - "7610": 7589, - "7615": 7589, - "7620": 7588, - "7625": 7587, - "7630": 7588, - "7635": 7588, - "7640": 7588, - "7645": 7588, - "7650": 7588, - "7655": 7589, - "7660": 7588, - "7665": 7588, - "7670": 7589, - "7675": 7589, - "7680": 7589, - "7685": 7592, - "7690": 7598, - "7695": 7592, - "7700": 7597, - "7705": 7595, - "7710": 7597, - "7715": 7597, - "7720": 7591, - "7725": 7592, - "7730": 7589, - "7735": 7590, - "7740": 7589, - "7745": 7589, - "7750": 7592, - "7755": 7592, - "7760": 7592, - "7765": 7590, - "7770": 7591, - "7775": 7592, - "7780": 7590, - "7785": 7590, - "7790": 7590, - "7795": 7590, - "7800": 7590, - "7805": 7590, - "7810": 7590, - "7815": 7590, - "7820": 7590, - "7825": 7590, - "7830": 7590, - "7835": 7589, - "7840": 7590, - "7845": 7589, - "7850": 7588, - "7855": 7586, - "7860": 7585, - "7865": 7585, - "7870": 7584, - "7875": 7585, - "7880": 7585, - "7885": 7588, - "7890": 7588, - "7895": 7588, - "7900": 7588, - "7905": 7588, - "7910": 7588, - "7915": 7588, - "7920": 7588, - "7925": 7588, - "7930": 7588, - "7935": 7588, - "7940": 7588, - "7945": 7588, - "7950": 7589, - "7955": 7590, - "7960": 7590, - "7965": 7590, - "7970": 7589, - "7975": 7589, - "7980": 7589, - "7985": 7588, - "7990": 7587, - "7995": 7584, - "8000": 7583, - "8005": 7584, - "8010": 7583, - "8015": 7583, - "8020": 7583, - "8025": 7583, - "8030": 7582, - "8035": 7582, - "8040": 7580, - "8045": 7580, - "8050": 7580, - "8055": 7580, - "8060": 7580, - "8065": 7580, - "8070": 7580, - "8075": 7580, - "8080": 7579, - "8085": 7580, - "8090": 7579, - "8095": 7581, - "8100": 7580, - "8105": 7582, - "8110": 7581, - "8115": 7581, - "8120": 7582, - "8125": 7583, - "8130": 7582, - "8135": 7582, - "8140": 7582, - "8145": 7582, - "8150": 7581, - "8155": 7582, - "8160": 7582, - "8165": 7579, - "8170": 7579, - "8175": 7579, - "8180": 7580, - "8185": 7580, - "8190": 7579, - "8195": 7580, - "8200": 7579, - "8205": 7580, - "8210": 7580, - "8215": 7580, - "8220": 7580, - "8225": 7580, - "8230": 7579, - "8235": 7579, - "8240": 7579, - "8245": 7579, - "8250": 7581, - "8255": 7581, - "8260": 7581, - "8265": 7581, - "8270": 7585, - "8275": 7585, - "8280": 7584, - "8285": 7584, - "8290": 7583, - "8295": 7584, - "8300": 7583, - "8305": 7584, - "8310": 7584, - "8315": 7584, - "8320": 7584, - "8325": 7584, - "8330": 7584, - "8335": 7584, - "8340": 7585, - "8345": 7584, - "8350": 7585, - "8355": 7584, - "8360": 7585, - "8365": 7585, - "8370": 7585, - "8375": 7585, - "8380": 7585, - "8385": 7585, - "8390": 7586, - "8395": 7584, - "8400": 7583, - "8405": 7583, - "8410": 7582, - "8415": 7581, - "8420": 7583, - "8425": 7581, - "8430": 7578, - "8435": 7578, - "8440": 7578, - "8445": 7579, - "8450": 7578, - "8455": 7579, - "8460": 7579, - "8465": 7578, - "8470": 7579, - "8475": 7578, - "8480": 7578, - "8485": 7577, - "8490": 7577, - "8495": 7576, - "8500": 7576, - "8505": 7576, - "8510": 7576, - "8515": 7576, - "8520": 7575, - "8525": 7574, - "8530": 7573, - "8535": 7573, - "8540": 7567, - "8545": 7569, - "8550": 7574, - "8555": 7573, - "8560": 7574, - "8565": 7573, - "8570": 7574, - "8575": 7570, - "8580": 7574, - "8585": 7566, - "8590": 7566, - "8595": 7565, - "8600": 7565, - "8605": 7563, - "8610": 7569, - "8615": 7569, - "8620": 7567, - "8625": 7567, - "8630": 7567, - "8635": 7568, - "8640": 7568, - "8645": 7568, - "8650": 7568, - "8655": 7570, - "8660": 7570, - "8665": 7570, - "8670": 7569, - "8675": 7570, - "8680": 7570, - "8685": 7570, - "8690": 7570, - "8695": 7570, - "8700": 7570, - "8705": 7570, - "8710": 7569, - "8715": 7570, - "8720": 7569, - "8725": 7570, - "8730": 7568, - "8735": 7568, - "8740": 7570, - "8745": 7569, - "8750": 7570, - "8755": 7569, - "8760": 7570, - "8765": 7570, - "8770": 7570, - "8775": 7569, - "8780": 7571, - "8785": 7574, - "8790": 7572, - "8795": 7573, - "8800": 7574, - "8805": 7572, - "8810": 7572, - "8815": 7572, - "8820": 7570, - "8825": 7571, - "8830": 7570, - "8835": 7570, - "8840": 7570, - "8845": 7570, - "8850": 7572, - "8855": 7570, - "8860": 7571, - "8865": 7572, - "8870": 7571, - "8875": 7571, - "8880": 7570, - "8885": 7570, - "8890": 7570, - "8895": 7569, - "8900": 7570, - "8905": 7568, - "8910": 7568, - "8915": 7568, - "8920": 7569, - "8925": 7570, - "8930": 7570, - "8935": 7569, - "8940": 7570, - "8945": 7570, - "8950": 7570, - "8955": 7570, - "8960": 7570, - "8965": 7569, - "8970": 7569, - "8975": 7569, - "8980": 7568, - "8985": 7568, - "8990": 7568, - "8995": 7568, - "9000": 7567, - "9005": 7568, - "9010": 7567, - "9015": 7568, - "9020": 7568, - "9025": 7568, - "9030": 7567, - "9035": 7567, - "9040": 7568, - "9045": 7567, - "9050": 7567, - "9055": 7567, - "9060": 7568, - "9065": 7572, - "9070": 7572, - "9075": 7574, - "9080": 7573, - "9085": 7571, - "9090": 7574, - "9095": 7571, - "9100": 7571, - "9105": 7571, - "9110": 7571, - "9115": 7570, - "9120": 7571, - "9125": 7570, - "9130": 7570, - "9135": 7569, - "9140": 7571, - "9145": 7571, - "9150": 7571, - "9155": 7571, - "9160": 7572, - "9165": 7571, - "9170": 7572, - "9175": 7572, - "9180": 7572, - "9185": 7575, - "9190": 7577, - "9195": 7577, - "9200": 7575, - "9205": 7576, - "9210": 7575, - "9215": 7578, - "9220": 7579, - "9225": 7578, - "9230": 7580, - "9235": 7580, - "9240": 7580, - "9245": 7580, - "9250": 7579, - "9255": 7579, - "9260": 7579, - "9265": 7579, - "9270": 7577, - "9275": 7578, - "9280": 7577, - "9285": 7576, - "9290": 7576, - "9295": 7574, - "9300": 7573, - "9305": 7572, - "9310": 7573, - "9315": 7573, - "9320": 7573, - "9325": 7573, - "9330": 7573, - "9335": 7573, - "9340": 7573, - "9345": 7573, - "9350": 7573, - "9355": 7573, - "9360": 7573, - "9365": 7573, - "9370": 7573, - "9375": 7573, - "9380": 7573, - "9385": 7576, - "9390": 7575, - "9395": 7576, - "9400": 7577, - "9405": 7576, - "9410": 7576, - "9415": 7576, - "9420": 7576, - "9425": 7576, - "9430": 7577, - "9435": 7577, - "9440": 7577, - "9445": 7578, - "9450": 7577, - "9455": 7577, - "9460": 7578, - "9465": 7577, - "9470": 7578, - "9475": 7577, - "9480": 7577, - "9485": 7577, - "9490": 7578, - "9495": 7577, - "9500": 7577, - "9505": 7577, - "9510": 7576, - "9515": 7574, - "9520": 7574, - "9525": 7573, - "9530": 7573, - "9535": 7573, - "9540": 7574, - "9545": 7574, - "9550": 7575, - "9555": 7576, - "9560": 7575, - "9565": 7575, - "9570": 7573, - "9575": 7574, - "9580": 7573, - "9585": 7572, - "9590": 7573, - "9595": 7572, - "9600": 7573, - "9605": 7573, - "9610": 7573, - "9615": 7572, - "9620": 7572, - "9625": 7572, - "9630": 7572, - "9635": 7572, - "9640": 7572, - "9645": 7570, - "9650": 7569, - "9655": 7569, - "9660": 7568, - "9665": 7569, - "9670": 7569, - "9675": 7569, - "9680": 7569, - "9685": 7569, - "9690": 7569, - "9695": 7571, - "9700": 7571, - "9705": 7574, - "9710": 7575, - "9715": 7576, - "9720": 7574, - "9725": 7576, - "9730": 7575, - "9735": 7576, - "9740": 7575, - "9745": 7575, - "9750": 7575, - "9755": 7575, - "9760": 7576, - "9765": 7576, - "9770": 7576, - "9775": 7576, - "9780": 7576, - "9785": 7575, - "9790": 7575, - "9795": 7575, - "9800": 7575, - "9805": 7574, - "9810": 7575, - "9815": 7575, - "9820": 7576, - "9825": 7576, - "9830": 7577, - "9835": 7577, - "9840": 7577, - "9845": 7577, - "9850": 7577, - "9855": 7576, - "9860": 7578, - "9865": 7581, - "9870": 7582, - "9875": 7582, - "9880": 7582, - "9885": 7581, - "9890": 7578, - "9895": 7578, - "9900": 7577, - "9905": 7578, - "9910": 7582, - "9915": 7582, - "9920": 7584, - "9925": 7582, - "9930": 7583, - "9935": 7582, - "9940": 7583, - "9945": 7584, - "9950": 7584, - "9955": 7585, - "9960": 7587, - "9965": 7588, - "9970": 7589, - "9975": 7589, - "9980": 7585, - "9985": 7586, - "9990": 7584, - "9995": 7585, - "10000": 7585, - "10005": 7585, - "10010": 7586, - "10015": 7588, - "10020": 7586, - "10025": 7586, - "10030": 7587, - "10035": 7586, - "10040": 7586, - "10045": 7586, - "10050": 7587, - "10055": 7586, - "10060": 7586, - "10065": 7584, - "10070": 7586, - "10075": 7585, - "10080": 7583, - "10085": 7584, - "10090": 7584, - "10095": 7584, - "10100": 7584, - "10105": 7584, - "10110": 7584, - "10115": 7584, - "10120": 7584, - "10125": 7584, - "10130": 7584, - "10135": 7587, - "10140": 7584, - "10145": 7588, - "10150": 7588, - "10155": 7587, - "10160": 7587, - "10165": 7587, - "10170": 7584, - "10175": 7585, - "10180": 7587, - "10185": 7584, - "10190": 7584, - "10195": 7587, - "10200": 7586, - "10205": 7584, - "10210": 7586, - "10215": 7584, - "10220": 7584, - "10225": 7583, - "10230": 7584, - "10235": 7584, - "10240": 7584, - "10245": 7584, - "10250": 7584, - "10255": 7583, - "10260": 7582, - "10265": 7581, - "10270": 7582, - "10275": 7584, - "10280": 7583, - "10285": 7584, - "10290": 7583, - "10295": 7584, - "10300": 7583, - "10305": 7583, - "10310": 7583, - "10315": 7583, - "10320": 7583, - "10325": 7583, - "10330": 7583, - "10335": 7583, - "10340": 7582, - "10345": 7582, - "10350": 7583, - "10355": 7584, - "10360": 7583, - "10365": 7583, - "10370": 7583, - "10375": 7582, - "10380": 7582, - "10385": 7582, - "10390": 7579, - "10395": 7580, - "10400": 7583, - "10405": 7583, - "10410": 7583, - "10415": 7583, - "10420": 7583, - "10425": 7583, - "10430": 7583, - "10435": 7583, - "10440": 7583, - "10445": 7583, - "10450": 7583, - "10455": 7583, - "10460": 7582, - "10465": 7582, - "10470": 7579, - "10475": 7576, - "10480": 7576, - "10485": 7577, - "10490": 7577, - "10495": 7577, - "10500": 7577, - "10505": 7577, - "10510": 7578, - "10515": 7578, - "10520": 7579, - "10525": 7579, - "10530": 7580, - "10535": 7579, - "10540": 7578, - "10545": 7578, - "10550": 7579, - "10555": 7579, - "10560": 7579, - "10565": 7579, - "10570": 7579, - "10575": 7579, - "10580": 7579, - "10585": 7576, - "10590": 7576, - "10595": 7576, - "10600": 7577, - "10605": 7579, - "10610": 7579, - "10615": 7579, - "10620": 7576, - "10625": 7576, - "10630": 7576, - "10635": 7576, - "10640": 7576, - "10645": 7576, - "10650": 7576, - "10655": 7576, - "10660": 7576, - "10665": 7576, - "10670": 7576, - "10675": 7576, - "10680": 7576, - "10685": 7576, - "10690": 7576, - "10695": 7576, - "10700": 7576, - "10705": 7576, - "10710": 7576, - "10715": 7575, - "10720": 7576, - "10725": 7576, - "10730": 7577, - "10735": 7575, - "10740": 7576, - "10745": 7575, - "10750": 7576, - "10755": 7575, - "10760": 7575, - "10765": 7577, - "10770": 7579, - "10775": 7582, - "10780": 7582, - "10785": 7579, - "10790": 7582, - "10795": 7580, - "10800": 7579, - "10805": 7580, - "10810": 7580, - "10815": 7579, - "10820": 7579, - "10825": 7580, - "10830": 7584, - "10835": 7584, - "10840": 7586, - "10845": 7587, - "10850": 7588, - "10855": 7587, - "10860": 7588, - "10865": 7588, - "10870": 7585, - "10875": 7583, - "10880": 7582, - "10885": 7583, - "10890": 7582, - "10895": 7581, - "10900": 7581, - "10905": 7588, - "10910": 7587, - "10915": 7587, - "10920": 7588, - "10925": 7587, - "10930": 7588, - "10935": 7588, - "10940": 7588, - "10945": 7588, - "10950": 7590, - "10955": 7590, - "10960": 7592, - "10965": 7595, - "10970": 7595, - "10975": 7596, - "10980": 7595, - "10985": 7596, - "10990": 7596, - "10995": 7596, - "11000": 7594, - "11005": 7594, - "11010": 7592, - "11015": 7591, - "11020": 7590, - "11025": 7590, - "11030": 7590, - "11035": 7591, - "11040": 7593, - "11045": 7594, - "11050": 7595, - "11055": 7595, - "11060": 7595, - "11065": 7595, - "11070": 7597, - "11075": 7597, - "11080": 7597, - "11085": 7597, - "11090": 7597, - "11095": 7596, - "11100": 7597, - "11105": 7597, - "11110": 7599, - "11115": 7597, - "11120": 7597, - "11125": 7597, - "11130": 7597, - "11135": 7597, - "11140": 7599, - "11145": 7598, - "11150": 7600, - "11155": 7598, - "11160": 7599, - "11165": 7600, - "11170": 7603, - "11175": 7605, - "11180": 7608, - "11185": 7605, - "11190": 7612, - "11195": 7608, - "11200": 7612, - "11205": 7611, - "11210": 7610, - "11215": 7612, - "11220": 7609, - "11225": 7607, - "11230": 7607, - "11235": 7607, - "11240": 7601, - "11245": 7602, - "11250": 7602, - "11255": 7605, - "11260": 7605, - "11265": 7604, - "11270": 7605, - "11275": 7604, - "11280": 7608, - "11285": 7612, - "11290": 7612, - "11295": 7606, - "11300": 7608, - "11305": 7606, - "11310": 7607, - "11315": 7604, - "11320": 7604, - "11325": 7604, - "11330": 7604, - "11335": 7604, - "11340": 7604, - "11345": 7605, - "11350": 7605, - "11355": 7607, - "11360": 7608, - "11365": 7609, - "11370": 7609, - "11375": 7609, - "11380": 7609, - "11385": 7610, - "11390": 7615, - "11395": 7614, - "11400": 7610, - "11405": 7613, - "11410": 7614, - "11415": 7615, - "11420": 7614, - "11425": 7614, - "11430": 7614, - "11435": 7614, - "11440": 7613, - "11445": 7611, - "11450": 7608, - "11455": 7605, - "11460": 7605, - "11465": 7605, - "11470": 7606, - "11475": 7606, - "11480": 7606, - "11485": 7606, - "11490": 7607, - "11495": 7607, - "11500": 7608, - "11505": 7608, - "11510": 7607, - "11515": 7608, - "11520": 7608, - "11525": 7609, - "11530": 7610, - "11535": 7610, - "11540": 7609, - "11545": 7608, - "11550": 7610, - "11555": 7608, - "11560": 7607, - "11565": 7606, - "11570": 7606, - "11575": 7607, - "11580": 7606, - "11585": 7605, - "11590": 7606, - "11595": 7604, - "11600": 7604, - "11605": 7604, - "11610": 7605, - "11615": 7605, - "11620": 7606, - "11625": 7606, - "11630": 7608, - "11635": 7608, - "11640": 7606, - "11645": 7608, - "11650": 7608, - "11655": 7608, - "11660": 7608, - "11665": 7608, - "11670": 7613, - "11675": 7612, - "11680": 7611, - "11685": 7611, - "11690": 7613, - "11695": 7613, - "11700": 7611, - "11705": 7614, - "11710": 7613, - "11715": 7613, - "11720": 7613, - "11725": 7614, - "11730": 7614, - "11735": 7615, - "11740": 7614, - "11745": 7616, - "11750": 7616, - "11755": 7618, - "11760": 7621, - "11765": 7621, - "11770": 7618, - "11775": 7620, - "11780": 7620, - "11785": 7623, - "11790": 7624, - "11795": 7624, - "11800": 7620, - "11805": 7619, - "11810": 7616, - "11815": 7616, - "11820": 7616, - "11825": 7617, - "11830": 7616, - "11835": 7617, - "11840": 7615, - "11845": 7617, - "11850": 7615, - "11855": 7613, - "11860": 7616, - "11865": 7613, - "11870": 7616, - "11875": 7616, - "11880": 7617, - "11885": 7621, - "11890": 7620, - "11895": 7622, - "11900": 7622, - "11905": 7622, - "11910": 7622, - "11915": 7622, - "11920": 7622, - "11925": 7623, - "11930": 7621, - "11935": 7620, - "11940": 7617, - "11945": 7617, - "11950": 7620, - "11955": 7617, - "11960": 7616, - "11965": 7616, - "11970": 7616, - "11975": 7610, - "11980": 7616, - "11985": 7607, - "11990": 7610, - "11995": 7606, - "12000": 7606, - "12005": 7604, - "12010": 7602, - "12015": 7603, - "12020": 7603, - "12025": 7601, - "12030": 7603, - "12035": 7606, - "12040": 7610, - "12045": 7610, - "12050": 7609, - "12055": 7605, - "12060": 7604, - "12065": 7601, - "12070": 7603, - "12075": 7604, - "12080": 7602, - "12085": 7601, - "12090": 7601, - "12095": 7604, - "12100": 7604, - "12105": 7604, - "12110": 7604, - "12115": 7604, - "12120": 7604, - "12125": 7605, - "12130": 7604, - "12135": 7604, - "12140": 7606, - "12145": 7607, - "12150": 7607, - "12155": 7602, - "12160": 7603, - "12165": 7602, - "12170": 7601, - "12175": 7602, - "12180": 7601, - "12185": 7602, - "12190": 7601, - "12195": 7601, - "12200": 7601, - "12205": 7599, - "12210": 7597, - "12215": 7597, - "12220": 7594, - "12225": 7596, - "12230": 7594, - "12235": 7594, - "12240": 7593, - "12245": 7594, - "12250": 7594, - "12255": 7595, - "12260": 7596, - "12265": 7596, - "12270": 7595, - "12275": 7595, - "12280": 7595, - "12285": 7595, - "12290": 7595, - "12295": 7596, - "12300": 7596, - "12305": 7597, - "12310": 7598, - "12315": 7598, - "12320": 7598, - "12325": 7596, - "12330": 7595, - "12335": 7594, - "12340": 7596, - "12345": 7593, - "12350": 7594, - "12355": 7593, - "12360": 7593, - "12365": 7594, - "12370": 7595, - "12375": 7594, - "12380": 7594, - "12385": 7594, - "12390": 7595, - "12395": 7594, - "12400": 7594, - "12405": 7594, - "12410": 7594, - "12415": 7594, - "12420": 7595, - "12425": 7594, - "12430": 7597, - "12435": 7596, - "12440": 7600, - "12445": 7600, - "12450": 7599, - "12455": 7599, - "12460": 7599, - "12465": 7599, - "12470": 7594, - "12475": 7594, - "12480": 7594, - "12485": 7594, - "12490": 7593, - "12495": 7594, - "12500": 7594, - "12505": 7594, - "12510": 7593, - "12515": 7593, - "12520": 7594, - "12525": 7594, - "12530": 7594, - "12535": 7594, - "12540": 7593, - "12545": 7594, - "12550": 7592, - "12555": 7593, - "12560": 7591, - "12565": 7586, - "12570": 7586, - "12575": 7586, - "12580": 7587, - "12585": 7588, - "12590": 7592, - "12595": 7592, - "12600": 7590, - "12605": 7592, - "12610": 7591, - "12615": 7588, - "12620": 7591, - "12625": 7591, - "12630": 7593, - "12635": 7593, - "12640": 7593, - "12645": 7592, - "12650": 7590, - "12655": 7589, - "12660": 7590, - "12665": 7589, - "12670": 7590, - "12675": 7589, - "12680": 7590, - "12685": 7589, - "12690": 7588, - "12695": 7588, - "12700": 7586, - "12705": 7586, - "12710": 7587, - "12715": 7587, - "12720": 7587, - "12725": 7586, - "12730": 7587, - "12735": 7587, - "12740": 7587, - "12745": 7584, - "12750": 7587, - "12755": 7583, - "12760": 7586, - "12765": 7584, - "12770": 7585, - "12775": 7585, - "12780": 7585, - "12785": 7584, - "12790": 7585, - "12795": 7584, - "12800": 7585, - "12805": 7584, - "12810": 7584, - "12815": 7588, - "12820": 7587, - "12825": 7588, - "12830": 7587, - "12835": 7587, - "12840": 7586, - "12845": 7586, - "12850": 7585, - "12855": 7585, - "12860": 7585, - "12865": 7585, - "12870": 7587, - "12875": 7588, - "12880": 7587, - "12885": 7587, - "12890": 7588, - "12895": 7588, - "12900": 7588, - "12905": 7588, - "12910": 7589, - "12915": 7588, - "12920": 7589, - "12925": 7588, - "12930": 7589, - "12935": 7589, - "12940": 7589, - "12945": 7591, - "12950": 7589, - "12955": 7589, - "12960": 7589, - "12965": 7590, - "12970": 7589, - "12975": 7589, - "12980": 7589, - "12985": 7589, - "12990": 7589, - "12995": 7590, - "13000": 7590, - "13005": 7590, - "13010": 7590, - "13015": 7590, - "13020": 7590, - "13025": 7590, - "13030": 7590, - "13035": 7590, - "13040": 7590, - "13045": 7591, - "13050": 7591, - "13055": 7590, - "13060": 7591, - "13065": 7591, - "13070": 7591, - "13075": 7592, - "13080": 7592, - "13085": 7592, - "13090": 7592, - "13095": 7592, - "13100": 7595, - "13105": 7592, - "13110": 7592, - "13115": 7595, - "13120": 7595, - "13125": 7597, - "13130": 7598, - "13135": 7599, - "13140": 7597, - "13145": 7598, - "13150": 7598, - "13155": 7602, - "13160": 7608 -} diff --git a/ts-simulation/client/config/example-price-feeds/shibusdt.json b/ts-simulation/client/config/example-price-feeds/shibusdt.json deleted file mode 100644 index 960c33d..0000000 --- a/ts-simulation/client/config/example-price-feeds/shibusdt.json +++ /dev/null @@ -1,502 +0,0 @@ -{ - "0": 0.0000302, - "5": 0.00003018, - "10": 0.00003019, - "15": 0.00003019, - "20": 0.00003017, - "25": 0.0000302, - "30": 0.0000302, - "35": 0.00003019, - "40": 0.00003018, - "45": 0.00003018, - "50": 0.00003017, - "55": 0.0000302, - "60": 0.0000302, - "65": 0.0000302, - "70": 0.00003022, - "75": 0.00003021, - "80": 0.0000302, - "85": 0.00003022, - "90": 0.00003021, - "95": 0.00003023, - "100": 0.00003024, - "105": 0.00003025, - "110": 0.00003026, - "115": 0.00003025, - "120": 0.00003027, - "125": 0.00003026, - "130": 0.00003026, - "135": 0.00003027, - "140": 0.00003028, - "145": 0.00003026, - "150": 0.00003028, - "155": 0.00003028, - "160": 0.0000303, - "165": 0.00003031, - "170": 0.00003031, - "175": 0.00003028, - "180": 0.00003027, - "185": 0.00003025, - "190": 0.00003024, - "195": 0.00003022, - "200": 0.00003022, - "205": 0.0000302, - "210": 0.0000302, - "215": 0.00003024, - "220": 0.00003022, - "225": 0.0000302, - "230": 0.00003023, - "235": 0.00003019, - "240": 0.00003018, - "245": 0.00003018, - "250": 0.00003019, - "255": 0.00003017, - "260": 0.00003018, - "265": 0.00003015, - "270": 0.00003017, - "275": 0.00003014, - "280": 0.00003012, - "285": 0.00003016, - "290": 0.0000302, - "295": 0.00003019, - "300": 0.0000302, - "305": 0.00003018, - "310": 0.00003019, - "315": 0.00003018, - "320": 0.00003017, - "325": 0.00003016, - "330": 0.00003013, - "335": 0.00003015, - "340": 0.00003014, - "345": 0.00003013, - "350": 0.00003012, - "355": 0.00003012, - "360": 0.0000301, - "365": 0.00003009, - "370": 0.00003009, - "375": 0.0000301, - "380": 0.00003009, - "385": 0.00003008, - "390": 0.00003008, - "395": 0.00003007, - "400": 0.00003007, - "405": 0.00003008, - "410": 0.00003008, - "415": 0.00003008, - "420": 0.00003008, - "425": 0.00003011, - "430": 0.00003015, - "435": 0.00003013, - "440": 0.0000301, - "445": 0.00003012, - "450": 0.00003009, - "455": 0.00003007, - "460": 0.0000301, - "465": 0.00003008, - "470": 0.00003012, - "475": 0.00003011, - "480": 0.00003012, - "485": 0.0000301, - "490": 0.00003013, - "495": 0.00003012, - "500": 0.0000301, - "505": 0.00003012, - "510": 0.00003011, - "515": 0.00003014, - "520": 0.00003019, - "525": 0.00003018, - "530": 0.0000302, - "535": 0.00003023, - "540": 0.00003023, - "545": 0.00003027, - "550": 0.0000303, - "555": 0.0000303, - "560": 0.00003028, - "565": 0.00003024, - "570": 0.00003026, - "575": 0.00003026, - "580": 0.00003026, - "585": 0.00003026, - "590": 0.00003027, - "595": 0.00003025, - "600": 0.00003021, - "605": 0.00003019, - "610": 0.00003019, - "615": 0.00003018, - "620": 0.00003017, - "625": 0.00003016, - "630": 0.00003016, - "635": 0.00003016, - "640": 0.00003015, - "645": 0.00003017, - "650": 0.00003016, - "655": 0.00003015, - "660": 0.00003015, - "665": 0.00003015, - "670": 0.00003017, - "675": 0.00003015, - "680": 0.00003015, - "685": 0.00003014, - "690": 0.00003013, - "695": 0.00003013, - "700": 0.00003012, - "705": 0.0000301, - "710": 0.0000301, - "715": 0.00003011, - "720": 0.00003008, - "725": 0.00003009, - "730": 0.00003009, - "735": 0.00003009, - "740": 0.00003011, - "745": 0.00003013, - "750": 0.00003012, - "755": 0.0000301, - "760": 0.00003009, - "765": 0.00003008, - "770": 0.00003006, - "775": 0.00003004, - "780": 0.00003003, - "785": 0.00003004, - "790": 0.00003005, - "795": 0.00003005, - "800": 0.00003002, - "805": 0.00003002, - "810": 0.00003002, - "815": 0.00003002, - "820": 0.00003002, - "825": 0.00003003, - "830": 0.00003, - "835": 0.00003, - "840": 0.00003003, - "845": 0.00003003, - "850": 0.00003003, - "855": 0.00003007, - "860": 0.00003007, - "865": 0.00003007, - "870": 0.00003005, - "875": 0.00003006, - "880": 0.00003006, - "885": 0.00003004, - "890": 0.00003004, - "895": 0.00003005, - "900": 0.00003006, - "905": 0.00003008, - "910": 0.00003008, - "915": 0.00003007, - "920": 0.00003008, - "925": 0.00003011, - "930": 0.0000301, - "935": 0.0000301, - "940": 0.00003009, - "945": 0.00003009, - "950": 0.00003007, - "955": 0.00003008, - "960": 0.00003008, - "965": 0.00003011, - "970": 0.0000301, - "975": 0.00003011, - "980": 0.00003012, - "985": 0.00003012, - "990": 0.00003011, - "995": 0.0000301, - "1000": 0.00003008, - "1005": 0.00003008, - "1010": 0.00003007, - "1015": 0.00003005, - "1020": 0.00003005, - "1025": 0.00003005, - "1030": 0.00003002, - "1035": 0.00003002, - "1040": 0.00003003, - "1045": 0.00003003, - "1050": 0.00003003, - "1055": 0.00003001, - "1060": 0.00003002, - "1065": 0.00003003, - "1070": 0.00003001, - "1075": 0.00003002, - "1080": 0.00003, - "1085": 0.00002999, - "1090": 0.00003002, - "1095": 0.00003004, - "1100": 0.00003001, - "1105": 0.00003002, - "1110": 0.00003003, - "1115": 0.00003005, - "1120": 0.00003006, - "1125": 0.00003007, - "1130": 0.00003005, - "1135": 0.00003004, - "1140": 0.00003005, - "1145": 0.00003003, - "1150": 0.00003007, - "1155": 0.00003009, - "1160": 0.00003009, - "1165": 0.00003009, - "1170": 0.00003005, - "1175": 0.00003006, - "1180": 0.00003005, - "1185": 0.00003004, - "1190": 0.00003004, - "1195": 0.00003003, - "1200": 0.00003002, - "1205": 0.00003003, - "1210": 0.00003002, - "1215": 0.00003002, - "1220": 0.00003003, - "1225": 0.00003, - "1230": 0.00003002, - "1235": 0.00003002, - "1240": 0.00003001, - "1245": 0.00003001, - "1250": 0.00003, - "1255": 0.00002999, - "1260": 0.00002998, - "1265": 0.00002998, - "1270": 0.00002997, - "1275": 0.00002997, - "1280": 0.00002992, - "1285": 0.00002991, - "1290": 0.00002991, - "1295": 0.00002989, - "1300": 0.00002987, - "1305": 0.00002984, - "1310": 0.00002989, - "1315": 0.00002988, - "1320": 0.00002988, - "1325": 0.00002988, - "1330": 0.00002991, - "1335": 0.00002994, - "1340": 0.00002999, - "1345": 0.00003003, - "1350": 0.00003006, - "1355": 0.00003006, - "1360": 0.00003004, - "1365": 0.00003003, - "1370": 0.00003001, - "1375": 0.00003001, - "1380": 0.00002997, - "1385": 0.00002998, - "1390": 0.00003, - "1395": 0.00003002, - "1400": 0.00003002, - "1405": 0.00003002, - "1410": 0.00003003, - "1415": 0.00003, - "1420": 0.00003, - "1425": 0.00003004, - "1430": 0.00003003, - "1435": 0.00003005, - "1440": 0.00003005, - "1445": 0.00003003, - "1450": 0.00003002, - "1455": 0.00003002, - "1460": 0.00003, - "1465": 0.00003, - "1470": 0.00003, - "1475": 0.00002999, - "1480": 0.00003, - "1485": 0.00003001, - "1490": 0.00003005, - "1495": 0.00003006, - "1500": 0.00003008, - "1505": 0.00003009, - "1510": 0.00003008, - "1515": 0.00003009, - "1520": 0.00003013, - "1525": 0.00003015, - "1530": 0.00003015, - "1535": 0.00003018, - "1540": 0.00003019, - "1545": 0.00003019, - "1550": 0.00003016, - "1555": 0.00003016, - "1560": 0.00003017, - "1565": 0.00003018, - "1570": 0.00003017, - "1575": 0.00003017, - "1580": 0.00003017, - "1585": 0.00003016, - "1590": 0.00003019, - "1595": 0.00003018, - "1600": 0.00003018, - "1605": 0.00003016, - "1610": 0.00003014, - "1615": 0.00003014, - "1620": 0.00003018, - "1625": 0.00003018, - "1630": 0.0000302, - "1635": 0.00003019, - "1640": 0.0000302, - "1645": 0.00003022, - "1650": 0.00003021, - "1655": 0.0000302, - "1660": 0.00003022, - "1665": 0.00003019, - "1670": 0.00003023, - "1675": 0.00003024, - "1680": 0.00003025, - "1685": 0.00003028, - "1690": 0.00003028, - "1695": 0.00003028, - "1700": 0.00003027, - "1705": 0.00003028, - "1710": 0.00003027, - "1715": 0.00003027, - "1720": 0.00003029, - "1725": 0.00003028, - "1730": 0.00003023, - "1735": 0.00003025, - "1740": 0.00003026, - "1745": 0.00003026, - "1750": 0.00003028, - "1755": 0.00003028, - "1760": 0.0000303, - "1765": 0.00003029, - "1770": 0.00003029, - "1775": 0.00003028, - "1780": 0.00003028, - "1785": 0.00003024, - "1790": 0.00003025, - "1795": 0.00003024, - "1800": 0.00003025, - "1805": 0.00003024, - "1810": 0.00003024, - "1815": 0.00003022, - "1820": 0.00003023, - "1825": 0.0000302, - "1830": 0.00003017, - "1835": 0.00003013, - "1840": 0.00003012, - "1845": 0.00003013, - "1850": 0.00003012, - "1855": 0.00003011, - "1860": 0.00003015, - "1865": 0.00003017, - "1870": 0.0000302, - "1875": 0.00003019, - "1880": 0.00003019, - "1885": 0.00003018, - "1890": 0.00003017, - "1895": 0.00003017, - "1900": 0.00003018, - "1905": 0.00003019, - "1910": 0.00003018, - "1915": 0.00003017, - "1920": 0.00003015, - "1925": 0.00003012, - "1930": 0.00003006, - "1935": 0.00003004, - "1940": 0.00003004, - "1945": 0.00003001, - "1950": 0.00003005, - "1955": 0.00003006, - "1960": 0.00003004, - "1965": 0.00003006, - "1970": 0.00003004, - "1975": 0.00003002, - "1980": 0.00003002, - "1985": 0.00003004, - "1990": 0.00003003, - "1995": 0.00003001, - "2000": 0.00003001, - "2005": 0.00002999, - "2010": 0.00002999, - "2015": 0.00002999, - "2020": 0.00002999, - "2025": 0.00002997, - "2030": 0.00003, - "2035": 0.00002997, - "2040": 0.00002997, - "2045": 0.00002996, - "2050": 0.00002996, - "2055": 0.00002997, - "2060": 0.00002997, - "2065": 0.00002996, - "2070": 0.00002995, - "2075": 0.00002994, - "2080": 0.00002993, - "2085": 0.00002992, - "2090": 0.0000299, - "2095": 0.00002991, - "2100": 0.00002989, - "2105": 0.00002987, - "2110": 0.00002987, - "2115": 0.00002983, - "2120": 0.00002985, - "2125": 0.00002978, - "2130": 0.00002982, - "2135": 0.00002979, - "2140": 0.00002986, - "2145": 0.00002983, - "2150": 0.00002981, - "2155": 0.00002985, - "2160": 0.00002986, - "2165": 0.00002991, - "2170": 0.00002993, - "2175": 0.00002988, - "2180": 0.0000299, - "2185": 0.00002987, - "2190": 0.00002989, - "2195": 0.00002989, - "2200": 0.00002989, - "2205": 0.00002989, - "2210": 0.00002987, - "2215": 0.00002988, - "2220": 0.00002991, - "2225": 0.00002992, - "2230": 0.00002994, - "2235": 0.00002992, - "2240": 0.00002991, - "2245": 0.00002991, - "2250": 0.00002993, - "2255": 0.00002989, - "2260": 0.0000299, - "2265": 0.0000299, - "2270": 0.00002986, - "2275": 0.00002986, - "2280": 0.00002986, - "2285": 0.00002986, - "2290": 0.00002991, - "2295": 0.0000299, - "2300": 0.0000299, - "2305": 0.00002988, - "2310": 0.00002991, - "2315": 0.00002987, - "2320": 0.0000299, - "2325": 0.0000299, - "2330": 0.00002988, - "2335": 0.00002988, - "2340": 0.00002989, - "2345": 0.00002989, - "2350": 0.00002987, - "2355": 0.00002989, - "2360": 0.00002985, - "2365": 0.00002986, - "2370": 0.00002985, - "2375": 0.00002983, - "2380": 0.00002984, - "2385": 0.00002985, - "2390": 0.00002986, - "2395": 0.00002985, - "2400": 0.00002988, - "2405": 0.00002983, - "2410": 0.00002985, - "2415": 0.00002987, - "2420": 0.00002987, - "2425": 0.00002989, - "2430": 0.00002987, - "2435": 0.00002992, - "2440": 0.00002994, - "2445": 0.00002993, - "2450": 0.00002994, - "2455": 0.00002995, - "2460": 0.00002998, - "2465": 0.00003003, - "2470": 0.00003003, - "2475": 0.00003, - "2480": 0.00003, - "2485": 0.00003001, - "2490": 0.00002996, - "2495": 0.00002998 -} diff --git a/ts-simulation/client/config/example-price-feeds/solusdt.json b/ts-simulation/client/config/example-price-feeds/solusdt.json deleted file mode 100644 index 1f4eefc..0000000 --- a/ts-simulation/client/config/example-price-feeds/solusdt.json +++ /dev/null @@ -1,502 +0,0 @@ -{ - "0": 182.8, - "5": 182.77, - "10": 182.85, - "15": 182.85, - "20": 182.74, - "25": 182.87, - "30": 182.82, - "35": 182.83, - "40": 182.76, - "45": 182.76, - "50": 182.7, - "55": 182.72, - "60": 182.71, - "65": 182.71, - "70": 182.81, - "75": 182.81, - "80": 182.72, - "85": 182.79, - "90": 182.76, - "95": 182.78, - "100": 182.83, - "105": 182.9, - "110": 182.83, - "115": 182.86, - "120": 182.89, - "125": 182.88, - "130": 182.89, - "135": 182.95, - "140": 182.93, - "145": 182.98, - "150": 182.97, - "155": 183.02, - "160": 183.11, - "165": 183.09, - "170": 183.02, - "175": 182.98, - "180": 182.93, - "185": 182.88, - "190": 182.76, - "195": 182.63, - "200": 182.69, - "205": 182.56, - "210": 182.51, - "215": 182.55, - "220": 182.42, - "225": 182.19, - "230": 182.24, - "235": 182.17, - "240": 182.18, - "245": 182.17, - "250": 182.22, - "255": 182.16, - "260": 182.21, - "265": 182.13, - "270": 182.16, - "275": 182.09, - "280": 182.05, - "285": 182.09, - "290": 182.11, - "295": 182.13, - "300": 182.14, - "305": 182.04, - "310": 182.0, - "315": 181.93, - "320": 181.94, - "325": 181.92, - "330": 181.92, - "335": 181.99, - "340": 181.94, - "345": 181.85, - "350": 181.88, - "355": 181.78, - "360": 181.71, - "365": 181.7, - "370": 181.7, - "375": 181.69, - "380": 181.68, - "385": 181.57, - "390": 181.7, - "395": 181.75, - "400": 181.68, - "405": 181.7, - "410": 181.69, - "415": 181.66, - "420": 181.68, - "425": 181.7, - "430": 181.75, - "435": 181.71, - "440": 181.76, - "445": 181.78, - "450": 181.61, - "455": 181.59, - "460": 181.59, - "465": 181.49, - "470": 181.66, - "475": 181.63, - "480": 181.62, - "485": 181.54, - "490": 181.65, - "495": 181.63, - "500": 181.51, - "505": 181.64, - "510": 181.57, - "515": 181.56, - "520": 181.59, - "525": 181.4, - "530": 181.5, - "535": 181.49, - "540": 181.44, - "545": 181.55, - "550": 181.7, - "555": 181.81, - "560": 181.78, - "565": 181.82, - "570": 181.86, - "575": 181.83, - "580": 181.84, - "585": 181.77, - "590": 181.74, - "595": 181.79, - "600": 181.6, - "605": 181.58, - "610": 181.65, - "615": 181.69, - "620": 181.63, - "625": 181.65, - "630": 181.7, - "635": 181.6, - "640": 181.54, - "645": 181.61, - "650": 181.53, - "655": 181.54, - "660": 181.56, - "665": 181.6, - "670": 181.63, - "675": 181.62, - "680": 181.59, - "685": 181.56, - "690": 181.53, - "695": 181.56, - "700": 181.62, - "705": 181.57, - "710": 181.58, - "715": 181.58, - "720": 181.53, - "725": 181.61, - "730": 181.59, - "735": 181.67, - "740": 181.81, - "745": 181.87, - "750": 181.86, - "755": 181.82, - "760": 181.77, - "765": 181.73, - "770": 181.69, - "775": 181.67, - "780": 181.57, - "785": 181.58, - "790": 181.61, - "795": 181.55, - "800": 181.5, - "805": 181.41, - "810": 181.44, - "815": 181.44, - "820": 181.46, - "825": 181.44, - "830": 181.38, - "835": 181.26, - "840": 181.45, - "845": 181.45, - "850": 181.4, - "855": 181.59, - "860": 181.52, - "865": 181.54, - "870": 181.47, - "875": 181.39, - "880": 181.41, - "885": 181.28, - "890": 181.24, - "895": 181.26, - "900": 181.3, - "905": 181.27, - "910": 181.28, - "915": 181.22, - "920": 181.22, - "925": 181.25, - "930": 181.19, - "935": 181.27, - "940": 181.29, - "945": 181.29, - "950": 181.25, - "955": 181.31, - "960": 181.35, - "965": 181.46, - "970": 181.35, - "975": 181.43, - "980": 181.54, - "985": 181.6, - "990": 181.53, - "995": 181.64, - "1000": 181.53, - "1005": 181.44, - "1010": 181.31, - "1015": 181.3, - "1020": 181.23, - "1025": 181.24, - "1030": 181.15, - "1035": 181.12, - "1040": 181.23, - "1045": 181.22, - "1050": 181.24, - "1055": 181.13, - "1060": 181.23, - "1065": 181.25, - "1070": 181.19, - "1075": 181.15, - "1080": 181.09, - "1085": 181.09, - "1090": 181.17, - "1095": 181.26, - "1100": 181.21, - "1105": 181.29, - "1110": 181.32, - "1115": 181.32, - "1120": 181.37, - "1125": 181.42, - "1130": 181.38, - "1135": 181.26, - "1140": 181.33, - "1145": 181.33, - "1150": 181.39, - "1155": 181.39, - "1160": 181.43, - "1165": 181.43, - "1170": 181.33, - "1175": 181.32, - "1180": 181.39, - "1185": 181.45, - "1190": 181.42, - "1195": 181.42, - "1200": 181.43, - "1205": 181.48, - "1210": 181.43, - "1215": 181.4, - "1220": 181.45, - "1225": 181.35, - "1230": 181.43, - "1235": 181.44, - "1240": 181.41, - "1245": 181.37, - "1250": 181.2, - "1255": 181.22, - "1260": 181.18, - "1265": 181.22, - "1270": 181.18, - "1275": 181.13, - "1280": 181.06, - "1285": 181.08, - "1290": 181.11, - "1295": 181.11, - "1300": 181.01, - "1305": 181.01, - "1310": 181.15, - "1315": 181.12, - "1320": 181.08, - "1325": 181.01, - "1330": 181.08, - "1335": 181.12, - "1340": 181.35, - "1345": 181.51, - "1350": 181.6, - "1355": 181.8, - "1360": 181.85, - "1365": 181.66, - "1370": 181.64, - "1375": 181.66, - "1380": 181.48, - "1385": 181.52, - "1390": 181.68, - "1395": 181.87, - "1400": 181.86, - "1405": 181.98, - "1410": 181.96, - "1415": 181.86, - "1420": 181.88, - "1425": 182.01, - "1430": 182.01, - "1435": 182.24, - "1440": 182.19, - "1445": 182.2, - "1450": 182.05, - "1455": 182.0, - "1460": 181.94, - "1465": 181.86, - "1470": 181.93, - "1475": 181.81, - "1480": 181.92, - "1485": 181.88, - "1490": 182.01, - "1495": 182.04, - "1500": 182.08, - "1505": 182.2, - "1510": 182.08, - "1515": 182.09, - "1520": 182.25, - "1525": 182.17, - "1530": 182.09, - "1535": 182.16, - "1540": 182.16, - "1545": 182.25, - "1550": 182.15, - "1555": 182.19, - "1560": 182.19, - "1565": 182.22, - "1570": 182.13, - "1575": 182.12, - "1580": 182.09, - "1585": 182.18, - "1590": 182.4, - "1595": 182.29, - "1600": 182.35, - "1605": 182.27, - "1610": 182.21, - "1615": 182.2, - "1620": 182.32, - "1625": 182.34, - "1630": 182.37, - "1635": 182.28, - "1640": 182.31, - "1645": 182.39, - "1650": 182.39, - "1655": 182.39, - "1660": 182.39, - "1665": 182.32, - "1670": 182.52, - "1675": 182.57, - "1680": 182.61, - "1685": 182.59, - "1690": 182.55, - "1695": 182.67, - "1700": 182.6, - "1705": 182.53, - "1710": 182.6, - "1715": 182.55, - "1720": 182.61, - "1725": 182.57, - "1730": 182.44, - "1735": 182.51, - "1740": 182.47, - "1745": 182.47, - "1750": 182.47, - "1755": 182.5, - "1760": 182.43, - "1765": 182.41, - "1770": 182.4, - "1775": 182.33, - "1780": 182.31, - "1785": 182.21, - "1790": 182.21, - "1795": 182.16, - "1800": 182.15, - "1805": 182.13, - "1810": 182.13, - "1815": 182.05, - "1820": 182.12, - "1825": 182.01, - "1830": 181.8, - "1835": 181.72, - "1840": 181.59, - "1845": 181.59, - "1850": 181.41, - "1855": 181.41, - "1860": 181.54, - "1865": 181.58, - "1870": 181.68, - "1875": 181.75, - "1880": 181.77, - "1885": 181.64, - "1890": 181.6, - "1895": 181.69, - "1900": 181.73, - "1905": 181.79, - "1910": 181.69, - "1915": 181.6, - "1920": 181.54, - "1925": 181.41, - "1930": 181.26, - "1935": 181.2, - "1940": 181.21, - "1945": 181.13, - "1950": 181.11, - "1955": 181.09, - "1960": 181.11, - "1965": 181.14, - "1970": 181.06, - "1975": 181.07, - "1980": 181.11, - "1985": 181.21, - "1990": 181.16, - "1995": 181.14, - "2000": 181.17, - "2005": 181.04, - "2010": 181.09, - "2015": 181.09, - "2020": 181.08, - "2025": 181.01, - "2030": 181.11, - "2035": 180.97, - "2040": 181.02, - "2045": 180.91, - "2050": 180.96, - "2055": 180.94, - "2060": 180.92, - "2065": 180.85, - "2070": 180.82, - "2075": 180.86, - "2080": 180.72, - "2085": 180.64, - "2090": 180.58, - "2095": 180.45, - "2100": 180.37, - "2105": 180.4, - "2110": 180.37, - "2115": 180.29, - "2120": 180.4, - "2125": 180.15, - "2130": 180.45, - "2135": 180.4, - "2140": 180.51, - "2145": 180.38, - "2150": 180.28, - "2155": 180.38, - "2160": 180.42, - "2165": 180.56, - "2170": 180.55, - "2175": 180.43, - "2180": 180.45, - "2185": 180.28, - "2190": 180.4, - "2195": 180.42, - "2200": 180.41, - "2205": 180.39, - "2210": 180.31, - "2215": 180.33, - "2220": 180.38, - "2225": 180.48, - "2230": 180.67, - "2235": 180.57, - "2240": 180.61, - "2245": 180.65, - "2250": 180.65, - "2255": 180.62, - "2260": 180.65, - "2265": 180.67, - "2270": 180.61, - "2275": 180.62, - "2280": 180.55, - "2285": 180.62, - "2290": 180.9, - "2295": 180.81, - "2300": 180.83, - "2305": 180.72, - "2310": 180.89, - "2315": 180.81, - "2320": 180.89, - "2325": 180.92, - "2330": 180.86, - "2335": 180.87, - "2340": 180.96, - "2345": 180.98, - "2350": 180.86, - "2355": 180.84, - "2360": 180.76, - "2365": 180.79, - "2370": 180.76, - "2375": 180.66, - "2380": 180.65, - "2385": 180.62, - "2390": 180.82, - "2395": 180.84, - "2400": 181.0, - "2405": 181.11, - "2410": 181.22, - "2415": 181.18, - "2420": 181.25, - "2425": 181.32, - "2430": 181.44, - "2435": 181.52, - "2440": 181.55, - "2445": 181.48, - "2450": 181.45, - "2455": 181.57, - "2460": 181.66, - "2465": 181.76, - "2470": 181.78, - "2475": 181.66, - "2480": 181.64, - "2485": 181.71, - "2490": 181.57, - "2495": 181.72 -} diff --git a/ts-simulation/client/config/index.ts b/ts-simulation/client/config/index.ts deleted file mode 100644 index 09ced70..0000000 --- a/ts-simulation/client/config/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './retries' -export * from './price-feed' diff --git a/ts-simulation/client/config/price-feed.ts b/ts-simulation/client/config/price-feed.ts deleted file mode 100644 index 96a9335..0000000 --- a/ts-simulation/client/config/price-feed.ts +++ /dev/null @@ -1,12 +0,0 @@ -import path from 'path' - -const BASE_PATH = path.join(path.resolve(), 'client', 'config') - -export const feedPaths = [ - path.join(BASE_PATH, 'example-price-feeds', 'btcusdt.json'), - path.join(BASE_PATH, 'example-price-feeds', 'ethusdt.json'), - path.join(BASE_PATH, 'example-price-feeds', 'solusdt.json'), - path.join(BASE_PATH, 'example-price-feeds', 'linkusdt.json'), - path.join(BASE_PATH, 'example-price-feeds', 'arbusdt.json'), - path.join(BASE_PATH, 'example-price-feeds', 'shibusdt.json'), -] diff --git a/ts-simulation/client/config/retries.ts b/ts-simulation/client/config/retries.ts deleted file mode 100644 index f5c09e3..0000000 --- a/ts-simulation/client/config/retries.ts +++ /dev/null @@ -1,5 +0,0 @@ -export const DEFAULT_MAX_RETRIES = 3 -export const DEFAULT_INITIAL_BACKOFF_MS = 1000 -export const DEFAULT_BACKOFF_MULTIPLIER = 2 -export const DEFAULT_TIMEOUT_MS = 15000 -export const DEFAULT_TIMEOUT_MULTIPLIER = 1.5 diff --git a/ts-simulation/client/providers/ExamplePriceFeedProvider.ts b/ts-simulation/client/providers/ExamplePriceFeedProvider.ts deleted file mode 100644 index a43b6d2..0000000 --- a/ts-simulation/client/providers/ExamplePriceFeedProvider.ts +++ /dev/null @@ -1,128 +0,0 @@ -import { readFileSync } from 'fs' - -import { feedPaths } from '../config' -import { getOrCreateLogger } from '../utils' -import type { PriceDeltas } from '../utils' - -type PriceFeed = { - [timestampSec: string]: number -} - -export class ExamplePriceFeedProvider { - private readonly logger = getOrCreateLogger(ExamplePriceFeedProvider.name) - private readonly priceFeeds: PriceFeed[] = [] - // Rounding time for price feed timestamps in seconds - private readonly priceTsRounding = 5 - - constructor( - private readonly numFeeds: number, - private readonly precision: number = 0, - private readonly genesisTimeSec: number = 0 - ) { - if (precision === 0) { - this.logger.info( - `PriceFeedProvider (observer) initialized with ${numFeeds} feeds at genesis time ${genesisTimeSec}` - ) - } else { - this.logger.info( - `PriceFeedProvider initialized with ${numFeeds} feeds and precision ${precision} at genesis time ${genesisTimeSec}` - ) - } - - for (let i = 0; i < feedPaths.length; i++) { - const priceFeed = JSON.parse( - readFileSync(feedPaths[i] as string).toString() - ) as PriceFeed - this.priceFeeds.push(priceFeed) - } - } - - /** - * Retrieves the current prices for the given feeds. - * - * @param feeds - An array of feed numbers. - * @returns An array of current prices corresponding to the feeds. - */ - public getCurrentPrices(feeds: number[]): number[] { - const currentTimeSec = Math.floor(Date.now() / 1000) - const diffSec = currentTimeSec - this.genesisTimeSec - const discreteDiffSec = - Math.floor(diffSec / this.priceTsRounding) * this.priceTsRounding - - this.logger.debug( - `currentTime ${currentTimeSec}, genesisTime ${this.genesisTimeSec}, difference ${diffSec}, discretizedDifference ${discreteDiffSec}` - ) - - const currentPrices = [] - for (let i = 0; i < feeds.length; i++) { - currentPrices.push( - (this.priceFeeds[i] as PriceFeed)[discreteDiffSec.toString()] ?? - 0 - ) - } - return currentPrices - } - - /** - * Retrieves the feed based on the given chain prices and feed prices. - * @param onChainPrices - An array of chain prices. - * @param offChainPrices - An array of feed prices. - * @returns A tuple containing the deltas and the representation. - * The deltas consist of an array of strings and a string. - * The representation is a string. - * @throws Error if the length of chainPrices and feedPrices is not equal or if the length is not 1. - */ - public getFastUpdateDeltas( - onChainPrices: number[], - offChainPrices: number[] - ): PriceDeltas { - if (onChainPrices.length != offChainPrices.length) { - throw new Error('Arrays should be of equal length') - } - - let feeds: string = '' - let feed: number = 0 - let rep: string = '' - - for (let i = 0; i < onChainPrices.length; i++) { - if (i % 2 == 0) { - feed = 0 - } - const onChainPrice = onChainPrices[i] as number - const offChainPrice = offChainPrices[i] as number - - if (onChainPrice > offChainPrice) { - // If the chain price is greater than the feed price, decrease the chain price - if (i % 2 == 0) { - feed += 12 - rep += '-' - } else { - feed += 3 - rep += '-' - feeds = feeds + feed.toString(16) - } - } else if (onChainPrice < offChainPrice) { - // If the chain price is less than the feed price, increase the chain price - if (i % 2 == 0) { - feed += 4 - rep += '+' - } else { - feed += 1 - rep += '+' - feeds = feeds + feed.toString(16) - } - } - } - - if (this.numFeeds % 2 == 1) { - feeds = feeds + feed.toString(16) - } - - if (feeds.length % 2 == 1) { - feeds = feeds + '0' - } - const deltas: string = '0x' + feeds - - return [deltas, rep] - } -} diff --git a/ts-simulation/client/providers/FastUpdatesProvider.ts b/ts-simulation/client/providers/FastUpdatesProvider.ts deleted file mode 100644 index e75f1d4..0000000 --- a/ts-simulation/client/providers/FastUpdatesProvider.ts +++ /dev/null @@ -1,315 +0,0 @@ -import type { BytesLike } from 'ethers' -import { sha256 } from 'ethers' -import type { TransactionReceipt } from 'web3-types' -import type { Logger } from 'winston' - -import { FEEDS } from '../../deployment/config' -import type { PriceDeltas, Proof } from '../utils' -import { - calculateRandomness, - generateSortitionKey, - generateVerifiableRandomnessProof, -} from '../utils' -import { signMessage } from '../utils' - -import type { ExamplePriceFeedProvider } from './ExamplePriceFeedProvider' -import type { Web3Provider } from './Web3Provider' - -/** - * Represents a provider for fast updates. - */ -export class FastUpdatesProvider { - private readonly key = generateSortitionKey() - private lastRegisteredEpoch: number - - constructor( - private readonly provider: Web3Provider, - private readonly priceFeedProvider: ExamplePriceFeedProvider, - private readonly epochLen: number, - private readonly weight: number, - private readonly address: string, - private readonly privateKey: string, - private readonly logger: Logger - ) { - this.lastRegisteredEpoch = -1 - this.logger.info( - `FastUpdatesProvider initialized at ${provider.account.address}` - ) - } - - /** - * Initializes the FastUpdatesProvider. - * Waits for a new reward epoch and registers as a voter for the next epoch. - * @returns A Promise that resolves once the initialization is complete. - */ - public async init(): Promise { - const nextEpoch = await this.provider.delayAfterRewardEpochEdge( - this.epochLen - ) - const txReceipt = await this.registerAsVoter(nextEpoch, this.weight) - if (Number(txReceipt.status) === 1) { - this.logger.info( - `Block ${txReceipt.blockNumber}, Voter registration for epoch ${nextEpoch} successful` - ) - } else { - this.logger.error( - `Block ${txReceipt.blockNumber}, Voter registration for epoch ${nextEpoch} failed` - ) - } - } - - /** - * Registers the current user as a voter for a specific epoch with a given weight. - * @param epoch - The epoch number to register for. - * @param weight - The weight of the voter. - * @param addToNonce - An optional value to add to the nonce. - * @returns A promise that resolves to the transaction receipt. - */ - private async registerAsVoter( - epoch: number, - weight: number, - addToNonce?: number - ): Promise { - const txReceipt = await this.provider.registerAsAVoter( - epoch, - this.key, - weight, - this.address, - addToNonce - ) - this.lastRegisteredEpoch = epoch - this.logger.info( - `Gas consumed by registerAsVoter ${txReceipt.gasUsed.toString()}` - ) - return txReceipt - } - - /** - * Submits updates to the provider. - * - * @param proof - The proof object. - * @param replicate - The replicate value. - * @param deltas - The deltas array. - * @param submissionBlockNum - The submission block number. - * @param addToNonce - Optional parameter to add to the nonce. - * @returns A promise that resolves to the transaction receipt. - */ - private async submitUpdates( - proof: Proof, - replicate: string, - deltas: string, - submissionBlockNum: string, - addToNonce?: number - ): Promise { - const msg = this.provider.web3.eth.abi.encodeParameters( - [ - 'uint256', - 'uint256', - 'uint256', - 'uint256', - 'uint256', - 'uint256', - 'bytes', - ], - [ - submissionBlockNum, - replicate, - proof.gamma.x.toString(), - proof.gamma.y.toString(), - proof.c.toString(), - proof.s.toString(), - deltas, - ] - ) - - const signature = signMessage( - this.provider.web3, - sha256(msg as BytesLike), - this.privateKey - ) - - return this.provider.submitUpdates( - proof, - replicate, - deltas, - submissionBlockNum, - signature, - addToNonce - ) - } - - /** - * Retrieves the weight from the provider for the current address. - * @returns A Promise that resolves to a string representing the weight. - */ - private async getWeight(): Promise { - return await this.provider.getWeight(this.provider.account.address) - } - - /** - * Tries to submit updates based on the provided parameters. - * - * @param myWeight - The weight of the updates to be submitted. - * @param blockNum - The block number for which the updates are being submitted. - * @param seed - The seed value used for generating randomness. - * @returns A Promise that resolves to void. - */ - private async tryToSubmitUpdates( - deltas: PriceDeltas, - myWeight: number, - blockNum: bigint, - seed: string - ): Promise { - let addToNonce = 0 - const blockNumStr = blockNum.toString() - const cutoff = BigInt(await this.provider.getCurrentScoreCutoff()) - - for (let replicate = 0; replicate < myWeight; replicate++) { - const replicateStr = replicate.toString() - const r: bigint = calculateRandomness( - this.key, - seed, - blockNumStr, - replicateStr - ) - - if (r < cutoff) { - const proof: Proof = generateVerifiableRandomnessProof( - this.key, - seed, - blockNumStr, - replicateStr - ) - this.logger.info( - `Block: ${blockNum}, Rep: ${replicate}, Update: ${deltas[1]}` - ) - await this.submitUpdates( - proof, - replicateStr, - deltas[0], - blockNumStr, - addToNonce - ) - .then((receipt: TransactionReceipt) => { - this.logger.info( - `Block: ${receipt.blockNumber}, Update successful, ${deltas[1]}` - ) - }) - .catch((error: unknown) => { - this.logger.error( - `Block: ${blockNum}, Failed to submit updates ${error as string}` - ) - }) - addToNonce++ - break - } - } - } - - /** - * Re-registers the provider for the next epoch. - * - * @param epoch - The current epoch number. - * @returns A promise that resolves to a boolean indicating whether the re-registration was successful. - */ - private async reRegister(epoch: number): Promise { - const txReceipt = await this.registerAsVoter(epoch + 1, this.weight) - - if (Number(txReceipt.status) === 1) { - this.logger.info( - `Epoch: ${epoch + 1} (Block ${txReceipt.blockNumber}), Registration successful` - ) - } else { - this.logger.error(`Epoch: ${epoch + 1}, Registration failed`) - } - return Number(txReceipt.status) === 1 - } - - /** - * Runs the FastUpdatesProvider. - * This method waits for a new epoch, performs necessary operations within each epoch, - * and waits for the next block to continue the process. - * @returns A Promise that resolves to void. - */ - public async run(): Promise { - this.logger.info('Waiting for a new epoch...') - await this.provider.waitForNewEpoch(this.epochLen) - - let currentWeight: string = '' - let currentBaseSeed: bigint = 0n - - for (;;) { - const blockNum = Number(await this.provider.getBlockNumber()) - const epoch = Math.floor((blockNum + 1) / this.epochLen) - - // Within the last 4 blocks of the epoch, re-register for the next epoch - if (blockNum % this.epochLen >= this.epochLen - 4) { - if (epoch + 1 > this.lastRegisteredEpoch) { - let registered = false - try { - registered = await this.reRegister(epoch) - } catch (error: unknown) { - this.logger.error( - `Block: ${blockNum}, Failed to re-register ${error as string}` - ) - } - if (registered) { - // If successful, wait for the next epoch - await this.provider.waitForNewEpoch(this.epochLen) - } else { - // If failed, wait for the next block to try again - await this.provider.waitForBlock(blockNum + 1) - continue - } - } - } - - // Get the weight and the seed for the current epoch - if (blockNum % this.epochLen === 0) { - ;[currentWeight, currentBaseSeed] = await Promise.all([ - this.getWeight(), - this.provider.getBaseSeed(), - ]) - this.logger.info(`Epoch: ${epoch}, Weight: ${currentWeight}`) - } - - // Fetch the on-chain and off-chain prices - const onChainPrices: number[] = ( - await this.provider.fetchCurrentPrices(Array.from(FEEDS)) - ).map((x) => Number(x)) - const offChainPrices = this.priceFeedProvider.getCurrentPrices( - Array.from(FEEDS) - ) - - this.logger.info( - `blockNumber: ${blockNum}, onChainPrices: ${onChainPrices.join(', ')}, offChainPrices: ${offChainPrices.join(', ')}` - ) - // Compare the on-chain and off-chain prices - const deltas: PriceDeltas = - this.priceFeedProvider.getFastUpdateDeltas( - onChainPrices, - offChainPrices - ) - // Don't submit updates if there are no changes - const rep = deltas[1] - if (!rep.includes('+') && !rep.includes('-')) { - this.logger.debug(`No updates for block ${blockNum}`) - } else { - try { - await this.tryToSubmitUpdates( - deltas, - Number(currentWeight), - BigInt(blockNum), - currentBaseSeed.toString() - ) - } catch (error: unknown) { - this.logger.error( - `Block: ${blockNum}, Failed to submit update ${error as string}` - ) - } - } - - await this.provider.waitForBlock(blockNum + 1) - } - } -} diff --git a/ts-simulation/client/providers/Web3Provider.ts b/ts-simulation/client/providers/Web3Provider.ts deleted file mode 100644 index 02c2038..0000000 --- a/ts-simulation/client/providers/Web3Provider.ts +++ /dev/null @@ -1,433 +0,0 @@ -import type Web3 from 'web3' -import type { Web3Account } from 'web3-eth-accounts' -import type { Transaction, TransactionReceipt } from 'web3-types' - -import type { FastUpdateIncentiveManager } from '../../typechain-web3/contracts/fastUpdates/implementation/FastUpdateIncentiveManager' -import type { FastUpdater } from '../../typechain-web3/contracts/fastUpdates/implementation/FastUpdater' -import type { - FlareSystemManager, - VoterRegistry, -} from '../../typechain-web3/contracts/fastUpdates/interface/mocks' -import type { FlareSystemMock } from '../../typechain-web3/contracts/fastUpdates/test' -import type { NonPayableTransactionObject } from '../../typechain-web3/types' -import { getOrCreateLogger, loadContract, sleepFor } from '../utils' -import type { - FastUpdatesContractAddresses, - NetworkParameters, - Proof, - SortitionKey, -} from '../utils' -import type { BareSignature } from '../utils' - -interface TypeChainContracts { - readonly voterRegistry: VoterRegistry - readonly flareSystemManager: FlareSystemManager - readonly fastUpdater: FastUpdater - readonly fastUpdateIncentiveManager: FastUpdateIncentiveManager - readonly flareSystemMock: FlareSystemMock -} - -type SortitionCredential = [string, [string, string], string, string] - -type FastUpdate = [ - string, - [string, [string, string], string, string], - [number, string, string], - string, -] - -type SortitionPolicy = [string, string, number] - -export class Web3Provider { - private readonly logger = getOrCreateLogger(Web3Provider.name) - - private constructor( - readonly web3: Web3, - readonly contracts: TypeChainContracts, - private readonly config: NetworkParameters, - readonly account: Web3Account - ) { - this.account = account - this.logger.info( - `Creating Web3Provider instance for ${this.account.address}` - ) - } - - /** - * Creates a new instance of Web3Provider. - * Separated from the constructor to allow for async initialization. - * - * @param web3 - The Web3 instance. - * @param contractAddresses - The contract addresses. - * @param params - The network parameters. - * @param account - The Web3 account. - * @returns A Promise that resolves to a new instance of Web3Provider. - */ - public static async create( - web3: Web3, - contractAddresses: FastUpdatesContractAddresses, - params: NetworkParameters, - account: Web3Account - ): Promise { - const contracts = { - voterRegistry: await loadContract( - web3, - contractAddresses.voterRegistry, - 'VoterRegistry' - ), - flareSystemManager: await loadContract( - web3, - contractAddresses.flareSystemManager, - 'FlareSystemManager' - ), - fastUpdater: await loadContract( - web3, - contractAddresses.fastUpdater, - 'FastUpdater' - ), - flareSystemMock: await loadContract( - web3, - contractAddresses.flareSystemManager, - 'FlareSystemMock' - ), - fastUpdateIncentiveManager: - await loadContract( - web3, - contractAddresses.fastUpdateIncentiveManager, - 'FastUpdateIncentiveManager' - ), - } - const provider = new Web3Provider(web3, contracts, params, account) - return provider - } - - /** - * Signs and finalizes a transaction. - * - * @param label - The label for the transaction. - * @param toAddress - The address to send the transaction to. - * @param fnToEncode - The function to encode in the transaction. - * @param value - The value to send with the transaction. - * @param from - The account to send the transaction from. - * @param addToNonce - The value to add to the transaction nonce. - * @returns A promise that resolves to the transaction receipt. - * @throws If the dry-run of the transaction fails or if the state changes during the transaction. - */ - private async signAndFinalize( - label: string, - toAddress: string, - fnToEncode: NonPayableTransactionObject, - value: string = '0', - from: Web3Account = this.account, - addToNonce: number = 0 - ): Promise { - // Calculate tx parameters - const [gasPrice, currentNonce] = await Promise.all([ - this.web3.eth.getGasPrice(), - this.getNonce(from), - ]) - const tx: Transaction = { - from: from.address, - to: toAddress, - gas: this.config.gasLimit, - gasPrice: gasPrice, - data: fnToEncode.encodeABI(), - value: value, - nonce: Number(currentNonce) + addToNonce, - } - - // Send tx and wait for confirmation - this.logger.debug(`Sending tx ${label} (nonce:${tx.nonce})`) - const signedTx = await from.signTransaction(tx) - const txReceipt: TransactionReceipt = await this.web3.eth - .sendSignedTransaction(signedTx.rawTransaction) - .on('confirmation', (confirmation) => { - this.logger.debug( - `Confirmed tx ${label} (confirmations:${confirmation.confirmations}, nonce:${tx.nonce})` - ) - }) - .on('error', (error) => { - this.logger.error(`Error in tx ${label}: ${error.message}`) - }) - - return txReceipt - } - - /** - * Registers a voter with the specified epoch, sortition key and weight. - * @param epoch - The epoch number. - * @param key - The sortition key. - * @param weight - The weight of the voter. - * @param addToNonce - Optional value to add to the nonce. - * @returns A promise that resolves to the transaction receipt. - */ - public async registerAsAVoter( - epoch: number, - key: SortitionKey, - weight: number, - address: string, - addToNonce?: number - ): Promise { - const x = - '0x' + - '0'.repeat(64 - key.pk.x.toString(16).length) + - key.pk.x.toString(16) - const y = - '0x' + - '0'.repeat(64 - key.pk.y.toString(16).length) + - key.pk.y.toString(16) - - const policy: SortitionPolicy = [x, y, weight] - const methodCall = - this.contracts.flareSystemMock.methods.registerAsVoter( - epoch, - address, - policy - ) - return this.signAndFinalize( - 'RegisterAsAVoter', - this.contracts.voterRegistry['options'].address, - methodCall, - undefined, - undefined, - addToNonce - ) - } - - /** - * Submits updates to the fast updater contract. - * - * @param proof - The proof object containing the necessary cryptographic proofs. - * @param replicate - The number of times to replicate the proof. - * @param deltas - The deltas to be submitted. - * @param submissionBlockNum - The block number of the submission. - * @param addToNonce - Optional parameter to add to the nonce. - * @returns A promise that resolves to the transaction receipt. - */ - public async submitUpdates( - proof: Proof, - replicate: string, - deltas: string, - submissionBlockNum: string, - signature: BareSignature, - addToNonce?: number - ): Promise { - const sortitionCredential: SortitionCredential = [ - replicate, - [proof.gamma.x.toString(), proof.gamma.y.toString()], - proof.c.toString(), - proof.s.toString(), - ] - const newFastUpdate: FastUpdate = [ - submissionBlockNum, - sortitionCredential, - [signature.v, signature.r, signature.s], - deltas, - ] - - const methodCall = - this.contracts.fastUpdater.methods.submitUpdates(newFastUpdate) - - return this.signAndFinalize( - 'submitUpdates', - this.contracts.fastUpdater['options'].address, - methodCall, - undefined, - undefined, - addToNonce - ) - } - - /** - * Advances the incentive by calling the 'advance' method of the fastUpdateIncentiveManager contract. - * To be called by the daemon. - * - * @param addToNonce - Optional parameter to add to the nonce value. - * @returns A promise that resolves to a TransactionReceipt object. - */ - public async advanceIncentive( - addToNonce?: number - ): Promise { - const methodCall = - this.contracts.fastUpdateIncentiveManager.methods.advance() - return this.signAndFinalize( - 'advance', - - this.contracts.fastUpdateIncentiveManager['options'].address, - methodCall, - undefined, - undefined, - addToNonce - ) - } - - /** - * Calls the 'freeSubmitted' method of the 'fastUpdater' contract. - * To be called by the daemon. - * - * @param addToNonce - Optional parameter to add to the nonce value. - * @returns A promise that resolves to a TransactionReceipt object. - */ - public async freeSubmitted( - addToNonce?: number - ): Promise { - const methodCall = this.contracts.fastUpdater.methods.freeSubmitted() - return this.signAndFinalize( - 'freeSubmitted', - this.contracts.fastUpdater['options'].address, - methodCall, - undefined, - undefined, - addToNonce - ) - } - - /** - * Calls the 'applySubmitted' method of the 'fastUpdater' contract. - * To be called by the daemon. - * - * @param addToNonce - Optional parameter to add to the nonce value. - * @returns A promise that resolves to a TransactionReceipt object. - */ - public async applySubmitted( - addToNonce?: number - ): Promise { - const methodCall = this.contracts.fastUpdater.methods.applySubmitted() - return this.signAndFinalize( - 'applySubmitted', - this.contracts.fastUpdater['options'].address, - methodCall, - undefined, - undefined, - addToNonce - ) - } - - /** - * Retrieves the sortition weight for a given address. - * @param address - The address for which to retrieve the sortition weight. - * @returns A promise that resolves to the sortition weight as a string. - */ - public async getWeight(address: string): Promise { - const weight = await this.contracts.fastUpdater.methods - .currentSortitionWeight(address) - .call() - return weight - } - - /** - * Fetches the current prices for the given feeds. - * @param feeds An array of feed numbers. - * @returns A promise that resolves to an array of strings representing the current prices. - */ - public async fetchCurrentPrices(feeds: number[]): Promise { - return await this.contracts.fastUpdater.methods - .fetchCurrentPrices(feeds) - .call() - } - - /** - * Retrieves the base seed from the Flare System Manager contract. - * @returns A promise that resolves to a bigint representing the base seed. - */ - public async getBaseSeed(): Promise { - return BigInt( - await this.contracts.flareSystemManager.methods - .getCurrentRandom() - .call() - ) - } - - /** - * Retrieves the current score cutoff from the fastUpdater contract. - * @returns A Promise that resolves to a string representing the current score cutoff. - */ - async getCurrentScoreCutoff(): Promise { - return await this.contracts.fastUpdater.methods - .currentScoreCutoff() - .call() - } - - /** - * Retrieves the current block number from the Ethereum network. - * @returns A promise that resolves to a bigint representing the block number. - */ - public async getBlockNumber(): Promise { - return await this.web3.eth.getBlockNumber() - } - - /** - * Retrieves the nonce for the specified Web3 account. - * @param account The Web3 account. - * @returns A promise that resolves to the nonce as a bigint. - */ - private async getNonce(account: Web3Account): Promise { - return await this.web3.eth.getTransactionCount(account.address) - } - - /** - * Retrieves the genesis time (UNIX epoch) of the chain in seconds. - * @returns A promise that resolves to the genesis time in seconds. - */ - public async getGenesisTimeSec(): Promise { - // The timestamp conversion requires first converting to string, then to Number - // Since the default JS library uses Number for timestamps, this conversion is safe - return Number( - (await this.web3.eth.getBlock('earliest')).timestamp.toString() - ) - } - - /** - * Waits for a new epoch to begin. - * @param epochLen The length of each epoch. - * @returns A Promise that resolves when the new epoch begins. - */ - public async waitForNewEpoch(epochLen: number): Promise { - const blockNum = Number(await this.getBlockNumber()) - const newEpochBlockNum = - (Math.floor(blockNum / epochLen) + 1) * epochLen - - await this.waitForBlock(newEpochBlockNum) - } - - /** - * Waits for a specific block number to be mined. - * @param minedBlockNum The block number to wait for. - * @returns A promise that resolves when the specified block number is mined. - */ - public async waitForBlock(minedBlockNum: number): Promise { - for (;;) { - const blockNum = await this.getBlockNumber() - if (blockNum >= minedBlockNum) { - return - } - await sleepFor(1000) - } - } - - /** - * Delays execution until the reward epoch edge is reached. - * If the reward epoch is just changing, it waits for the specified number of blocks. - * @param epochLen The length of each reward epoch. - * @param delayBlocks The number of blocks to delay after the reward epoch edge. Default is 3. - * @returns The next epoch number. - */ - public async delayAfterRewardEpochEdge( - epochLen: number, - delayBlocks: number = 3 - ): Promise { - let currentBlock = Number(await this.getBlockNumber()) - // If the reward epoch is just changing, wait - if ( - currentBlock % epochLen == 0 || - (currentBlock + 1) % epochLen == 0 || - (currentBlock + 2) % epochLen == 0 - ) { - await this.waitForBlock(currentBlock + delayBlocks) - currentBlock = Number(await this.getBlockNumber()) - } - - const nextEpoch = Math.floor((currentBlock + 1) / epochLen) + 1 - return nextEpoch - } -} diff --git a/ts-simulation/client/run-fast-updates-provider.ts b/ts-simulation/client/run-fast-updates-provider.ts deleted file mode 100644 index 6c29630..0000000 --- a/ts-simulation/client/run-fast-updates-provider.ts +++ /dev/null @@ -1,106 +0,0 @@ -import type { Web3Account } from 'web3-eth-accounts' - -import { EPOCH_LEN, FEEDS, PATHS, WEIGHT } from '../deployment/config' - -import { ExamplePriceFeedProvider } from './providers/ExamplePriceFeedProvider' -import { FastUpdatesProvider } from './providers/FastUpdatesProvider' -import { Web3Provider } from './providers/Web3Provider' -import { - createWeb3Instance, - getOrCreateLogger, - loadFastUpdatesContractAddresses, - loadNetworkParameters, - loadProviderAccount, -} from './utils' - -/** - * The main function that serves as the entry point of the script. - * It extracts the provider id from the command line arguments, - * loads the FTSO parameters and contracts, initializes the data provider, - * registers as a voter for the next epoch, and runs the price voter. - */ -async function main(provider?: number): Promise { - // Extract the provider id from the command line arguments - let providerId: number - - if (!provider) providerId = +(process.argv[2] as unknown as number) - else providerId = provider - - if (!providerId) throw Error('Must provide a data provider id.') - if (providerId <= 0) throw Error('Data provider id must be greater than 0.') - - const logger = getOrCreateLogger( - 'fast-update-provider-' + providerId.toString(), - 'fast-update-provider-' + providerId.toString() - ) - - // Load the FTSO parameters and contracts from the config file - const networkParams = loadNetworkParameters(PATHS.configPath) - const fastUpdatesContractAddresses = loadFastUpdatesContractAddresses( - PATHS.contractsPath - ) - const web3 = createWeb3Instance(networkParams.rpcUrl) - logger.info( - `Initializing fast updates provider ${providerId}, connecting to ${networkParams.rpcUrl}` - ) - let providerAccount: Web3Account - if (process.env['DATA_PROVIDER_VOTING_KEY']) { - logger.info(`Using environment variable for private key`) - const pk = process.env['DATA_PROVIDER_VOTING_KEY'] - providerAccount = { - address: web3.eth.accounts.privateKeyToAccount(pk).address, - privateKey: pk, - } as Web3Account - } else { - logger.info(`Loading private key from file: ${PATHS.accountsPath}`) - providerAccount = loadProviderAccount( - web3, - providerId, - PATHS.accountsPath - ) - } - - // Create the data provider instance - const web3Provider = await Web3Provider.create( - web3, - fastUpdatesContractAddresses, - networkParams, - providerAccount - ) - - const precision = Number( - await web3Provider.contracts.fastUpdateIncentiveManager.methods - .getPrecision() - .call() - ) - const genesisBlockSec = await web3Provider.getGenesisTimeSec() - const priceFeedProvider = new ExamplePriceFeedProvider( - FEEDS.length, - precision, - genesisBlockSec - ) - - // Attach the price feed provider and data provider into a fast updates provider - const fastUpdatesProvider = new FastUpdatesProvider( - web3Provider, - priceFeedProvider, - EPOCH_LEN, - WEIGHT, - providerAccount.address, - providerAccount.privateKey, - logger - ) - - // Initialize the fast updates provider (will only start at new reward epoch) - await fastUpdatesProvider.init() - - // Run the fast updates provider - await fastUpdatesProvider.run() - - process.exit(0) -} - -main().catch((error: unknown) => { - console.error(error) - process.exit(1) -}) diff --git a/ts-simulation/client/utils/error.ts b/ts-simulation/client/utils/error.ts deleted file mode 100644 index b3259e6..0000000 --- a/ts-simulation/client/utils/error.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Represents an error that occurs when a transaction is reverted. - */ -export class TxRevertedError extends Error { - constructor(message: string, cause?: Error) { - super(message, { cause: cause }) - } -} - -/** - * Converts an unknown object to an Error. - * If the object is already an Error, it is returned as is. - * Otherwise, it throws a new Error with a message indicating that an unknown object was thrown. - * @param error - The unknown object to convert to an Error. - * @returns The converted Error object. - */ -export function asError(error: unknown): Error { - if (error instanceof Error) { - return error - } else { - throw new Error( - `Unknown object thrown as error: ${JSON.stringify(error)}` - ) - } -} diff --git a/ts-simulation/client/utils/index.ts b/ts-simulation/client/utils/index.ts deleted file mode 100644 index 93856de..0000000 --- a/ts-simulation/client/utils/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from './error' -export * from './logger' -export * from './retry' -export * from './web3' -export * from './sortition' -export * from './loader' diff --git a/ts-simulation/client/utils/loader.ts b/ts-simulation/client/utils/loader.ts deleted file mode 100644 index 0951e9c..0000000 --- a/ts-simulation/client/utils/loader.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { readFileSync } from 'fs' - -import type Web3 from 'web3' -import type { Web3Account } from 'web3-eth-accounts' - -import { getOrCreateLogger } from './logger' - -export type NetworkParameters = { - readonly rpcUrl: string - readonly gasLimit: string - readonly gasPriceMultiplier: number -} - -type ProviderAccount = { - readonly privateKey: string - readonly balance: string -} - -export type FastUpdatesContractAddresses = { - readonly voterRegistry: string - readonly flareSystemManager: string - readonly fastUpdateIncentiveManager: string - readonly fastUpdater: string -} - -const logger = getOrCreateLogger('loader') - -/** - * Loads FTSO parameters from a file. - * - * @param filepath - The path to the file containing the parameters. - * @returns The loaded FTSO parameters. - */ -export function loadNetworkParameters(filepath: string): NetworkParameters { - logger.info(`Loading FTSO parameters from ${filepath}`) - const params = JSON.parse( - readFileSync(filepath).toString() - ) as NetworkParameters - - logger.info( - `Loaded FTSO parameters: gasLimit=${params.gasLimit}, gasPriceMultiplier=${params.gasPriceMultiplier}, rpcUrl=${params.rpcUrl}` - ) - return params -} - -/** - * Loads the contract addresses from the specified file path. - * @param filepath - The path to the file containing the contract addresses. - * @returns The parsed contract addresses. - * @throws Error if no contract addresses are found in the file. - */ -export function loadFastUpdatesContractAddresses( - filepath: string -): FastUpdatesContractAddresses { - const parsed = JSON.parse( - readFileSync(filepath).toString() - ) as FastUpdatesContractAddresses - if (Object.entries(parsed).length == 0) - throw Error(`No contract addresses found in ${filepath}`) - return parsed -} - -/** - * Loads provider accounts from a file and converts them to Web3 accounts. - * @param filepath - The path to the file containing the provider accounts. - * @param web3 - The Web3 instance. - * @returns An array of converted provider accounts. - */ -export function loadProviderAccounts( - web3: Web3, - filepath: string -): Web3Account[] { - return ( - JSON.parse(readFileSync(filepath).toString()) as ProviderAccount[] - ).map((x: ProviderAccount) => - web3.eth.accounts.privateKeyToAccount(x.privateKey) - ) -} - -/** - * Loads the provider account based on the given provider ID. - * - * @param web3 - The Web3 instance. - * @param providerId - The ID of the provider. - * @param filepath - The optional filepath to load provider accounts from. - * @returns The loaded account. - * @throws Error if no account is found for the given provider ID. - */ -export function loadProviderAccount( - web3: Web3, - providerId: number, - filepath: string -): Web3Account { - const accounts = loadProviderAccounts(web3, filepath) - const account = accounts[providerId] - if (!account) { - throw new Error(`No account found for provider id ${providerId}`) - } - return account -} diff --git a/ts-simulation/client/utils/logger.ts b/ts-simulation/client/utils/logger.ts deleted file mode 100644 index 43df9e0..0000000 --- a/ts-simulation/client/utils/logger.ts +++ /dev/null @@ -1,46 +0,0 @@ -import type { TransformableInfo } from 'logform' -import type { Logger } from 'winston' -import winston from 'winston' -import type TransportStream from 'winston-transport' - -const logPath = process.env['LOG_PATH'] ? process.env['LOG_PATH'] : './logs/' - -const loggers = new Map() - -/** - * Retrieves an existing logger with the specified label or creates a new one if it doesn't exist. - * @param label - The label for the logger. - * @returns The logger instance. - */ -export function getOrCreateLogger(label: string, filename?: string): Logger { - if (loggers.has(label)) return loggers.get(label) as Logger - - const transports: TransportStream[] = [new winston.transports.Console()] - if (filename) - transports.push( - new winston.transports.File({ - filename: `${logPath}${filename}.log`, - }) - ) - - const logger = winston.createLogger({ - format: winston.format.combine( - winston.format.timestamp(), - winston.format.json(), - winston.format.label({ - label: label, - }), - winston.format.printf((json: TransformableInfo) => { - if (json['label']) { - return `${json['timestamp']} - ${json['label']}:[${json.level}]: ${json.message}` - } else { - return `${json['timestamp']} - [${json.level}]: ${json.message}` - } - }) - ), - level: process.env['LOG_LEVEL'] ?? 'info', - transports: transports, - }) - loggers.set(label, logger) - return logger -} diff --git a/ts-simulation/client/utils/retry.ts b/ts-simulation/client/utils/retry.ts deleted file mode 100644 index c759ab9..0000000 --- a/ts-simulation/client/utils/retry.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Pauses the execution for the specified number of milliseconds. - * @param ms - The number of milliseconds to sleep for. - * @returns A promise that resolves after the specified time has elapsed. - */ -export async function sleepFor(ms: number): Promise { - await new Promise((resolve) => { - setTimeout(() => { - resolve() - }, ms) - }) -} diff --git a/ts-simulation/client/utils/sortition.ts b/ts-simulation/client/utils/sortition.ts deleted file mode 100644 index 8120f7c..0000000 --- a/ts-simulation/client/utils/sortition.ts +++ /dev/null @@ -1,199 +0,0 @@ -import crypto from 'crypto' - -import { Field } from '@noble/curves/abstract/modular' // also known as alt_bn128 -import type { - AffinePoint, - ProjPointType, -} from '@noble/curves/abstract/weierstrass' -import { bn254 } from '@noble/curves/bn254' // also known as alt_bn128 -import { sha256 } from 'ethers' -import { encodePacked } from 'web3-utils' - -export type SortitionKey = { - readonly sk: bigint - readonly pk: ProjPointType -} - -export type PriceDeltas = [string, string] - -export type Proof = { - readonly gamma: ProjPointType - readonly c: bigint - readonly s: bigint -} - -/** - * Generates a sortition key. - * @returns The generated sortition key. - */ -export function generateSortitionKey(): SortitionKey { - const sk = randomInt(bn254.CURVE.n) - const pk = bn254.ProjectivePoint.BASE.multiply(sk) - const key: SortitionKey = { sk: sk, pk: pk } - - return key -} - -/** - * Calculates the randomness value based on the provided parameters. - * - * @param key - The sortition key. - * @param baseSeed - The base seed value. - * @param blockNum - The block number. - * @param replicate - The replicate value. - * @returns The calculated randomness value. - */ -export function calculateRandomness( - key: SortitionKey, - baseSeed: string, - blockNum: string, - replicate: string -): bigint { - const msg: string = - encodePacked( - { value: baseSeed, type: 'uint256' }, - { value: blockNum, type: 'uint256' }, - { value: replicate, type: 'uint256' } - ) ?? '' - - const h = g1HashToPoint(msg) - const gamma = h.multiply(key.sk) - - return gamma.x -} - -/** - * Generates a verifiable randomness proof. - * - * @param key - The sortition key. - * @param baseSeed - The base seed. - * @param blockNum - The block number. - * @param replicate - The replicate value. - * @returns The verifiable randomness proof. - */ -export function generateVerifiableRandomnessProof( - key: SortitionKey, - baseSeed: string, - blockNum: string, - replicate: string -): Proof { - let msg: string = - encodePacked( - { value: baseSeed, type: 'uint256' }, - { value: blockNum, type: 'uint256' }, - { value: replicate, type: 'uint256' } - ) ?? '' - - const h = g1HashToPoint(msg) - const gamma = h.multiply(key.sk) - const k = randomInt(bn254.CURVE.n) - const gToK = bn254.ProjectivePoint.BASE.multiply(k) - const hToK = h.multiply(k) - msg = - encodePacked( - { value: bn254.ProjectivePoint.BASE.x.toString(), type: 'uint256' }, - { value: bn254.ProjectivePoint.BASE.y.toString(), type: 'uint256' }, - { value: h.x.toString(), type: 'uint256' }, - { value: h.y.toString(), type: 'uint256' }, - { value: key.pk.x.toString(), type: 'uint256' }, - { value: key.pk.y.toString(), type: 'uint256' }, - { value: gamma.x.toString(), type: 'uint256' }, - { value: gamma.y.toString(), type: 'uint256' }, - { value: gToK.x.toString(), type: 'uint256' }, - { value: gToK.y.toString(), type: 'uint256' }, - { value: hToK.x.toString(), type: 'uint256' }, - { value: hToK.y.toString(), type: 'uint256' } - ) ?? '' - - const c = BigInt(sha256(msg)) % bn254.CURVE.n - const s = - (((k - c * key.sk) % bn254.CURVE.n) + bn254.CURVE.n) % bn254.CURVE.n // modulo twice to avoid negative - const proof: Proof = { gamma: gamma, c: c, s: s } - - return proof -} - -/** - * Calculates the y-coordinate of a point on the elliptic curve given the x-coordinate. - * @param x The x-coordinate of the point. - * @returns The y-coordinate of the point if it exists, otherwise null. - */ -function g1YFromX(x: bigint): ProjPointType | null { - const ySquare = (x * x * x + 3n) % bn254.CURVE.p - const fp = Field(bn254.CURVE.p) - - try { - const y = fp.sqrt(ySquare) - - const point1: AffinePoint = { x: x, y: y } - const point2 = bn254.ProjectivePoint.fromAffine(point1) - return point2 - } catch (e) { - return null - } -} - -/** - * Computes the hash of a message and maps it to a point on the G1 elliptic curve. - * @param m - The message to be hashed. - * @returns The resulting point on the G1 curve. - */ -export function g1HashToPoint(m: string): ProjPointType { - const h = BigInt(sha256(m)) - let x: bigint = h % bn254.CURVE.p - for (;;) { - const point = g1YFromX(x) - if (point != null) { - return point - } - x += 1n - } -} - -/** - * Converts a Uint8Array buffer to a hexadecimal string representation. - * - * @param buffer - The Uint8Array buffer to convert. - * @returns The hexadecimal string representation of the buffer. - */ -function bytes2hex(buffer: Uint8Array): string { - return ( - '0x' + [...buffer].map((x) => x.toString(16).padStart(2, '0')).join('') - ) -} - -/** - * Compresses a ProjPointType into a string representation. - * - * @param a The ProjPointType to compress. - * @returns The compressed string representation of the ProjPointType. - */ -export function g1compress(a: ProjPointType): string { - const fp = Field(bn254.CURVE.p) - const m = fp.toBytes(a.x) - - if (!a.hasEvenY() && m[0]) { - m[0] = m[0] | (1 << 7) - } - - return bytes2hex(m) -} - -/** - * Generates a random integer between 0 (inclusive) and the specified maximum value (exclusive). - * @param max The maximum value for the random integer. - * @returns A random integer between 0 (inclusive) and the specified maximum value (exclusive). - */ -export function randomInt(max: bigint): bigint { - const length = max.toString(2).length - const numBytes = Math.floor((length - 1) / 8) + 1 - const twoToLength = 2n ** BigInt(length) - for (;;) { - const randomBytes = crypto.randomBytes(numBytes).toString('hex') - const r = BigInt('0x' + randomBytes) % twoToLength - - if (r < max) { - return r - } - } -} diff --git a/ts-simulation/client/utils/web3.ts b/ts-simulation/client/utils/web3.ts deleted file mode 100644 index a4d63ff..0000000 --- a/ts-simulation/client/utils/web3.ts +++ /dev/null @@ -1,123 +0,0 @@ -import { createConnection } from 'net' -import type { TcpNetConnectOpts } from 'net' -import { URL } from 'url' - -import glob from 'glob' -import Web3 from 'web3' -import type { Logger } from 'winston' - -export interface BareSignature { - readonly v: number - readonly r: string - readonly s: string -} - -/** - * Creates and returns a Web3 instance with the specified RPC link. - * @param rpcLink The RPC link to connect to. - * @param logger (Optional) The logger to use for logging WebSocket connection close events. - * @returns A Web3 instance. - */ -export function createWeb3Instance(rpcLink: string, logger?: Logger): Web3 { - let provider - const url = new URL(rpcLink) - if (logger) { - logger.info(`Attempting to connect to provider: ${url.href}`) - } - if (url.protocol === 'http:' || url.protocol === 'https:') { - provider = new Web3.providers.HttpProvider(url.href) - logger?.info(`Connected to HTTP provider: ${url.href}`) - } else if (url.protocol === 'ws:' || url.protocol === 'wss:') { - const netConnectOpts: TcpNetConnectOpts = { - port: Number(url.port), - keepAlive: true, - keepAliveInitialDelay: 60000, - } - const socket = createConnection(netConnectOpts) - provider = new Web3.providers.WebsocketProvider(url.href, socket) - provider.on('open', () => { - if (logger) { - logger.info(`Connected to RPC provider: ${url.href}`) - } - }) - provider.on('close', () => { - if (logger) { - logger.error(`Closed RPC provider connection`) - } - }) - logger?.info(`Connected to WebSocket provider: ${url.href}`) - } - const web3 = new Web3(provider) - return web3 -} - -/** - * Loads a contract of type `ContractType` using the provided `web3` instance, `address`, and `name`. - * - * @param web3 The Web3 instance used to interact with the blockchain. - * @param address The address of the contract. - * @param name The name of the contract. - * @returns A promise that resolves to the loaded contract of type `ContractType`. - * @throws Error if the `address` is not provided. - */ -export async function loadContract( - web3: Web3, - address: string, - name: string -): Promise { - if (!address) throw Error(`Address for ${name} not provided`) - const abiPath = await relativeContractABIPathForContractName(name) - const { abi } = require(`../../artifacts/${abiPath}`) // eslint-disable-line @typescript-eslint/no-var-requires,@typescript-eslint/no-unsafe-assignment - const contract = new web3.eth.Contract(abi, address) - return contract as ContractType -} - -/** - * Retrieves the relative path of the contract ABI file for a given contract name. - * @param name - The name of the contract. - * @param artifactsRoot - The root directory where the contract artifacts are stored. Default is 'artifacts'. - * @returns A promise that resolves to the relative path of the contract ABI file. - * @throws If no files are found for the contract. - */ -async function relativeContractABIPathForContractName( - name: string, - artifactsRoot = 'artifacts' -): Promise { - return new Promise((resolve, reject) => { - glob( - `contracts/**/${name}.sol/${name}.json`, - { cwd: artifactsRoot }, - (er: Error | null, files: string[] | null) => { - if (er) { - reject(er) - } else { - if (files && files.length === 1) { - resolve(files[0] as string) - } else { - reject(Error(`No files found for contract ${name}`)) - } - } - } - ) - }) -} - -/** - * Signs a message using the provided private key and returns the signature. - * @param web3 - The Web3 instance. - * @param message - The message to be signed. - * @param privateKey - The private key used for signing. - * @returns The signature object containing the v, r, and s values. - */ -export function signMessage( - web3: Web3, - message: string, - privateKey: string -): BareSignature { - const signature = web3.eth.accounts.sign(message, privateKey) - return { - v: parseInt(signature.v, 16), - r: signature.r, - s: signature.s, - } -}