Skip to content

Commit

Permalink
z/add-hspec-contract-tier (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xbigz authored Mar 27, 2024
1 parent 5789e55 commit 5abe350
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/driftpy/math/funding.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions src/driftpy/math/oracles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions src/driftpy/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ class ContractTier:
B = constructor()
C = constructor()
Speculative = constructor()
HighlySpeculative = constructor()
Isolated = constructor()


Expand Down

0 comments on commit 5abe350

Please sign in to comment.