contango
Search
⌃K

Position opening

Pricing with margin

Formulas

The formulas below present the price at which a trader could open a long position at a price
PO,LP_{O,L}
or a short position at a price
PO,SP_{O,S}
with an initial margin
MM
(other notations have been introduced in theoretical pricing).
Side
Price to open a position
Long
PO,L=SL(1+rQ,b1+rB,l)TM[(1+rQ,b)T1]P_{O,L}=S_{L}*{ \bigg( \dfrac{1+r_{Q,b}}{1+r_{B,l}} \bigg) }^T - M *[{(1+r_{Q ,b })}^T -1]
Short
PO,S=SS(1+rQ,l1+rB,b)T+M[(1+rQ,l)T1]P_{O,S}=S_{S}*{ \bigg( \dfrac{1+r_{Q,l}}{1+r_{B,b}} \bigg) }^T + M *[{(1+r_{Q , l})}^T -1]
Contango protocol provides a price improvement compared to the theoretical formulas presented in theoretical pricing:
  • Since
    M[(1+rQ,b)T1]>0M *[{(1+r_{Q ,b })}^T -1] > 0
    , the price to open a long position is at a lower price, i.e. more favourable to the trader.
  • Since
    M[(1+rQ,l)T1]>0M *[{(1+r_{Q , l})}^T -1] > 0
    , the price to open a short position is at a higher price, i.e. more favourable to the trader.

Example

Let's consider a contract on ETHDAI expiring in 3 months (
T=1T=1
) and where the traders posts
50DAI50 \:DAI
as margin:
  • Given one could borrow DAI at a yearly fixed rate of
    rQ,b=10.10%r_{Q,b}=10.10\%
    ​, lend ETH at a yearly fixed rate
    rB,l=2.90%r_{B,l}=2.90\%
    and buy ETH on the spot market at
    SL=100.10DAIS_{L}=100.10\:DAI
    then the price at which a trader could open a long a position is:
PO,L=100.10(1+0.10101+0.0290)0.2550[(1+0.1010)0.251]=100.59DAIP_{O,L}=100.10*{ \bigg( \dfrac{1+0.1010}{1+0.0290} \bigg) }^{0.25} - 50 *[{(1+{0.1010})}^{0.25} -1] = 100.59 \: DAI
  • Given one could borrow ETH at a yearly fixed rate of
    rB,b=3.10%r_{B,b}=3.10\%
    ​, lend DAI at a yearly fixed rate of
    rQ,l=9.90%r_{Q,l}=9.90\%
    and sell ETH on the spot market at
    SS=99.90DAIS_{S}=99.90\:DAI
    then the price at which a trader could open a short position is:
PO,S=99.90(1+0.09901+0.0310)0.25+50[(1+0.0990)0.251]=102.70DAIP_{O,S}=99.90*{ \bigg( \dfrac{1+0.0990}{1+0.0310} \bigg) }^{0.25} + 50 *[{(1+{0.0990})}^{0.25} -1] = 102.70\: DAI

Demonstration

Long

Let's consider that a trader wants to buy 1 expirable (the numerical values are taken from the above example). In this demonstration, we will present the steps to replicate the cash flows of a expirable position. Let's figure out the price of the expirable, i.e. the DAI money needed, to get 1 ETH at expiry:
1. To receive 1 ETH at expiry, the trader needs to lend
1(1+rB,l)TETH\dfrac{1}{(1+r_{B,l})^T} \: ETH
, i.e.
0.9929ETH0.9929 \: ETH
2. To get that ETH, the trader first swaps
SL(1+rB,l)TDAI\dfrac{S_{L}}{(1+r_{B,l})^T} \: DAI
, i.e.
99.39DAI99.39 \: DAI
.
3. Since the trader has already some margin, she only needs to borrow
SL(1+rB,l)TMDAI\dfrac{S_{L}}{(1+r_{B,l})^T} - M \: DAI
, i.e.
49.39DAI49.39 \: DAI
.
4. The debt
DD
the trader owes at expiry (principal + interest) is:
D=[SL(1+rB,l)TM](1+rQ,b)TDAID = [\dfrac{S_{L}}{(1+r_{B,l})^T} - M] * {(1+r_{Q , b})}^T \: DAI
, i.e.
D=50.59DAID=50.59 \: DAI
.
5. Hence, the money needed to receive 1 ETH at expiry is the sum of the debt and the margin provided:
[SL(1+rB,l)TM](1+rQ,b)T+MDAI[\dfrac{S_{L}}{(1+r_{B,l})^T} - M] * {(1+r_{Q , b})}^T + M \: DAI
or
SL(1+rQ,b1+rB,l)TM[(1+rQ,b)T1]DAIS_{L}*{ \bigg( \dfrac{1+r_{Q,b}}{1+r_{B,l}} \bigg) }^T - M *[{(1+r_{Q ,b })}^T -1] \: DAI
, i.e.
100.59DAI100.59 \: DAI
.

Short

Let's consider a trader who wants to sell 1 expirable (the numerical values are taken from the example above). This means she would give 1 ETH at expiry, let's figure out the steps and how much money she would need to receive at expiry:
1. The trader will give 1 ETH at expiry to reimburse a debt. Hence the trader borrows
1(1+rB,b)TETH\dfrac{1}{(1+r_{B,b})^T} \: ETH
, i.e.
0.9924ETH0.9924 \: ETH
.
2. The trader swaps the ETH to get
SS(1+rB,b)TDAI\dfrac{S_{S}}{(1+r_{B,b})^T} \: DAI
, i.e.
99.14DAI99.14 \: DAI
.
3. The trader lends the DAI from the swap and her margin. At expiry the trader receives an amount
L=[SS(1+rB,b)T+M](1+rQ,l)TDAIL=[\dfrac{S_{S}}{(1+r_{B,b})^T} + M] *{(1+r_{Q , l})}^T \: DAI
, i.e.
L=152.70DAIL=152.70 \: DAI
.
4. The amount of money the trader will receive at expiry, which is also the price of the expirable, is the difference between the amount L and the margin:
[SS(1+rB,b)T+M](1+rQ,l)TMDAI[\dfrac{S_{S}}{(1+r_{B,b})^T} + M] *{(1+r_{Q , l})}^T - M \: DAI
or
SS(1+rQ,l1+rB,b)T+M[(1+rQ,l)T1]DAIS_{S}*{ \bigg( \dfrac{1+r_{Q,l}}{1+r_{B,b}} \bigg) }^T + M *[{(1+r_{Q , l})}^T -1] \: DAI
, i.e.
102.70DAI102.70 \: DAI
.

Pricing with margin ratio

Formulas

Given the margin ratio
MRMR
:
  • the margin for a long position could be expressed as
    M=MRPO,LM = MR*P_{O,L}
    , e.g. if the price to open a long position is
    PO,L=100DAIP_{O,L}=100 \:DAI
    and if the trader wants a margin ratio of 50%, then the required margin is
    M=50DAIM=50 \:DAI
  • the margin for a short position could be expressed as
    M=MRPO,SM = MR*P_{O,S}
    , e.g. if the price to open a short position is
    PO,S=100DAIP_{O,S}=100 \:DAI
    and if the trader wants a margin ratio of 50%, then the required margin is
    M=50DAIM=50 \:DAI
Replacing the margin
MM
in the main pricing formula to open a position, we find new expressions depending on the collaterisation ratio
MRMR
:
Side
Price to open a position
Long
PO,L=SL(1+rQ,b1+rB,l)T11+MR[(1+rQ,b)T1]P_{O,L}=S_{L}*{ \bigg( \dfrac{1+r_{Q,b}}{1+r_{B,l}} \bigg) }^T * \dfrac{1}{1+MR*[{(1+r_{Q ,b })}^T -1]}
Short
PO,S=SS(1+rQ,l1+rB,b)T11MR[(1+rQ,l)T1]P_{O,S}=S_{S}*{ \bigg( \dfrac{1+r_{Q,l}}{1+r_{B,b}} \bigg) }^T * \dfrac{1}{1-MR*[{(1+r_{Q ,l })}^T -1]}

Example

Let's consider a contract on ETHDAI expiring in 3 months (
T=1T=1
) where the trader puts a
50%50\%
MR:
  • Given one could borrow DAI at a yearly fixed rate of
    rQ,b=10.10%r_{Q,b}=10.10\%
    , lend ETH at a yearly fixed rate
    rB,l=2.90%r_{B,l}=2.90\%
    and buy ETH on the spot market at
    SL=100.10DAIS_{L}=100.10\:DAI
    then the price at which a trader could open a long a position is:
PO,L=100.10(1.10101.0290)0.2511+0.5[(1.1010)0.251]=100.68DAIP_{O,L}=100.10*{ \bigg( \dfrac{1.1010}{1.0290} \bigg) }^{0.25} * \dfrac{1}{1+0.5*[{(1.1010)}^{0.25} -1]}=100.68\:DAI
  • Given one could borrow ETH at a yearly fixed rate of
    rB,b=3.10%r_{B,b}=3.10\%
    , lend DAI at a yearly fixed rate of
    rQ,l=9.90%r_{Q,l}=9.90\%
    , and sell ETH on the spot market at
    SS=99.90DAIS_{S}=99.90\:DAI
    then the price at which a trader could open a short position is:
PO,S=99.90(1.09901.0310)0.25110.5[(1.0990)0.251]=100.31DAIP_{O,S}=99.90*{ \bigg( \dfrac{1.0990}{1.0310} \bigg) }^{0.25} * \dfrac{1}{1-0.5*[{(1.0990)}^{0.25} -1]}=100.31\:DAI