From 4aa0609146517c186e29b27aa432b83154175a86 Mon Sep 17 00:00:00 2001 From: dom-jiang <805816775@.qq.com> Date: Thu, 18 Apr 2024 11:18:44 +0800 Subject: [PATCH 1/4] add token price by dapdap --- config.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/config.py b/config.py index 10f8190..703e7a4 100644 --- a/config.py +++ b/config.py @@ -497,6 +497,18 @@ 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"}, ], } MARKET_URL = "pro-api.coingecko.com" From 0c2a9698961bc155ba4ec3593d316fb0869f44ee Mon Sep 17 00:00:00 2001 From: dom-jiang <805816775@.qq.com> Date: Fri, 19 Apr 2024 11:25:11 +0800 Subject: [PATCH 2/4] add pool tasks --- backends/backend_update_pools_5.sh.tmpl | 20 ++++++++++++++++ backends/deploy_backend_update_pools_5.py | 29 +++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 backends/backend_update_pools_5.sh.tmpl create mode 100644 backends/deploy_backend_update_pools_5.py 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") + From 5e52012c898178b4a9a21c2d3eea355511b56d4d Mon Sep 17 00:00:00 2001 From: dom-jiang <805816775@.qq.com> Date: Fri, 19 Apr 2024 17:55:30 +0800 Subject: [PATCH 3/4] add token price by dapdap --- config.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config.py b/config.py index 703e7a4..0a4aa47 100644 --- a/config.py +++ b/config.py @@ -509,6 +509,8 @@ class Cfg: {"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"}, ], } MARKET_URL = "pro-api.coingecko.com" From 0731c8b6cfc3a28d084f6aa35f2b374b8f2fffa7 Mon Sep 17 00:00:00 2001 From: dom-jiang <805816775@.qq.com> Date: Tue, 23 Apr 2024 17:17:16 +0800 Subject: [PATCH 4/4] add ORBIT token price by dapdap --- config.py | 1 + 1 file changed, 1 insertion(+) diff --git a/config.py b/config.py index 0a4aa47..dc8ccb5 100644 --- a/config.py +++ b/config.py @@ -511,6 +511,7 @@ class Cfg: {"SYMBOL": "LYNX", "MD_ID": "lynex"}, {"SYMBOL": "ZETA", "MD_ID": "zetachain"}, {"SYMBOL": "USDV", "MD_ID": "usdv-2"}, + {"SYMBOL": "ORBIT", "MD_ID": "orbit-protocol"}, ], } MARKET_URL = "pro-api.coingecko.com"