protocol-v2
protocol-v2 copied to clipboard
Getting Anchor error PerpMarketNotFound, when trying to modify order on PERP market
Context:
- Drift-Gateway is used to place and then modify order on
DOGE-PERP
market (mainnet) - Order placement is successful with
market_index = 7
andmarket_type = "perp"
parameters - Same order modification (not filled) with the same
market_index
andmarket_type
fails with protocol error
Logs:
{ request: Some(SendTransaction), kind: RpcError(RpcResponseError { code: -32002, message:
"Transaction simulation failed: Error processing Instruction 1: custom program error: 0x17be",
data: SendTransactionPreflightFailure(RpcSimulateTransactionResult { err:
Some(InstructionError(1, Custom(6078))), logs: Some(["Program
ComputeBudget111111111111111111111111111111 invoke [1]", "Program
ComputeBudget111111111111111111111111111111 success", "Program
dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH invoke [1]", "Program log: Instruction: ModifyOrder",
"Program log: Could not find perp market 7 at programs/drift/src/controller/orders.rs:618",
"Program log: AnchorError occurred. Error Code: PerpMarketNotFound. Error Number: 6078. Error
Message: PerpMarketNotFound.", "Program dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH consumed
16423 of 199850 compute units", "Program dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH failed:
custom program error: 0x17be"]), accounts: None, units_consumed: Some(150), return_data: None })
})
Seems to be an issue with obtaining account info for given perp market, most likely here