Skip to content

Commit

Permalink
frank/prediction markets (#197)
Browse files Browse the repository at this point in the history
* most of prediction markets

* add market constants

* remaining prediction markets stuff

* remove dbg prints

* rename worst_case_quote_asset_amount

* rm code not needed for driftpy

---------

Co-authored-by: Chris Heaney <[email protected]>
  • Loading branch information
soundsonacid and crispheaney authored Aug 15, 2024
1 parent 003e1b8 commit 4d9bcef
Show file tree
Hide file tree
Showing 4 changed files with 422 additions and 138 deletions.
6 changes: 5 additions & 1 deletion src/driftpy/dlob/orderbook_levels.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
PerpMarketAccount,
PositionDirection,
SwapDirection,
is_variant,
)

LiquiditySource = ["serum", "vamm", "dlob", "phoenix"]
Expand Down Expand Up @@ -168,7 +169,10 @@ def get_vamm_l2_generator(

now = now or int(datetime.now().timestamp())
bid_reserves, ask_reserves = calculate_spread_reserves(
updated_amm, oracle_price_data, now
updated_amm,
oracle_price_data,
now,
is_variant(market_account.contract_type, "Prediction"),
)

num_bids = 0
Expand Down
Loading

0 comments on commit 4d9bcef

Please sign in to comment.