def coc (F,D,S,t):
"""
F = S * exp (r*t) - D.
So, r = ln((F+D)/S)/t
Where F - Futrues price
S - spot price
r - cost of carry
t - time to expiry
D - dividends to be paid during the life of the futures contract or storage cost
"""
return np.log((F+D)/S)/t