Given:
- a portfolio with only two assets (A and B)
- they respective balances (BalanceA and BalanceB)
the function $C_{AtoB}$ that converts A into B:
- $C_{AtoB}(x, q, cr) = x(1 - cr)q$, where
- x = the amount of Asset A to be convert
- q = the quotation of Asset A
- cr = the convertion rate cost
- $C_{AtoB}(x, q, cr) = x(1 - cr)q$, where
a target ratio between the values of Asset A and Asset B named $Tr$
- a scenario where:
$$ \frac{C_{AtoB}(Balance_A, q, cr)}{Balance_B + C_{AtoB}(Balance_A, q, cr)} > Tr$$
How to calculate the value X of asset A to be converted into asset B in order to the expression below become true?
$$ \frac{C_{AtoB}(Balance_A - X, q, cr)}{Balance_B + C_{AtoB}(Balance_A - X, q, cr)} = Tr$$
After solve the equation I found this:
$$X = \frac{Tr.Balance_B}{(1 - cr).q.(Tr - 1)} + Balance_A$$
But I am getting exactly the double of what I was expecting and I am not understanding why.