blockworks-foundation / mango-explorer

A project to explore and provide useful code for Mango Markets (https://mango.markets/).
MIT License
155 stars 87 forks source link

Transaction simulation failed: Error processing Instruction 0: custom program error: 0xa #25

Closed JiaxingZhao closed 2 years ago

JiaxingZhao commented 2 years ago

hello , when i run liquidator print this log , is this have any problem ?

2022-01-09 03:54:14 ⚠ ReportingAcc Account was not liquidatable:
« 𝚃𝚛𝚊𝚗𝚜𝚊𝚌𝚝𝚒𝚘𝚗𝙴𝚡𝚌𝚎𝚙𝚝𝚒𝚘𝚗 in 'Mango Explorer' calling [sendTransaction]: -32002:: Transaction failed with: 'Transaction simulation failed: Error processing Instruction 0: custom program error: 0xa'
    Accounts:
        No Accounts
    Errors:
        {'InstructionError': [0, {'Custom': 10}]}
    Logs:
        Program 5fNfvyp5czQ*PuazuWgjhTqEH invoke [1]
        Program log: Mango: PartialLiquidate
        Program log: MangoErrorCode::NotLiquidatable; src/processor.rs:1276
        Program 5fNfvyp5czQ*PuazuWgjhTqEH consumed 42756 of 200000 compute units
        Program 5fNfvyp5czQ*PuazuWgjhTqEH failed: custom program error: 0xa
    Request Text:
        {"jsonrpc": "2.0", "id": 2658, "method": "sendTransaction", "params": ["base64encodingstring", {"skipPreflight": false, "preflightCommitment": "processed", "encoding": "base64"}]}
    Response Text:
        {"jsonrpc":"2.0","error":{"code":-32002,"message":"Transaction simulation failed: Error processing Instruction 0: custom program error: 0xa","data":{"accounts":null,"err":{"InstructionError":[0,{"Custom":10}]},"logs":["Program 5fNfvyp5czQ*PuazuWgjhTqEH invoke [1]","Program log: Mango: PartialLiquidate","Program log: MangoErrorCode::NotLiquidatable; src/processor.rs:1276","Program 5fNfvyp5czQ*PuazuWgjhTqEH consumed 42756 of 200000 compute units","Program 5fNfvyp5czQ*PuazuWgjhTqEH failed: custom program error: 0xa"]}},"id":2658}
OpinionatedGeek commented 2 years ago

Unfortunately that can be a common error in logs. It doesn't (usually) indicate a problem or bug, just an unfortunate situation.

Liquidations are a competitive environment, so there are a bunch of other liquidators all trying to liquidate the same accounts the moment they become liquidatable.

When this happens, sometimes a liquidator tries to liquidate an account but another liquidator successfully liquidated it just before. When that happens, the second liquidator receives that NotLiquidatable error you saw.

There's nothing wrong with what you're doing, someone else was just smarter, faster, or luckier that time. Sorry it's not better news.

JiaxingZhao commented 2 years ago

Thanks a lot~