Hey I'm thinking of creating a trading platform and wanted to utilize 0x API orderbook in order to provide limit order + depending on the possibilities automatic profit taking and stop loss functionality based on limit orders - like https://gmx.io/trade does.

My questions: When a user (maker) on our product creates a limit order that is being send to the 0x orderbook, will someone (a taker) execute the trade once the market reaches the limit order price? Example: I have a long position on BTC. Entry price 33000 USD. I want to place a stop loss at 32000 USD. I create a limit order on 0x API orderbook as a maker. Lets say the price falls to 31500 USD. Will a taker on the 0x API orderbook execute the trade and push it to the blockchain? Does my product do need to do anything extra in order to execute the order? What are the risks here?

It might sound like a silly question, but I just want to make sure this plays our as shown above before starting any development.

1 Answer 1


Good question! That is correct, once a limit order is submitted to the 0x orderbook, a taker can fill order via either the fillLimitOrder() or fillOrKillLimitOrder() functions on the Exchange Proxy. If the trade is successful a LimitOrderFilled will be emitted.

As for risks, these functions may revert under any of the conditions outlined above under the fillLimitOrder() section.

Here is a "Fill ERC20 limit order" code example that can be useful in our 0x Starter Project.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.