Can someone please explain what happens when two people try to sell at the bid price at the same time? Who gets the fill?
This is fundamental issue with Decentralized Distributed Exchanges.
There's no such thing as 'at the same time' in the blockchain: two transactions in the same block are handled in order of appearance within the block.
but the order of the transactions can be different per miner... so its dependent on which miner solves the block?
Yes.
PhantomPhreak, thanks for responding.
So you cant really be sure of your position until the standard 6 confirmations.
Also a miner can game the system by front-running trades after solving a block.
Also there are many "latency arbitrage" "alpha" strategies that can be used to game the system, since it is possible to to make a trade in the past based on "future" information.
This is why Decentralized Distributed Exchanges for liquid assets is nearly impossible to implement.
I've read this whole thread and everything about XCP and still have not found details technical info on how the matching works, does it use "atomic transactions" ?
I have some ideas on solutions, PM if interested.. im a 15 year high frequency trading C++ coders. cheers