# Profit & Loss Calculation

## USDT based Margin

Floating PNL = [Contract Size * (Current Price - Entry Price)] / (Current Price*Exchange Rate)

Example 1:

"Choose USDT as the settlement currency to trade BTC/USDT contracts

At a price of 10,000 USDT for BTC/USDT, User A spends 10,000 USDT to open long and closes it at a price of 15000 USDT."

PNL(Profit and Loss) = [10000 * (15000-10000)/(10000 * 1) = 5000 USDT

## Crypto based Margin

Floating PNL = [Contract Size * (Current Price - Entry Price)/ (Current Price* Entry Price)] *Exchange Rate

Example 2:

"Choose BTC as the settlement currency to trade ETH/USDT contracts

At a price of 400 USDT for ETH/USDT, User A spends 10,000 USDT to open long and closes it at a price of 500 USDT. Suppose the spot rate of ETH/BTC is 0.03 at this time."

PNL(Profit and Loss) = [10000 * (500-400)/(400 * 500)] *0.03= 0.15 BTC

# Liquidation Price Calculation

## Isolated Margin Mode

• USDT based Margin

Long: [1-(Margin+Additional Margin)*1/(Contract Size*Contract Multiplier)+Maintenance Margin Rate)*Opening Price

Short: [1+(Margin+Additional Margin)*1/(Contract Size*Contract Multiplier)-Maintenance Margin Rate)*Opening Price

• Crypto based Margin

Long: 1.0 / [(1.0 - Maintenance Margin Rate) / Opening Price + (Margin + Additional Margin) / (Contract Size * Exchange Rate)]

Short: 1.0 / [(1.0 + Maintenance Margin Rate) / Opening Price - (Margin + Additional Margin) / (Contract Size * Exchange Rate)]

## Cross Margin Mode

• USDT based Margin

Liquidation Price = (longQty - shortQty - cash * cxRate / refData.getValuePerUnit()) / (longQty / longPrice - shortQty / shortPrice - Math.abs(longQty / longPrice - shortQty / shortPrice) * maintenanceMarginRate).

• Crypto based Margin

Liquidation price = (longQty - shortQty) / (longQty / longPrice - shortQty / shortPrice + cash / (refData.getValuePerUnit() * cxRate) - Math.abs(longQty / longPrice - shortQty / shortPrice) * maintenanceMarginRate).

If you have questions regarding this information, please contact the TruBit Team via our chat channel or email us Here and we'll be in touch!