Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A tiny command line tool for regular investment of cryptocurrencies on centralized exchanges using dollar-cost averaging.
A tiny command line tool for regular investment of cryptocurrencies on exchanges around the world.
This module provides a simple command line interface to make regular investments in various cryptocurrency pairs that are traded on different exchanges around the world.
Install by pipx:
pipx install doru
Add a credential:
$ doru cred add
# interactive prompts
Exchange: binance
Key: hogehoge
Secret: hogehoge
Add a regular investment task:
$ doru add
# interactive prompts
Exchange: binance
Symbol: BTC/USDT
Cycle (Daily, Weekly, Monthly): Daily
Time [00:00]: 12:00
Amount: 10000
Start [True]: True
Display a list of regular investment tasks:
$ doru list
ID Symbol Amount Cycle Next Invest Date Exchange Status
------------ -------- -------- ------- ------------------ ---------- --------
JtynLAJL74A5 BTC/USDT 10000 Daily 2023-03-20 12:00 binance Running
Gaye3E8PIJkl ETH/BTC 0.01 Weekly Not Scheduled kraken Stopped
PfavioXafCL1 ETH/USDC 20000 Monthly 2023-04-01 00:00 kucoin Running
In order to purchase cyrptocurrencies on an exchange, you will need an API key and secret that authorizes you to purchase cryptocurrencies. The procedure for issuing them varies from exchange to exchange, so please check the website of the exchage you want to use.
The following shows how to register or delete the API key and secret in this module.
Add interactively:
$ doru cred add
Exchange: <exchange name>
Key: <API key>
Secret: <API secret>
Add with options:
$ doru cred add -e <exchange name> -k <API key> -s <API secret>
Remove interactively:
$ doru cred remove
Exchange: <exchange name>
Remove with options:
$ doru cred remove -e <exchange name>
How to add, start, stop and delete tasks to buy cryptocurrency is described below.
The following command is used to add a regular cryptocurrency investment task.
$ doru add
The following options can be specified.
Option | Detail | Available values | Default value | Required |
---|---|---|---|---|
-e, --exchange | Exchange name e.g. binance, coinbase | Depends on ccxt | - | ✅ |
-s, --symbol | Symbol name e.g. BTC/USDT, ETH/BTC | Depends on the exchange you use | - | ✅ |
-c, --cycle | Purchase cycle | Daily, Weekly, Monthly | - | ✅ |
-a, --amount | Per purchase amount e.g. Specify 10,000 if you want to buy 10,000 USDT worth of BTC/USDT each time. | more than 0 | - | ✅ |
-w, --weekday | Day of the week to buy crypto Valid only when the cycle is weekly. | Sun, Mon, Tue, Wed, Thu, Fri, Sat | Sun | |
-d, --day | Date to buy crypto Valid only when the cycle is monthly. | from 1 to 28 | 1 | |
-t, --time | Time to buy crypto hh:mm format | 00:00 ~ 23:59 | 00:00 | |
--start | Whether to start periodic purchase at the same time the task is added. If false, cyrpto won't be purchased until you explicitly start the task. | True / False | True |
Daily task:
Add interactively:
$ doru add
# interactive prompts
Exchange: <exchange name>
Symbol: <symbol name>
Cycle (Daily, Weekly, Monthly): Daily
Time [00:00]: <time>
Amount: <currency amount>
Start [True]: <True or False>
Add with options:
$ doru add -e <exchange name> \
-s <symbol name> \
-c Daily \
-t <time> \
-a <currency amount>
Weekly task:
$ doru add
# interactive prompts
Exchange: <exchange name>
Symbol: <symbol name>
Cycle (Daily, Weekly, Monthly): Weekly
Weekday (Sun, Mon, Tue, Wed, Thu, Fri, Sat) [Sun]: <weekday>
Time [00:00]: <time>
Amount: <currency amount>
Start [True]: <True or False>
Monthly task:
$ doru add
# interactive prompts
Exchange: <exchange name>
Symbol: <symbol name>
Cycle (Daily, Weekly, Monthly): Monthly
Day [1]: <day>
Time [00:00]: <time>
Amount: <currency amount>
Start [True]: <True or False>
$ doru list
ID Symbol Amount Cycle Next Invest Date Exchange Status
------------ -------- -------- ------- ------------------ ---------- --------
JtynLAJL74A5 BTC/USDT 10000 Daily Not Scheduled binance Stopped
Gaye3E8PIJkl ETH/BTC 0.01 Weekly 2023-03-26 09:00 kraken Running
PfavioXafCL1 ETH/USDC 20000 Monthly 2023-04-01 00:00 kucoin Running
You can start (schedule) the purchase of cyrptocurrency by specifying the ID of the task.
Multiple IDs can be specified by separating them with a space.
The IDs can be found in the result of the command doru list
.
$ doru start <ID1> <ID2> ....
If you want to start all tasks, you can use the --all
option to start all tasks.
$ doru start --all
You can stop the purchase of cyrptocurrency by specifying the ID of the task.
Multiple IDs can be specified by separating them with a space.
The IDs can be found in the result of the command doru list
.
$ doru stop <ID1> <ID2> ....
If you want to stop all tasks, you can use the --all
option to stop all tasks.
$ doru stop --all
$ doru remove <ID>
This tool is handled by the daemon process running behind the command line interface.
It is not normally necessary to start and stop the daemon manually. However, if you need to restart it after an unexpected error, or if you want to edit and reload a configuration file directly, this interface is useful.
$ doru daemon up
$ doru daemon down
The following environmental variables are used in this module.
The Values can be changed to suit your environment.
Variable name | Detail | Default value |
---|---|---|
DORU_SOCK_NAME | The path of the UNIX domain socket to which the daemon process will bind | ~/.doru/run/doru.sock |
DORU_PID_FILE | The path of the daemon's PID file | ~/.doru/run/doru.pid |
DORU_CREDENTIAL_FILE | Credentials file path | ~/.doru/credential.json |
DORU_TASK_FILE | File path to store information about cryptocurrency buying tasks. | ~/.doru/task.json |
DORU_LOG_FILE | Log file path | ~/.doru/log/doru.log |
DORU_TASK_LIMIT | Maximum number of tasks that can run simultaneously. (not the maximum number of tasks that can be added) | 50 |
After cloning the repository, execute the following command.
$ tox
NOTE:
Some tests send requests to real exchanges, which may cause the test to fail due to exchange maintenance or other reasons. In the future, the dependency on exchanges will be removed using mock.
Welcome issues and pull requests for reasons such as not knowing how to use this module, finding a bug, or suggesting a new feature.
FAQs
A tiny command line tool for regular investment of cryptocurrencies on centralized exchanges using dollar-cost averaging.
We found that doru demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.