protocol-v2 icon indicating copy to clipboard operation
protocol-v2 copied to clipboard

Getting Anchor error PerpMarketNotFound, when trying to modify order on PERP market

Open bmuddha opened this issue 9 months ago • 0 comments

Context:

  1. Drift-Gateway is used to place and then modify order on DOGE-PERP market (mainnet)
  2. Order placement is successful with market_index = 7 and market_type = "perp" parameters
  3. Same order modification (not filled) with the same market_index and market_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

bmuddha avatar May 07 '24 07:05 bmuddha