# Understanding cryptocurrency buying and selling calculations

I need to understand how buying / selling works in crypto markets.

I see an `ask` of `amount: 44608.01, rate: 0.98` in the XRP/USD market in Kraken.

1. Will the rate `0.98` be in USD or XRP? I'm assuming USD for now.
2. If I buy `44608.01 XRP/USD @ USD 0.98`, I have `USD 43715.8498`, correct?
3. If I sell `43715.8498 XRP/USD @ USD 1.13`, how many XRPs do I have?

`43715.8498 / 1.13 = 38686.5927433628` ?

4. If my above assumptions are correct, have I then lost `44608.01 - 38686.5927433628 = 5921.4172` XRPs from these 2 transactions?
5. If I'm right on (4), how did I lose money when my buying price was lower than my selling price?
• @HartCO - My understanding was that if I place a buy of 44608.01 on XRP/USD, I have spent 44608.01 XRP to purchase 43715.8498 USD, am I wrong? Feb 13 '18 at 21:31
• So. For starters. You don't buy or sell XRP/USD. You're either buying ripple or you're buying bitcoin or your buying dollars. That order is for 44608 Ripple priced in USD at \$0.98USD per Ripple. (though make sure it's really USD not USDT tether). It looks like you bought 44608 then sold only 43715 and you haven't accounted for fees.
– quid
Feb 13 '18 at 22:56

If I buy 44608.01 XRP/USD @ USD 0.98, I have USD 43715.8498, correct?

No, you used to have \$43,715.85, now you have 44,608.01 XRP.

If I sell 43715.8498 XRP/USD @ USD 1.13, how many XRPs do I have?

44608.01 - 43715.8498 = 892.1602. You have 892.1602 XRP (and \$49,398.91 proceeds from the sale).

If my above assumptions are correct, have I then lost 44608.01 - 38686.5927433628 = 5921.4172 XRPs from these 2 transactions?

No, you've gained \$4,790.90 (and you hold 892.1602 XRP with a present value of another \$1008.14).

Will the rate 0.98 be in USD or XRP? I'm assuming USD for now.
If I buy 44608.01 XRP/USD @ USD 0.98, I have USD 43715.8498, correct?
If I sell 43715.8498 XRP/USD @ USD 1.13, how many XRPs do I have?

An 'ask' means an offer to sell 44,608.01 XRP for \$0.98/each.

So it would cost \$43,715.85 to buy all 44,608.01 XRP, if you subsequently sold them at \$1.13/each you'd have \$50,407.05 and 0 XRP (and capital gain of \$6,691).