30 lines
830 B
Python
30 lines
830 B
Python
from poly_updown.strategy import crypto_taker_fee, fair_up_probability
|
|
|
|
|
|
def test_crypto_taker_fee_peaks_near_half() -> None:
|
|
assert round(crypto_taker_fee(0.5), 4) == 0.0175
|
|
assert crypto_taker_fee(0.1) < crypto_taker_fee(0.5)
|
|
|
|
|
|
def test_fair_probability_moves_with_distance() -> None:
|
|
base = fair_up_probability(
|
|
current_price=100.0,
|
|
price_to_beat=100.0,
|
|
seconds_remaining=60.0,
|
|
sigma_price_per_sqrt_second=1.0,
|
|
)
|
|
high = fair_up_probability(
|
|
current_price=102.0,
|
|
price_to_beat=100.0,
|
|
seconds_remaining=60.0,
|
|
sigma_price_per_sqrt_second=1.0,
|
|
)
|
|
low = fair_up_probability(
|
|
current_price=98.0,
|
|
price_to_beat=100.0,
|
|
seconds_remaining=60.0,
|
|
sigma_price_per_sqrt_second=1.0,
|
|
)
|
|
|
|
assert low < base < high
|