Do we really need market order functionality for two linked trades?
How about:
1) The client searches all open limit orders (like the ripple path-finder) and determines the best combination of orders to move from Asset1 -> BitUSD -> Asset2.
2) The client then files a fill-or-kill order combination (one or more limit order(s) Asset1 -> BitUSD plus one or more limit order(s) BitUSD -> Asset2).
This order combination could only be executed in total or not at all and would have a fairly short expiry (maybe one minute) so that it could be altered and reposted if unsuccessful.
Isn't this exactly what we have been discussing? The problem isn't what I call the atomic chained market orders, but rather the existence of limit orders rather than the current WYAIWYG (what-you-ask-is-what-you-get) orders in BitShares. With a naive implementation of limit orders, you open the system up for front running attacks.
Now perhaps you didn't mean to say "limit orders" but rather WYAIWYG orders. In that case it solves the front running issue, but I worry that the fill-or-kill combined order you described is technically challenging to implement. I wouldn't want a chained order that sits in the order book because that complicates the matching logic. I want these chained orders to either fully get executed within a block (if the total conversion cost is less than the specified limit) or not execute at all.
Yes, I meant to say the current "WYAIWYG" type of order (i.e. a two-sided limit), not the one-sided limit orders common on most other exchanges.
If you combine fill-or-kill with immediate-or-cancel (only gets matched with existing orders at least one block old - no sitting in the orderbook for extended time) it should work.
I believe statistics are a very good tool to uncover systematic delegate front-running so I don't see that as a major issue.