To help you better understand your profit/loss in the SwissBorg app, here you can find the explanations and calculations for the different types of transactions.
Total Profit/Loss is the combined amount of Unrealised and Realised Profit/Loss after fees have been subtracted.
Unrealised Profit/Loss is made by buying a crypto asset that gains or loses value, and will become Realised Profit/Loss when you sell the crypto asset.
Realised Profit/Loss is the profit or loss you make when you buy a crypto asset, and then exchange it again after it has gained or lost value.
Effective time: time when the transaction is credited to the user's balance.
Rate time: exchange rate at the time of the transaction.
Formulas
AverageBoughtPrice = (previous_average_boughtPrice * previous_balance + bought_price * bought_amount) / (previous_balance + bought_amount)
Unrealised = balance * (currentPrice - averageBoughtPrice)
Realised = previous_realised + soldAmount * (soldPrice - averageBoughtPrice)
Total = realised + unrealised - fees
Deposit
Considered as "bought <asset>"
Effective time: As soon as it is transferred to the user (pending deposit is not counted in the balance)
Rate time: Time when it gets pending status
Deposits in the display currency are ignored in the Profit/Loss, because Profit/Loss in the display currency is always 0 - fees.
Withdrawal
Considered as sold <asset>
Withdrawal: Pending time (pending withdrawal are already removed from the balance)
Withdrawal: Time when it gets pending status
Withdrawals in the display currency are ignored in the P&L (P&L in display currency is always 0 - fees)
Exchanges
from X → display currency : sells X
from display currency → X : buys X
from X → Y : sells X & buys Y
Example
displayCurrency = EUR
Deposit
For example, you make a deposit of 10 CHSB and the rate is 1 EUR/CHSB.
CurrentPrice = 15 EUR / CHSB
=>
Balance = 10 CHSB
averageBoughtPrice 1 EUR/CHSB
Unrealised = 10 * (15 - 1 ) = 140 EUR
Realised = 0
Then you make a second deposit of 20 CHSB at a rate of 2 EUR/CHSB.
currentPrice = 16 EUR/CHSB
=>
Balance = 30 CHSB
averageBoughtPrice = (10*1+20*2)/ (10+20) = 1.666667 EUR/CHSB
unrealised = 30 * ( 16 - 1.666667) = 430 EUR
Realised = 0
Withdrawals
Now you make a withdrawal of 10 CHSB.
soldPrice = 15 EUR / CHSB
currentPrice = 21 EUR / CHSB
=>
Balance = 20 CHSB
realised = 0 + 10 * (15 - 1.666667) = 133,33333 EUR
unrealised = 20 * (21 - 1.666667) = 386,66666 EUR
Next, you make another withdrawal of 5 CHSB.
soldPrice = 22 EUR / CHSB
currentPrice = 25 EUR / CHSB
=>
Balance = 15 CHSB
realised = 133,33333 + 5 * (22 - 1.666667) = 235 EUR
unrealised = 15 * (25 - 1.66667) = 350 EUR
Exchange
<asset1> → Display currency
Exchange 1 CHSB → 30 EUR
= sells 1 CHSB rate 30 EUR/CHSB
current price = 31 EUR/CHSB
=>
Balance = 14 CHSB
Realised = 235 + 1 * (30 - 1.66667) = 263,33333 EUR
unrealised = 14 * (31 - 1.66667) =410,66662
Display currency → <asset1>
Exchange 25 EUR → 1 CHSB
= buys 1 CHSB rate 25 EUR CHSB
current price = 28 EUR/CHSB
=>
Balance = 15 CHSB
AverageBoughtPrice = (1.66667 * 14 + 25 * 1) / (14+1
= 3,222 EUR
Realised = 263,33333 EUR
unrealised = 15 * (28 - 3,222) = 371,67
<asset1> → <asset2>
Exchange 2 CHSB → 1 BTC
Bought time rates:
30 EUR/ CHSB
EUR/ BTC = (EUR/ CHSB ) / (BTC / CHSB)
= 30 / 0.5
= 60 EUR / BTC
= buys 1 BTC rate 60 EUR/BTC
& sells 2 CHSB rate 30 EUR/CHSB
Current prices:
23 EUR/ CHSB
46 EUR / BTC
=>
Balances = 13 CHSB ; 1 BTC
AverageBoughtPrice_ BTC = 60 EUR
AverageBoughtPrice_ CHSB = 3,222 EUR
Realised_CHSB = 263,33333 + 2 (30 - 3,222) = 316,89 EUR
unrealised_CHSB = 13 * (23 - 3,222) = 257,114 EUR
Realised_BTC = 0
unrealised_BTC = 1 * (46 - 60) = -14 EUR
Gifts & earnings
Gifts always have a 0 rate (except the ICO refunds), not the rate at which they were received. Therefore, they are always counted as profit and not as a deposit.
Example:
Gift: 10 CHSB
Rate at the time of the deposit: 30 EUR/CHSB
Current price : 10 EUR/CHSB
- Counted as deposit
unrealised = 10 * (10 - 30 ) = -200
- Counted as always profit (rate 0)
unrealised = 10 * (10 - 0 ) = 100
Comments
0 comments
Article is closed for comments.