I'm trying to better understand how buy and sell offers work on the Ripple network.
Let's say Alice creates a new Ripple currency, calls it XYZ, and describes it to her friends Bob and Carol.
Bob loves the new XYZ currency. He submits an offer to buy 1 XYZ for 3 XRP.
Carol merely likes XYZ. She offers to buy 1 XYZ for just 1 XRP.
That's the set up. I'm wondering what happens in the following cases...
What if Alice offers to sell 2 XYZ for 4 XRP? Will the ripple network transfer 1 XYZ each to Bob and Carol? Or, must Alice wait until someone offers to buy exactly the number of XYZ she is selling?
What if instead Alice offers to sell just 1 XYZ for 2 XRP? Only Bob's offer of 3 XRP meets the price. But will Bob spend just 2 XRP (what Alice asked) or 3 XRP (what he offered)?
Finally, what if Alice offers to sell just 1 XYZ for 1 XRP? Will she end up with 3 XRP from Bob, 1 XRP from Bob, or 1 XRP from Carol?