1

I am currently writing an arbitrage bot which fills 0x orders but something that is confusing me is that the 0x order format is not consistent within their documentation.

The order message format specified here in the 0x docs differs from this order message format specified in the api section of the 0x docs. When using the api, I receive orders with the latter format.

0x docs format:

0x docs format

0x api docs format:

0x api docs format

Could this be a difference between 0x v3 and v4? The 0x cheat sheet contains the different contracts from v3 and v4. Looking at the v3 contract code, it seems to take the former order message format specified in the 0x docs. However, the v4 contract is less straightforward since it uses a proxy contract however this article says "Trades executed through the proxy are settled securely via Exchange V3." so I guess there is no change with the fillOrder function.

If anyone knows how to fill a 0x order using a smart contract or has up to date resources on this topic that would be great.

3
  • 1
    the struct of the Order is the same, it is unique and there are no different versions of it (here is it github.com/0xProject/0x-mesh/blob/…) , the thing is, one page you are referring to is from JSON API, another is the description of the object when it is transferred across 0x Mesh network.
    – Nulik
    Jul 19, 2021 at 10:48
  • there is also a Discord channel of 0x team, so you can get help there (there are 2 channels actually, but only one of them is the official)
    – Nulik
    Jul 19, 2021 at 10:51
  • Thanks for the help @Nulik this makes sense. I also found the using v3 of the API returns a JSON description in the proper order message format with all the correct fields. Though I can't see why they would change the JSON description in v4 though since it's much less convenient and not clear how to convert the format. Jul 19, 2021 at 20:58

1 Answer 1

0

The different protocol versions have different order formats.

You've found V3 over here at https://0x.org/docs/guides/v3-specification#order-message-format

And V4 over at https://0x.org/docs/api#signed-order.

They cannot be converted as they are defined and signed to be settled against a particular protocol version.

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.