drift-labs / driftpy

python sdk to interact with drift v2
https://drift-2.gitbook.io/driftpy-for-dummies/
65 stars 41 forks source link

Program log: Could not find perp market 0 at programs/drift/src/math/margin.rs:451 #199

Open wkshare opened 3 months ago

wkshare commented 3 months ago

What is happend.

My Code:

perp_markets = list(range(0, 35))
spot_markets = list(range(1, 24))
spot_market_oracle_infos, perp_market_oracle_infos, spot_market_indexes = (
    get_markets_and_oracles(perp_markets=perp_markets)
)
oracle_infos = spot_market_oracle_infos + perp_market_oracle_infos
spot_market_indexes = spot_markets
drift_client = DriftClient(
    connection=connection,
    wallet=wallet,
    env="mainnet",  # or "devnet"
    perp_market_indexes=perp_markets,
    spot_market_indexes=spot_market_indexes,
    oracle_infos=oracle_infos,
    tx_params=TxParams(None, PFEE),
    account_subscription=AccountSubscriptionConfig("cached"),
    active_sub_account_id=USER_ID,
)

How to fix that.