Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time
Usage: hodl-cli [OPTIONS]

  Dollar-cost averaging for crypto on the command line using Coinbase Pro.

  When run, hodl-cli will check whether a deposit needs to be made and, if
  so, initiate the deposit using a linked bank account.

  Then, if there is enough available fiat in the Pro account, hodl-cli will
  buy currencies using the specified fiat amount, given a user-specified
  asset allocation. Currencies are traded at market price at the time the
  script is run.

  hodl-cli is meant to be run as a cron. The cron can be run at any interval
  less than the `interval` -- I recommend daily. The script will ensure that
  deposits and buys are only made every `interval` days irrespective of how
  often it is run. This is done by searching account  history in the past
  `interval` days and ensuring that no deposit or buy for a given amount has
  been executed.

  hodl-cli does *not* protect against concurrency issues. Please make sure
  that only one instance of hodl-cli is running at a time to prevent
  duplicate deposits and buys (PRs welcome).

  In addition to the CLI options, a few environment variables must be



      pip install hodl-cli

  Example usage:

      export COINBASE_PRO_API_KEY=<your_api_key>
      export COINBASE_PRO_API_SECRET=<your_api_secret>
      export COINBASE_PRO_PASSPHRASE=<your_passphrase>
      hodl-cli -i 15 -d 100.00 -b 95.00 -a LTC 0.10 -a ETH 0.60 -a BTC 0.30


      The above invocation will deposit $100.00 every 15 days. In addition,
      if the Pro account has $95.00 available to trade, $95.00 will used to
      buy other currencies as follows:

      10% will be used to buy LTC
      60% will be used to buy ETH
      30% will be used to buy BTC

  -n, --deposit-account TEXT      Name string used to filter multiple bank
                                  accounts. If not specified, the first
                                  account found with `deposit-account-type` is

  -t, --deposit-account-type TEXT
                                  Account type used in conjunction with
                                  `deposit-account` to find an account from
                                  which to deposit fiat.  [default:

  -d, --deposit-amount DECIMAL    Amount to deposit every `interval` days.
                                  [default: 0.00]

  -i, --interval INTEGER          Interval in days after which a deposit
                                  and/or buy should be made.  [default: 15]

  -b, --buy-amount DECIMAL        The amount of fiat to allocate every
                                  `interval` days.  [default: 0.00]

  -a, --allocation-percentage <TEXT DECIMAL>...
                                  A currency and the percentage of available
                                  funds that should be allocated to it. This
                                  option may be provided multiple times for
                                  different currencies and the total
                                  percentage should add up to 1. If the total
                                  percentage is less than one, the remainder
                                  will be left as fiat.
                                  Example: -a ETH 0.25 -a BTC 0.25 -a LTC 0.5

  --dry-run                       When present, print what we would have done
                                  but don't actually deposit or buy anything

  -v, --verbose                   When present, print debug logs.
  -h, --help                      Show this message and exit.


Dollar-cost averaging for crypto on the command line using Coinbase Pro.







No packages published