I'm trying to fill order from my contract by using 0x V4 API and contract on Mainnet.

So far I'm guessing that I should call batchFill function in this contract.


But I have no idea what data I need to pass to "fillData (tuple)". Could anyone help me? Also, I found that "exchangeProxy" contract is deployed to Polygon network but it seems that the interface is different. How can I fill order on the Polygon network?


I'm using API call like this to get orderbooks information.


I found v4 contract address here

https://protocol.0x.org/en/latest/basics/addresses.html#exchange-v4 https://github.com/0xProject/protocol/blob/development/packages/contract-addresses/addresses.json


1 Answer 1


A couple things.

  1. Etherscan has the wrong ABI for the Exchange Proxy so don't use that as a reference. The actual interfaces for the features you're interested in can be found here and here (they both exist on the same 0xdef1c0ded9bec7f1a1670819833240f027b25eff address).
  2. batchFillLimitOrders() is used to fill multiple orders. If you're just trying to fill a single order, you can just call fillLimitOrder().
  3. Otherwise, the process is fairly typical: Set an allowance on the Exchange Proxy 0xdef1c0ded9bec7f1a1670819833240f027b25eff for the token you're selling (taker token) then call fillLimitOrder() on that order.

More info can be found here https://protocol.0x.org/en/latest/basics/functions.html

  • 1
    Thanks I managed to make it work Oct 7, 2021 at 3:39

Your Answer

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

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