> For the complete documentation index, see [llms.txt](https://cindicator.gitbook.io/stoic-ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cindicator.gitbook.io/stoic-ai/support/faq/how-are-returns-calculated-if-i-add-or-withdraw-funds.md).

# How are returns calculated if I add or withdraw funds?

The returns for your portfolio are always calculated using a ***time-weighted rate of return***. This is to avoid distorting performance due to deposits or withdrawals.

You can learn more about the time-weighted rate of return from [**this article on Investopedia**](https://www.investopedia.com/terms/t/time-weightedror.asp#:~:text=The%20time%2Dweighted%20rate%20of,inflows%20and%20outflows%20of%20money.).

Essentially to calculate the return for your portfolio, we calculate the return for each sub-period and then multiply these returns.

> Example:
>
> Alice put in $1000 during the first month and gains 10%. She then decides to put in another $2000 and gains 5% during the second month. Her ending balance is $3255.
>
> Bob also put in $1000 at the same time and gained 10%. He then decided to take the profit and withdrew $100. During the second month, he gained 5%. His ending balance is $1050.
>
> Their end results are different, yet the performance is the same. The returns should reflect that.
>
> So to calculate time-weighted rate of return, we just multiply (1 + 0.1) \* (1 + 0.05) - 1 = 0.155 or 15.5%
