This article gives highlights about the exact calculation of position attributes and yield.
There can be only one position per currency. Different operations related to the position currency have different effect on the position:
- Position increases when
- You buy the position currency, e.g. ETH position increases when you execute the trade "buy ETH/BTC"
- When you obtain the position currency in return for selling another For example, BTC position increases when you execute the trade "sell ETH/BTC"
- When you deposit the position currency to your account or receive it as trading rebate
- Position decreases when
- You sell the position currency, e.g. ETH position decreases when you execute the trade "sell ETH/BTC"
- When you pay the position currency in return for buying another currency, e.g. BTC position increases when you execute the trade "buy ETH/BTC"
- When you withdraw the position currency from your account
When a position increases, its Open Price is re-calculated as weighted average of the previous open price and incoming transaction price:
When a position decreases, its realized PL is updated:
The transaction price depends on the type of the transaction:
- For trades with instruments <PositionCurrency>/<PositionBaseCurrency> (e.g. BTC/USDT trade when calculating BTC position in USDT base currency): Trade Price
- For trades with instruments <PositionBaseCurrency>/<PositionCurrency> (e.g. BTC/USDT trade when calculating USDT position in BTC base currency): 1 / Trade Price
- Other cases (other trades, deposits, withdrawals): the last market price of the position currency denominated in the position base currency:
- If there is no direct trading pair between currencies (e.g. when calculating BCH position in USDT), conversion through BTC will be used (in the example with BCH the rate will be determined as multiplication of BCH/BTC and BTC/USDT last trade prices)
- In these cases not the actual last trade price may not be used. The price used in calculations may be cached for some time not exceeding 1 minute.
Fees are added to the Realized PL immediately:
- Trading fees are subtracted from the realized PL of the position in the base currency of the trading pair. For example, if you execute the trade "buy ETH/BTC", the realized PL of your ETH position will decline by the amount of the commission you paid.
- Withdrawal fees are subtracted from the realized PL of the position in the withdrawal currency. For example, when you withdraw BTC, the realized PL of your BTC position will decline by the amount of the commission.