simulations variations

This commit is contained in:
Zargham 2019-12-31 18:49:49 -08:00
parent 476dc7be80
commit 314276d432
5 changed files with 3636 additions and 3 deletions

File diff suppressed because one or more lines are too long

593
abc_sim-simpler.ipynb Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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