Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into modify_market_token_p…
Browse files Browse the repository at this point in the history
…rice
  • Loading branch information
dom-jiang committed Apr 23, 2024
2 parents 44585c0 + 9baad86 commit 5da5ab0
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
20 changes: 20 additions & 0 deletions backends/backend_update_pools_5.sh.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh

pid=`ps -ef | grep "update_pools.py [NETWORK_ID] 5000" | grep -v grep | /usr/bin/awk '{print $2}'`

cd "[CUR_PATH]"

# echo ${pid}
date >> backend_update_pools.log

if [ ! ${pid} ]; then
# echo "is null"
echo "No backend process rubbish to clean." >> backend_update_pools.log
else
# echo "not null"
kill -s 9 ${pid}
echo "Warning: clean backend process of last round." >> backend_update_pools.log
fi
. ../venv/bin/activate
python update_pools.py [NETWORK_ID] 5000 >> backend_update_pools.log
echo 'OK'
29 changes: 29 additions & 0 deletions backends/deploy_backend_update_pools_5.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import sys
sys.path.append('../')
from config import Cfg

if __name__ == '__main__':
cur_path = sys.path[0]
print("Working Path is:", cur_path)

network_id = Cfg.NETWORK_ID

exec_lines = []
tmpl = open("%s/backend_update_pools_5.sh.tmpl" % cur_path, mode='r')
while True:
line = tmpl.readline()
if not line:
break
exec_lines.append(line.replace("[CUR_PATH]", cur_path).replace("[NETWORK_ID]", network_id))
tmpl.close()

target_file = open("%s/backend_update_pools_5.sh" % cur_path, mode='w')
target_file.writelines(exec_lines)
target_file.close()

print("Note: backend_update_pools_5.sh should be generated at that Path, ")
print("please make it excuteable, such as chmod a+x backend_update_pools_5.sh. ")
print("and then put it into crontab for periodically invoke!")
print("Crontab eg: ")
print(" */1 * * * * /working_path/backend_update_pools_5.sh > /dev/null")

15 changes: 15 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,21 @@ class Cfg:
{"SYMBOL": "ANDY", "MD_ID": "andyerc"},
{"SYMBOL": "SEAM", "MD_ID": "seamless-protocol"},
{"SYMBOL": "rsETH", "MD_ID": "kelp-dao-restaked-eth"},
{"SYMBOL": "LEET", "MD_ID": "leetswap-canto"},
{"SYMBOL": "FPI", "MD_ID": "frax-price-index"},
{"SYMBOL": "FPIS", "MD_ID": "frax-price-index-share"},
{"SYMBOL": "ankrETH", "MD_ID": "ankreth"},
{"SYMBOL": "weETH", "MD_ID": "wrapped-eeth"},
{"SYMBOL": "EURA", "MD_ID": "ageur"},
{"SYMBOL": "CRV", "MD_ID": "curve-dao-token"},
{"SYMBOL": "DUSD", "MD_ID": "davos-protocol"},
{"SYMBOL": "MaticX", "MD_ID": "stader-maticx"},
{"SYMBOL": "ZENF", "MD_ID": "zenland"},
{"SYMBOL": "RPL", "MD_ID": "rocket-pool"},
{"SYMBOL": "LYNX", "MD_ID": "lynex"},
{"SYMBOL": "ZETA", "MD_ID": "zetachain"},
{"SYMBOL": "USDV", "MD_ID": "usdv-2"},
{"SYMBOL": "ORBIT", "MD_ID": "orbit-protocol"},
],
}
MARKET_URL = MARKET_URL
Expand Down

0 comments on commit 5da5ab0

Please sign in to comment.