From 5abe3506fe65c5b87c1a0468973bac7b1762922f Mon Sep 17 00:00:00 2001 From: bigz_Pubkey <83473873+0xbigz@users.noreply.github.com> Date: Wed, 27 Mar 2024 16:53:31 -0400 Subject: [PATCH] z/add-hspec-contract-tier (#152) --- src/driftpy/math/funding.py | 2 ++ src/driftpy/math/oracles.py | 2 ++ src/driftpy/types.py | 1 + 3 files changed, 5 insertions(+) diff --git a/src/driftpy/math/funding.py b/src/driftpy/math/funding.py index fdb41b96..1e5a444c 100644 --- a/src/driftpy/math/funding.py +++ b/src/driftpy/math/funding.py @@ -233,6 +233,8 @@ def get_max_price_divergence_for_funding_rate( return oracle_twap // 20 elif str(market.contract_tier) == "ContractTier.Speculative()": return oracle_twap // 10 + elif str(market.contract_tier) == "ContractTier.HighlySpeculative()": + return oracle_twap // 10 elif str(market.contract_tier) == "ContractTier.Isolated()": return oracle_twap // 10 else: diff --git a/src/driftpy/math/oracles.py b/src/driftpy/math/oracles.py index 6292a86a..9573e80f 100644 --- a/src/driftpy/math/oracles.py +++ b/src/driftpy/math/oracles.py @@ -136,5 +136,7 @@ def get_max_confidence_interval_multiplier(market: PerpMarketAccount) -> int: return 2 elif str(market.contract_tier) == "ContractTier.Speculative()": return 10 + elif str(market.contract_tier) == "ContractTier.HighlySpeculative()": + return 50 elif str(market.contract_tier) == "ContractTier.Isolated()": return 50 diff --git a/src/driftpy/types.py b/src/driftpy/types.py index 0ed5e5a1..6348925c 100644 --- a/src/driftpy/types.py +++ b/src/driftpy/types.py @@ -276,6 +276,7 @@ class ContractTier: B = constructor() C = constructor() Speculative = constructor() + HighlySpeculative = constructor() Isolated = constructor()