contango
Search…
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)Tβˆ’Mβˆ—[(1+rQ,b)Tβˆ’1]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)Tβˆ’1]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)Tβˆ’1]>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)Tβˆ’1]>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
50β€…DAI50 \: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.10β€…DAIS_{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.25βˆ’50βˆ—[(1+0.1010)0.25βˆ’1]=100.59β€…DAIP_{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.90β€…DAIS_{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.25βˆ’1]=102.70β€…DAIP_{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 futures (the numerical values are taken from the above example). In this demonstration, we will present the steps to replicate the cash flows of a futures position. Let's figure out the price of the futures, 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)Tβ€…ETH\dfrac{1}{(1+r_{B,l})^T} \: ETH
, i.e.
0.9929β€…ETH0.9929 \: ETH
​
2. To get that ETH, the trader first swaps
SL(1+rB,l)Tβ€…DAI\dfrac{S_{L}}{(1+r_{B,l})^T} \: DAI
, i.e.
99.39β€…DAI99.39 \: DAI
.
3. Since the trader has already some margin, she only needs to borrow
SL(1+rB,l)Tβˆ’Mβ€…DAI\dfrac{S_{L}}{(1+r_{B,l})^T} - M \: DAI
, i.e.
49.39β€…DAI49.39 \: DAI
.
4. The debt
DD
the trader owes at expiry (principal + interest) is:
D=[SL(1+rB,l)Tβˆ’M]βˆ—(1+rQ,b)Tβ€…DAID = [\dfrac{S_{L}}{(1+r_{B,l})^T} - M] * {(1+r_{Q , b})}^T \: DAI
, i.e.
D=50.59β€…DAID=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)Tβˆ’M]βˆ—(1+rQ,b)T+Mβ€…DAI[\dfrac{S_{L}}{(1+r_{B,l})^T} - M] * {(1+r_{Q , b})}^T + M \: DAI
or
SLβˆ—(1+rQ,b1+rB,l)Tβˆ’Mβˆ—[(1+rQ,b)Tβˆ’1]β€…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.59β€…DAI100.59 \: DAI
.

Short

Let's consider a trader who wants to sell 1 futures (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)Tβ€…ETH\dfrac{1}{(1+r_{B,b})^T} \: ETH
, i.e.
0.9924β€…ETH0.9924 \: ETH
.
2. The trader swaps the ETH to get
SS(1+rB,b)Tβ€…DAI\dfrac{S_{S}}{(1+r_{B,b})^T} \: DAI
, i.e.
99.14β€…DAI99.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)Tβ€…DAIL=[\dfrac{S_{S}}{(1+r_{B,b})^T} + M] *{(1+r_{Q , l})}^T \: DAI
, i.e.
L=152.70β€…DAIL=152.70 \: DAI
.
4. The amount of money the trader will receive at expiry, which is also the price of the futures, is the difference between the amount L and the margin:
[SS(1+rB,b)T+M]βˆ—(1+rQ,l)Tβˆ’Mβ€…DAI[\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)Tβˆ’1]β€…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.70β€…DAI102.70 \: DAI
.

Pricing with margin ratio

Formulas

Given the margin ratio
MRMR
:
  • the margin for a long position could be expressed as
    M=MRβˆ—PO,LM = MR*P_{O,L}
    , e.g. if the price to open a long position is
    PO,L=100β€…DAIP_{O,L}=100 \:DAI
    and if the trader wants a margin ratio of 50%, then the required margin is
    M=50β€…DAIM=50 \:DAI
    ​
  • the margin for a short position could be expressed as
    M=MRβˆ—PO,SM = MR*P_{O,S}
    , e.g. if the price to open a short position is
    PO,S=100β€…DAIP_{O,S}=100 \:DAI
    and if the trader wants a margin ratio of 50%, then the required margin is
    M=50β€…DAIM=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)Tβˆ—11+MRβˆ—[(1+rQ,b)Tβˆ’1]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)Tβˆ—11βˆ’MRβˆ—[(1+rQ,l)Tβˆ’1]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.10β€…DAIS_{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.25βˆ—11+0.5βˆ—[(1.1010)0.25βˆ’1]=100.68β€…DAIP_{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.90β€…DAIS_{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.25βˆ—11βˆ’0.5βˆ—[(1.0990)0.25βˆ’1]=100.31β€…DAIP_{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
​
Copy link
On this page
Pricing with margin
Formulas
Example
Demonstration
Pricing with margin ratio
Formulas
Example