VolumeFi / paloma

The fast blockchain messenger protocol
Apache License 2.0
3 stars 2 forks source link

Update momentum_cache periodically #127

Closed fieldtheory123 closed 1 year ago

fieldtheory123 commented 1 year ago

Background

_We have a SQlite DB momentumcache.db on our server and we need to update it every 3 hours. _Need to set up a cronjob or equivalent tools to run https://github.com/VolumeFi/trading-bots/blob/main/run_momentum_table.py_ _Each update requires running run_momentum_table.py with multiple parameter combinations, including all DEXes we cover, lag = 6,12. The last three parameters can be fixed at 100000 100000 1000000 for now.

Example: $ python run_momentum_table.py uniswap_v3 12 100000 100000 1000000 $ python run_momentum_table.py pancakeswap_new 6 100000 100000 1000000

Done when

rootedbox commented 1 year ago

this is now on rootedbox@snapshot:~/app/trading-bots and set to run with cron every 3 hours

fieldtheory123 commented 1 year ago

I see that the .db file is there but

  1. the script is not run every 3 hours
  2. there's only one combination ingested to the db (see text below). We need to run all combinations mentioned in the ticket

('get_high_returns(uniswap_v2, 12, 200000, 100000, 1000000)', '2023-04-25 04:14:27', '{"24H Return":{"agility":36.0971196898,"0x0-ai-ai-smart-contract":18.5154601436,"not-financial-advice":6.0320409808,"floki":42.0514636747,"airtor-protocol":3.7456967714,"dione":6.4370823072,"audius":2.2696526253,"cuminu":37.9397767011,"pax-gold":0.6709357452,"usd-coin":0.0774584113,"a-hunters-dream":3.8935349985,"tether":0.0448755672},"7D Return":{"agility":-62.90527,"0x0-ai-ai-smart-contract":51.15328,"not-financial-advice":45.92771,"floki":8.94063,"airtor-protocol":-27.06862,"dione":59.99923,"audius":-17.14702,"cuminu":-23.98085,"pax-gold":-1.00449,"usd-coin":0.0959,"a-hunters-dream":-17.99088,"tether":-0.05696},"12H Return":{"agility":42.4,"0x0-ai-ai-smart-contract":16.19,"not-financial-advice":12.09,"floki":10.85,"airtor-protocol":5.69,"dione":5.66,"audius":1.23,"cuminu":0.78,"pax-gold":0.4,"usd-coin":0.24,"a-hunters-dream":0.1,"tether":0.01}}')

fieldtheory123 commented 1 year ago

@rootedbox DB is not being updated

rootedbox@snapshot:~/app/trading-bots$ ls -ltr total 212 -rw-rw-r-- 1 rootedbox rootedbox 1071 Apr 11 00:53 LICENSE.md -rw-rw-r-- 1 rootedbox rootedbox 7552 Apr 17 16:40 MomentumScanner.py -rw-rw-r-- 1 rootedbox rootedbox 65058 Apr 17 16:40 exchanges.json -rw-rw-r-- 1 rootedbox rootedbox 816 Apr 17 16:40 dex_chain.json -rw-rw-r-- 1 rootedbox rootedbox 757 Apr 25 01:28 run_momentum_table.py -rw-rw-r-- 1 rootedbox rootedbox 516 Apr 25 01:28 pyproject.toml -rw-rw-r-- 1 rootedbox rootedbox 34394 Apr 25 01:28 poetry.lock -rw-rw-r-- 1 rootedbox rootedbox 11141 Apr 25 01:28 MomentumScanner_techindicator.py -rw-rw-r-- 1 rootedbox rootedbox 0 Apr 25 01:28 init.py -rw-rw-r-- 1 rootedbox rootedbox 801 Apr 25 01:28 cache_db.py -rw-rw-r-- 1 rootedbox rootedbox 1545 Apr 26 04:01 README.md -rwxrwxr-x 1 rootedbox rootedbox 2946 Apr 26 04:20 getdata.sh -rw-rw-r-- 1 rootedbox rootedbox 8222 Apr 26 04:31 momentum_scanner_intraday.py drwxrwxr-x 2 rootedbox rootedbox 4096 Apr 26 04:31 pycache -rw-rw-r-- 1 rootedbox rootedbox 2 Apr 26 04:34 data.json -rw-r--r-- 1 rootedbox rootedbox 36864 Apr 26 04:34 momentum_cache.db -rw-rw-r-- 1 rootedbox rootedbox 141 Apr 26 12:00 test.py