Skip to content

Commit

Permalink
fix limit order example
Browse files Browse the repository at this point in the history
  • Loading branch information
crispheaney committed Nov 16, 2023
1 parent 474f542 commit 15eb39c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/limit_order_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ async def main(
drift_acct.program, market_index
)
try:
oracle_data = await get_oracle_price_data_and_slot(connection, market.amm.oracle)
oracle_data = (await get_oracle_price_data_and_slot(connection, market.amm.oracle)).data
current_price = oracle_data.price/PRICE_PRECISION
except:
current_price = market.amm.historical_oracle_data.last_oracle_price/PRICE_PRECISION
Expand All @@ -132,7 +132,7 @@ async def main(
else:
market = await get_spot_market_account( drift_acct.program, market_index)
try:
oracle_data = await get_oracle_price_data_and_slot(connection, market.oracle)
oracle_data = (await get_oracle_price_data_and_slot(connection, market.oracle)).data
current_price = oracle_data.price/PRICE_PRECISION
except:
current_price = market.historical_oracle_data.last_oracle_price/PRICE_PRECISION
Expand Down

0 comments on commit 15eb39c

Please sign in to comment.