Calculating the average bid/ask price when placing orders
Yes, when you place market order it works exactly like you described. 

In case you want to get a fixed pre-defined return, you need to place limit order