[Binance] Futures Position 생성을 위한 Cost 계산

Teddy·2024년 5월 28일

Binance Futures 마켓에서 Short or Long position을 취하기 위해서는 최소한의 cost가 있어야 주문이 가능하다고 나와있다.

COST가 존재해야 하는 이유는 BTCUSDT 기준으로 설명하면 다음과 같다.

Mark Price(대충 여러 거래소들의 평균값이라고 이해하면 된다.)
Last Price(Binance futures에서 매수/매도 되는 값들)

BTC/USDT의 65000 USDT에 Long Position에 진입을 한다고 예를 들면, 이 때 다른 거래소들의 가격 평균인(Mark Price)가 이미 63,000인 경우 long position에 진입하자마자 청산될 확률이 높다.(왜냐하면 거래소들의 가격을 선물 마켓도 따라가기 때문이다.)
따라서 청산 방지를 위해서 최소한의 COST가 필요하다고 보면된다.

Cost = Initial Margin + Open Loss (if any)

Limit or stop order를 위해서는 cost가 꼭 필요하다. 따라서 cost를 계산하는 방법을 알아보자.

  1. Calculate the Initial Margin
Limit Price : 9253.30
Leverage : 20
Amount : 1BTC

Notionval Value	= Limit Price * Amount
		= 9253.30 * 1BTC 
		= 9253.30

Initial Margin
		= Notional Value / Leverage
		= 9253.30 / 20
		= 462.665
  1. Calculate Open Loss

direction of order : 1 for long order
-1 for short order

Open Loss
= Number of Contract ABS{min[0, direction of order (mark price - order price)]}

Opne Loss of long order
		= 1 * ABS(min(0, 1 * (9,259.84 - 9,253.30))
		= 1* ABS(min(0, 6.54))
		= 1*0
		= 0

위의 경우에는 long order를 주문할 때 open loss가 없다.

Open loss of short order
		= 1 * ABS(min(0, -1 * (9,259.84 - 9,253.30))
		= 1 * ABS(min(0, -6.54))
		= 1 * 6.54
		= 6.54

위의 경우에는 short order를 하기 위해서는 6.54의 open loss가 필요하다.

  1. Calculate the cose required to open a position
long position
	= 462.665 + 0
	= 462.665

short position
	= 462.665 + 6.54
	= 469.2

Market Order(시장가 주문)을 위한 cost 계산 방법..

bid(매수) ask(매도)

  1. Calculate assuming price
assuming price
	- long order = ask[0] * (1 + 0.05%)
	- short order = bid[0]
(i) assuming price of long order
	= ask[0] * (1 + 0.05%)
	= 10461.78 * (1 +0.05%)
	= 10461.78 * (1.0005)
	= 10,467.01089
(ii) assumingprice of short order
	= bid[0]
	= 10461.77
  1. Calculate the Initial Margin

Initial Margin = Notional Value / Leverage


(i) Initial margin of long order
	= Assuming price of long order  * number of contract / leverage
	= 10,467.01089 * 0.2 / 20
	= 104.6701089

(ii) Initial margin of short order
	= Assuming price of short order * number of contract / leverage
	= 10461.77 * 0.2 / 20
	= 104.6177
  1. Calculate Open Loss
Open Loss
	= Number of Contract * ABS{min[(0, direction of order * (mark price - order price)]}
direction of order 
	= 1 : long order
	= -1 : short order

(i). Open Loss of Long Order
	= Number of Contract * ABS{ min[0, direction of order * (mark price - assumingprice)] } 
	= 0.2 * ABS{min[0, 1 * (10461.83 - 10,467.01089)]}
	= 0.2 * 5.18089
	= 1.036178

(ii). Open Loss of Short Order
	= Number of Contract * ABS{ min[0, direction of order * (mark price - assumingprice)]}
	= 0.2 * ABS{min[0, -1 * (10461.83 - 10461.77)]}
	= 0.2 * Absolute Value {min[0, -0.06]}
	= 0.2 * 0.06
	= 0.012
  1. Calculate the cost required to open a position

(i) Cost Required to Open a Long Position

	= 104.6701089 + 1.036178
	= 105.71

(ii) Cost Required to Open a Short Position

	= 104.6177 + 0.012
	= 104.63

출처

profile
the world is small to me.

0개의 댓글