0x-api icon indicating copy to clipboard operation
0x-api copied to clipboard

OrderUnfunded: maker has insufficient balance or allowance for this order to be filled

Open xiao0811 opened this issue 4 years ago • 9 comments

Request POST https://kovan.api.0x.org/sra/v3/order

{
    "chainId": 42,
    "exchangeAddress": "0x4eacd0af335451709e1e7b570b8ea68edec8bc97",
    "makerAddress": "0x89536e3474380f65a79e8ceb1cfc59c696a8c831",
    "makerAssetData": "0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c",
    "makerFeeAssetData": "0x",
    "makerAssetAmount": "10000000000000000",
    "makerFee": "0",
    "takerAddress": "0x0000000000000000000000000000000000000000",
    "takerAssetData": "0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa",
    "takerFeeAssetData": "0x",
    "takerAssetAmount": "210000000000000000",
    "takerFee": "0",
    "senderAddress": "0x0000000000000000000000000000000000000000",
    "feeRecipientAddress": "0x1000000000000000000000000000000000000011",
    "expirationTimeSeconds": "1595236078",
    "salt": "2307599219606246574",
    "signature": "0x1cabf9d973cd1b5f277b3dd392da06ff04ba09665b22c9b53d02d90a68946df5f85ecfc0c4a6752e5baf436c71360a546002d034c6dfb6c163c44aa37b8fe0937303"
}

Response

{
    "code": 100,
    "reason": "Validation Failed",
    "validationErrors": [
        {
            "field": "signedOrder[0]",
            "code": 1007,
            "reason": "OrderUnfunded: maker has insufficient balance or allowance for this order to be filled"
        }
    ]
}

My account: image

What is this cost enough~o(╥﹏╥)o

xiao0811 avatar Jul 20 '20 08:07 xiao0811

It might be easier for you to get quick feedback on issues like this (order underfunding) on one of our Discord help channels. Let me know if you can't access this for some reason, and I'll help you get onto it. Someone on our team is always available to help you troubleshoot issues like this.

To address the problem, it seems that you have not set an allowance on the ERC20Proxy on the Kovan network on behalf of the makerAddress. I figured this out by using the "read contract" feature of Etherscan:

Screen Shot 2020-07-20 at 5 16 34 PM

Can you try to approve the ERC20Proxy and then see if you can add the order to Mesh? I understand that this is a pretty complicated issue, so I'll try to find some documentation on all of the things that you need to do to create a valid order in the meantime.

jalextowle avatar Jul 20 '20 22:07 jalextowle

@xiao0811 Here is a guide that can walk you through this process: https://0x.org/docs/guides/how-to-set-your-token-allowances.

jalextowle avatar Jul 20 '20 22:07 jalextowle

@jalextowle Thank you so much for knowing, let me try

xiao0811 avatar Jul 21 '20 00:07 xiao0811

@jalextowle The approve problem has been solved. I try to send two corresponding transactions: order 1:

{
    "chainId": 42,
    "exchangeAddress": "0x4eacd0af335451709e1e7b570b8ea68edec8bc97",
    "makerAddress": "0x89536e3474380f65a79e8ceb1cfc59c696a8c831",
    "makerAssetData": "0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c",
    "makerFeeAssetData": "0x",
    "makerAssetAmount": "1000000000000000000",
    "makerFee": "0",
    "takerAddress": "0x0000000000000000000000000000000000000000",
    "takerAssetData": "0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa",
    "takerFeeAssetData": "0x",
    "takerAssetAmount": "2000000000000000000",
    "takerFee": "0",
    "senderAddress": "0x0000000000000000000000000000000000000000",
    "feeRecipientAddress": "0x1000000000000000000000000000000000000011",
    "expirationTimeSeconds": "1595411213",
    "salt": "1259365686472737455",
    "signature": "0x1b204dda3ffa596b8fd00abbbd000f80a4b90a2a8c6a241ec03e1b0d5f6915b774521c5ea04625acd834684867456bdf89d06be9a969b4602af61a73c974f6d5f503"
}

order 2:

{
    "chainId": 42,
    "exchangeAddress": "0x4eacd0af335451709e1e7b570b8ea68edec8bc97",
    "makerAddress": "0xfec219e393355962ada9217ead3a2ce58dd039aa",
    "makerAssetData": "0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa",
    "makerFeeAssetData": "0x",
    "makerAssetAmount": "2000000000000000000",
    "makerFee": "0",
    "takerAddress": "0x0000000000000000000000000000000000000000",
    "takerAssetData": "0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c",
    "takerFeeAssetData": "0x",
    "takerAssetAmount": "1000000000000000000",
    "takerFee": "0",
    "senderAddress": "0x0000000000000000000000000000000000000000",
    "feeRecipientAddress": "0x1000000000000000000000000000000000000011",
    "expirationTimeSeconds": "1595411237",
    "salt": "2177787531541382407",
    "signature": "0x1c0f859ea48223b2545a6d41f30f22cea8b7b9bbeaaee1f5dabd660b03e0fa430b2121f68f68b9e2c99b25d4d15a2253fec839dc335845dbbe1f41ed67232f1ee303"
}

image

But nothing happened afterwards. Is there anything else to deal with?

xiao0811 avatar Jul 22 '20 08:07 xiao0811

Did you receive an error message? That would be pretty helpful.

jalextowle avatar Jul 22 '20 19:07 jalextowle

No, the statusCode of both orders submitted is 200, no response body.

xiao0811 avatar Jul 23 '20 00:07 xiao0811

@xiao0811 https://kovan.api.0x.org/sra/v3/order is separate from 0x Mesh. Please open an issue on https://github.com/0xProject/0x-api or post in the #0x-api-help channel on our Discord: https://discord.com/channels/435912040142602260/667077687860527125.

albrow avatar Jul 24 '20 00:07 albrow

Actually it looks like I can transfer the issue for you. It should be in the 0x-api repo now.

albrow avatar Jul 24 '20 00:07 albrow

@albrow @jalextowle These issues have been resolved, but I cannot submit the ERC20 tokens I created myself. How can I solve this? Thank you

xiao0811 avatar Jul 24 '20 10:07 xiao0811