Dollar-cost averaging (DCA) is a strategy used by investors to reduce downside risk of placing large sums of money into the market at one time.

While this can be in the form of purchasing a single asset on a regular interval, we will be focusing on the strategy from the portfolio perspective. Considering it as a way to regularly inject new funds into a portfolio.

A dollar-cost averaging strategy will effectively distribute the injected funds across the portfolio based on a set list of target allocations.

How it Works

To better understand this strategy, let’s break down each of the steps which take place during a dollar-cost averaging event.

Deposit Detection

DCA will execute only when a deposit is detected. On a regular 15-minute interval, we can evaluate if new funds have been added to the portfolio. Once a deposit is detected, a DCA is triggered.

Upon the time of deposit detection, we will record the amount of the asset which was deposited. The DCA will only use these deposited funds to execute trades in the following steps.

Note: Executing trades on the exchange outside of Shrimpy is considered a deposit for the traded assets. This will trigger a DCA! If you plan on trading directly on the exchange, disable DCA until at least 15 minutes since your last trade.

Allocating Funds

Now that the deposit has been detected, we will take the funds which were deposited and evaluate how to distribute them for the dollar-cost averaging strategy. No other assets or funds will be moved during the execution of the DCA.

Based on the current allocations of our portfolio and the corresponding target allocations, we can calculate how much of the deposited funds should go to each of the assets in the portfolio to reach our target allocations.

Note: It may not be possible to reach our target allocations with the deposited funds. In this case, we will distribute the funds proportionally to the amount which is owed to each asset. For example, if we have 4 BTC to distribute but two assets which require 2 BTC and 3 BTC respectively to reach their target allocations, we will distribute 2/5 x 4 = 1.6 BTC to the first asset and 3/5 x 4 = 2.4 BTC to the second asset.

Trade Execution

Once the desired trades have been calculated, each individual trade will be executed to build the target portfolio. Any funds which are left over at the end of the DCA due to failed trades or minimum trade limits will be left in the deposited asset.