diff --git a/backends/backend_update_pools_5.sh.tmpl b/backends/backend_update_pools_5.sh.tmpl new file mode 100644 index 0000000..fc9bce3 --- /dev/null +++ b/backends/backend_update_pools_5.sh.tmpl @@ -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' \ No newline at end of file diff --git a/backends/deploy_backend_update_pools_5.py b/backends/deploy_backend_update_pools_5.py new file mode 100644 index 0000000..7cea171 --- /dev/null +++ b/backends/deploy_backend_update_pools_5.py @@ -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") + diff --git a/config.py b/config.py index 9bdebce..a27fe9c 100644 --- a/config.py +++ b/config.py @@ -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