Package: doru
DoruA 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.Getting StartedInstallationInstall bypipx:pipxinstalldoruExampleAdd a credential:$dorucredadd# interactive promptsExchange:binance
Key:hogehoge
Secret:hogehogeAdd a regular investment task:$doruadd# interactive promptsExchange:binance
Symbol:BTC/USDT
Cycle(Daily,Weekly,Monthly):Daily
Time[00:00]:12:00
Amount:10000Start[True]:TrueDisplay a list of regular investment tasks:$dorulist
IDSymbolAmountCycleNextInvestDateExchangeStatus
-----------------------------------------------------------------------
JtynLAJL74A5BTC/USDT10000Daily2023-03-2012:00binanceRunning
Gaye3E8PIJklETH/BTC0.01WeeklyNotScheduledkrakenStopped
PfavioXafCL1ETH/USDC20000Monthly2023-04-0100:00kucoinRunningUsageCredentialIn 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 credentialAdd interactively:$dorucredadd

Exchange:<exchangename>
Key:<APIkey>
Secret:<APIsecret>Add with options:$dorucredadd-e<exchangename>-k<APIkey>-s<APIsecret>Remove credentialRemove interactively:$dorucredremove

Exchange:<exchangename>Remove with options:$dorucredremove-e<exchangename>Cryptocurrency taskHow to add, start, stop and delete tasks to buy cryptocurrency is described below.Add a task to buy cryptocurrencies regularlyThe following command is used to add a regular cryptocurrency investment task.$doruaddThe following options can be specified.OptionDetailAvailable valuesDefault valueRequired-e, --exchangeExchange namee.g. binance, coinbaseDepends onccxt-✅-s, --symbolSymbol namee.g. BTC/USDT, ETH/BTCDepends on the exchange you use-✅-c, --cyclePurchase cycleDaily, Weekly, Monthly-✅-a, --amountPer purchase amounte.g. Specify 10,000 if you want to buy 10,000 USDT worth of BTC/USDT each time.more than 0-✅-w, --weekdayDay of the week to buy cryptoValid only when the cycle is weekly.Sun, Mon, Tue, Wed, Thu, Fri, SatSun-d, --dayDate to buy cryptoValid only when the cycle is monthly.from 1 to 281-t, --timeTime to buy cryptohh:mmformat00:00 ~ 23:5900:00--startWhether 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 / FalseTrueDaily task:Add interactively:$doruadd# interactive promptsExchange:<exchangename>
Symbol:<symbolname>
Cycle(Daily,Weekly,Monthly):Daily
Time[00:00]:<time>
Amount:<currencyamount>
Start[True]:<TrueorFalse>Add with options:$doruadd-e<exchangename>\-s<symbolname>\-cDaily\-t<time>\-a<currencyamount>Weekly task:$doruadd# interactive promptsExchange:<exchangename>
Symbol:<symbolname>
Cycle(Daily,Weekly,Monthly):Weekly
Weekday(Sun,Mon,Tue,Wed,Thu,Fri,Sat)[Sun]:<weekday>
Time[00:00]:<time>
Amount:<currencyamount>
Start[True]:<TrueorFalse>Monthly task:$doruadd# interactive promptsExchange:<exchangename>
Symbol:<symbolname>
Cycle(Daily,Weekly,Monthly):Monthly
Day[1]:<day>
Time[00:00]:<time>
Amount:<currencyamount>
Start[True]:<TrueorFalse>Check the list of tasks$dorulist
IDSymbolAmountCycleNextInvestDateExchangeStatus
-----------------------------------------------------------------------
JtynLAJL74A5BTC/USDT10000DailyNotScheduledbinanceStopped
Gaye3E8PIJklETH/BTC0.01Weekly2023-03-2609:00krakenRunning
PfavioXafCL1ETH/USDC20000Monthly2023-04-0100:00kucoinRunningStart tasksYou 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 commanddoru list.$dorustart<ID1><ID2>....If you want to start all tasks, you can use the--alloption to start all tasks.$dorustart--allStop tasksYou 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 commanddoru list.$dorustop<ID1><ID2>....If you want to stop all tasks, you can use the--alloption to stop all tasks.$dorustop--allRemove a task$doruremove<ID>DaemonThis 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.Daemon Process Up$dorudaemonupDaemon Process Down$dorudaemondownEnvironmental variablesThe following environmental variables are used in this module.The Values can be changed to suit your environment.Variable nameDetailDefault valueDORU_SOCK_NAMEThe path of the UNIX domain socket to which the daemon process will bind~/.doru/run/doru.sockDORU_PID_FILEThe path of the daemon's PID file~/.doru/run/doru.pidDORU_CREDENTIAL_FILECredentials file path~/.doru/credential.jsonDORU_TASK_FILEFile path to store information about cryptocurrency buying tasks.~/.doru/task.jsonDORU_LOG_FILELog file path~/.doru/log/doru.logDORU_TASK_LIMITMaximum number of tasks that can run simultaneously.(not the maximum number of tasks that can be added)50SpecificationThis module depends on theccxtlibrary.Supported exchangesCheckccxt.If you enter an unsupported exchange name, you will get an error message that indicates which exchanges are supported.Supported symbolsCheck the exchange documentation.If you enter an unsupported symbol, you will get an error message which lists the symbols supported by the exchange.Support only SPOT typeThe order price is basically the bid price obtained from the exchange API. Some exchanges (or symbols) do
not provide bid prices, in which case the closing price of the last ticker is used.Wait 10 minutes for each order to execute.If the order is not executed within 10 minutes, it will be canceled and retried (up to 5 retries).However, to prevent duplicate orders, an order will not be retried even if it does not execute in the following cases.If the order cancellation failsIf the order status cannot be retrieved and is unknown (for example, due to network problems or maintenance)TestsAfter cloning the repository, execute the following command.$toxNOTE: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.ContributingWelcome issues and pull requests for reasons such as not knowing how to use this module,
finding a bug, or suggesting a new feature.