Skip to content

Commit

Permalink
Move relayer inventory config to external json file (#45)
Browse files Browse the repository at this point in the history
### What was the problem?

This PR resolves LISK-885.

### How was it solved?

- [x] Instead of using `RELAYER_INVENTORY_CONFIG` variable which has
`json` string, `RELAYER_EXTERNAL_INVENTORY_CONFIG` is used containing
file path to `json` file with a relayer inventory config.

### How was it tested?

Run `yarn relay --wallet void --address <ADDRESS>`, after setting
`RELAYER_EXTERNAL_INVENTORY_CONFIG` variable in `.env` file.
  • Loading branch information
matjazv authored and sameersubudhi committed Sep 10, 2024
1 parent 8c76058 commit e5e56a0
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
41 changes: 41 additions & 0 deletions config/mainnet/relayerExternalInventory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"wrapEtherTarget": 0.1,
"wrapEtherThreshold": 0.125,
"wrapEtherTargetPerChain": {
"1": 1
},
"wrapEtherThresholdPerChain": {
"1": 2
},
"tokenConfig": {
"WETH": {
"1": {
"targetPct": 100,
"thresholdPct": 100,
"unwrapWethThreshold": 0.5,
"unwrapWethTarget": 1
},
"1135": {
"targetPct": 30,
"thresholdPct": 10,
"unwrapWethThreshold": 0.025,
"unwrapWethTarget": 0.1,
"targetOverageBuffer": 1.5
}
},
"LSK": {
"1135": {
"targetPct": 30,
"thresholdPct": 10,
"targetOverageBuffer": 2.5
}
},
"USDT": {
"1135": {
"targetPct": 30,
"thresholdPct": 10,
"targetOverageBuffer": 1.5
}
}
}
}
2 changes: 1 addition & 1 deletion scripts/runMainnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ echo "REDIS_URL='redis://127.0.0.1:6379'" >> ${app_dir}/.env
# Supported token settings
echo RELAYER_TOKENS=\'[\"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2\", \"0x6033F7f88332B8db6ad452B7C6D5bB643990aE3f\", \"0xdAC17F958D2ee523a2206206994597C13D831ec7\"]\' >> ${app_dir}/.env
echo MIN_DEPOSIT_CONFIRMATIONS=\'{\"5000\": { \"1\": 5, \"1135\": 10 }, \"2000\": { \"1\": 4, \"1135\": 10 }, \"100\": { \"1\": 3, \"1135\": 10 } }\' >> ${app_dir}/.env
echo RELAYER_INVENTORY_CONFIG=\'{ \"wrapEtherTarget\": 0.1, \"wrapEtherThreshold\": 0.125, \"wrapEtherTargetPerChain\": { \"1\": 1 }, \"wrapEtherThresholdPerChain\": { \"1\": 2 }, \"tokenConfig\": { \"WETH\": { \"1\": { \"targetPct\": 100, \"thresholdPct\": 100, \"unwrapWethThreshold\": 0.5, \"unwrapWethTarget\": 1 }, \"1135\": { \"targetPct\": 30, \"thresholdPct\": 10, \"unwrapWethThreshold\": 0.025, \"unwrapWethTarget\": 0.1, \"targetOverageBuffer\": 1.5 }}, \"LSK\": { \"1135\": { \"targetPct\": 30, \"thresholdPct\": 10, \"targetOverageBuffer\": 2.5 }}, \"USDT\": { \"1135\": { \"targetPct\": 30, \"thresholdPct\": 10, \"targetOverageBuffer\": 1.5 }}}}\' >> ${app_dir}/.env
echo RELAYER_EXTERNAL_INVENTORY_CONFIG=\'config/mainnet/relayerExternalInventory.json\' >> ${app_dir}/.env

echo "All env vars are set."

Expand Down

0 comments on commit e5e56a0

Please sign in to comment.