If your limit order filled at what looks like the market price rather than the exact price you typed, nothing went wrong — a limit order always executes at your limit price or better, and in this case a better price was available.
A limit order means "this price or better"
- A buy limit order fills at your limit price or lower.
- A sell limit order fills at your limit price or higher.
So a limit price is really the worst price you're willing to accept — not the exact price. If a better price is available the moment your order reaches the exchange, the exchange's matching engine gives you that better price straight away. That's why it can look like it filled "at market price."
This happens when your limit is on the marketable side of the current price — a buy limit set at or above the current selling price, or a sell limit set at or below the current buying price.
Example
Suppose a stock is currently available to buy at ₹100.
- You place a buy limit order at ₹105.
- Because ₹105 is your maximum, and shares are available at ₹100 (which is better for you), the order fills immediately at ₹100 — not ₹105.
- You end up paying ₹5 less than your limit.
The same works in reverse for a sell: if you place a sell limit at ₹95 while buyers are bidding ₹100, your order fills at ₹100 — you receive ₹5 more than your limit.
What this means for you
- It's not an error — you were filled at a price at least as good as your limit, never worse.
- If you want the order to sit at an exact price and only fill there, set the limit on the non-marketable side — a buy limit below the current price, or a sell limit above it.
See also: What are limit and market orders?