-
Notifications
You must be signed in to change notification settings - Fork 111
71 lines (66 loc) · 2.33 KB
/
plugin_backtester.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Plugin backtester
on:
workflow_dispatch:
inputs:
contractName:
description: 'Plugin to test'
required: true
type: string
default: CTokenFiatCollateral
arguments:
description: 'Contract constructor arguments'
required: true
type: string
default: |
[
{
"priceTimeout": "604800",
"chainlinkFeed": "0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6",
"oracleError": "2500000000000000",
"erc20": "0x39AA39c021dfbaE8faC545936693aC917d5E7563",
"maxTradeVolume": "1000000000000000000000000",
"oracleTimeout": "86460",
"targetName": "0x5553440000000000000000000000000000000000000000000000000000000000",
"defaultThreshold": "12500000000000000",
"delayUntilDefault": "86400"
},
"0",
"0x95Af143a021DF745bc78e845b54591C53a8B3A51"
]
blocksBetweenSamples:
description: 'Number of blocks to go back from current block. Use 1 for accurate but slow tests, and higher numbers for fast estimates.'
required: true
type: number
default: 300 # translates to 1 sample pr hour for mainnet
numberOfSamples:
description: 'Number of samples to take.'
required: true
type: number
default: 1000 # if blocksBetweenSamples it roughly translates to 41 days of history
jobs:
run_backtests:
env:
CONTRACT_NAME: ${{ inputs.contractName }}
CONSTRUCTOR_PARAMETERS: ${{ inputs.arguments }}
SAMPLES: ${{ inputs.numberOfSamples }}
STRIDE: ${{ inputs.blocksBetweenSamples }}
BACKTEST_SERVICE_URL: ${{ secrets.BACKTEST_SERVICE_URL }}
MAINNET_RPC_URL: https://eth-mainnet.alchemyapi.io/v2/${{ secrets.ALCHEMY_MAINNET_KEY }}
BACKTEST_RESULT_DIR: "backtests/"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'yarn'
- run: yarn install --immutable
- run: yarn compile
- run: yarn run:backtests
- name: Archive backtest results
uses: actions/upload-artifact@v3
with:
name: backtest-data
path: backtests/