simulations variations
This commit is contained in:
parent
476dc7be80
commit
314276d432
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
import numpy as np
|
||||
|
||||
default_kappa= 2
|
||||
default_exit_tax = .02
|
||||
|
|
@ -34,6 +34,9 @@ def spot_price(R, V0, kappa=default_kappa):
|
|||
#with realized price deltaR/deltaS
|
||||
def mint(deltaR, R,S, V0, kappa=default_kappa):
|
||||
deltaS = (V0*(R+deltaR))**(1/kappa)-S
|
||||
if deltaS ==0:
|
||||
realized_price = spot_price(R+deltaR, V0, kappa)
|
||||
else:
|
||||
realized_price = deltaR/deltaS
|
||||
return deltaS, realized_price
|
||||
|
||||
|
|
@ -44,6 +47,9 @@ def mint(deltaR, R,S, V0, kappa=default_kappa):
|
|||
#with realized price deltaR/deltaS
|
||||
def withdraw(deltaS, R,S, V0, kappa=default_kappa):
|
||||
deltaR = R-((S-deltaS)**kappa)/V0
|
||||
if deltaS ==0:
|
||||
realized_price = spot_price(R+deltaR, V0, kappa)
|
||||
else:
|
||||
realized_price = deltaR/deltaS
|
||||
return deltaR, realized_price
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue