> For the complete documentation index, see [llms.txt](https://docs.metalx.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.metalx.com/developers-dex/contract-mappings/common-errors.md).

# Common Errors

This section describes the common errors(assertions) on placing/submitting new orders and cancelling exiting orders.

**Place Order Errors**: Below are the common errors occurs during the verification of order submission.

Example of error thrown from `transact`:&#x20;

```javascript
 {
   json: {
      code: 500,
      message: 'Internal Service Error',
      error: {
        code: 3050003,
        name: 'eosio_assert_message_exception',
        what: 'eosio_assert_message assertion failure',
        details: [
          {
            message: 'assertion failure with message: Invalid order type',
            file: 'wasm_interface.cpp',
            line_number: 1075,
            method: 'eosio_assert'
          },
          {
            message: 'pending console output: ',
            file: 'apply_context.cpp',
            line_number: 113,
            method: 'exec_one'
          }
        ]
      }
    }
}
```

The above errors asserts whether the order type in place order is valid or not. Since order type is not valid, it will throw an error "Invalid order type"

**Errors list**:

"Contract is paused": Currently the contract is paused and users can't submit orders.

"Market not found": The market is not existed for the submitted order.

"Placing orders is disabled for this market": Order submission is disabled for this market.

"Invalid order type": Order type is Invalid, it should be one of the {Limit(1), Stoploss(2), Takeprofit(3)}.

"Invalid order side": Order side is invalid, it should be either buy(1) or sell(2)

"Invalid price": The price quoted is invalid, it is not within 0 and INT\_MAX

"Minimum order size is ...": Min order size is not valid.

"Invalid order type - add trigger price": Trigger price is not added for stoploss and take profit orders.

"Invalid referrer name, self referral not allowed": Self referral is not allowed.

**Cancel Order errors:**

"Contract is paused": Currently the contract is paused and users can't submit orders.

"Invalid authorization": User is not authorized to cancel the order.

"Invalid order id": The order id is less than or equals to 0, so it's not valid.

"Order not found": The order id which user is intended to cancel is not found or existed

"Accounts mismatch, order cancellation not allowed": The account name provided is different from the account(order placed), so cancellation is not allowed.

"Market not found": The market id, which was referenced by order\_id is not found .


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.metalx.com/developers-dex/contract-mappings/common-errors.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
