-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Atomic order matching #2
Comments
This looks good, but I would suggest:
This would allow orders with differing amounts but overlapping prices to be matched. Example: orderA offers 10 REP for 1 WETH, and orderB offers .5 WETH for 4.5 REP. Anyone could take these two, send them to the exchange contract which would cause:
This way both makers get to execute the trades they had offered, and the matcher gets to keep the spread. |
How will fees operate in the In a central matching model In the open order book model the atomic matching mechanism is ideal for arbitrageurs to perform cross-relayer and spread arbitrage without the need of large upfront capital in every asset. Open order book relayers want to incentivize these arbitrageurs to maintenance order books and close up the arbitrage opportunities. If the
Dealing with so many variables in various assets exposes the arbitrageurs to a lot of volatility risk across assets with every filled match. It is preferable that the A naive solution could be designating the |
@ctebbe I agree using the I think in the final implementation of |
@abandeali1 good point on relayer expectations re: fees. I am thinking through a way to keep Arbitrageurs (like opportunistic takers) don't want exposure to ZRX volatility risk or management, so is there a plan to implement a generic batch function such that fee abstraction can be effectively used here? ie. the arbitrageur batches a |
Motivation:
Currently, order matching of limit orders is supported through use of
batchFillOrders
andbatchFillOrKillOrders
. While the net result of filling a pair of opposing orders with these functions is the same as an atomic match, a taker is still required to have sufficient funds to fill the first order in order to complete the transaction. This adds an unnecessary cost of capital and is especially problematic when matching very large orders. A taker without the necessary funds to fill the initial order would be required to break down the match into smaller batches, which is also an inefficient use of gas.Proposed Solution:
Add a
matchOrders
function that will atomically fill valid crossing orders without requiring capital upfront. This will lower the barriers to entry of running a centralized matching engine and of arbitraging across exchanges. The requirements of this function would be:orderA.makerToken
==orderB.takerToken
orderA.takerToken
==orderB.makerToken
msg.sender
is a valid taker for both ordersmsg.sender
keeps the differenceImplementation:
TODO
The text was updated successfully, but these errors were encountered: