4

I am trying to create a sell limit order with an 18 decimal ERC20 token as makerToken (makerAmount = 1.5) and a 6 decimal ERC20 token as takerToken (takerAmount 1.1). The order is created but remainingFillableTakerAmount returned from the API shows zero. I would have expected it to be equal to takerAmount. Doesn't seem to be a problem when both maker and taker token have 18 decimals. Is there some special logic that I should consider?

Thanks for your help in advance

enter image description here

Walodja1987
  • 141
  • 1
  • 6
  • You might need to use a fixed-point math library. I recommend PRBMath. – Paul Razvan Berg Jan 28 '22 at 09:01
  • I don't think this has anything to do with conversions. This must be a problem on the 0x side as remainingFillableTakerAmount is not something you pass on when signing an order. I reported this same issue back in December already. Here the conversation link: https://discord.com/channels/435912040142602260/435912040142602262/922648296755974194 – Walodja1987 Feb 01 '22 at 19:34

2 Answers2

2

Do you definitely have the allowance on the makerToken set correctly? Can you post a fresh order in the question as text?

Jacob Evans
  • 506
  • 3
  • 5
0

I found out that a missing allowance caused this problem. 0x seems to perform an allowance check on their end and if it's insufficient, remainingFillableTakerAmount is set to 0.

Walodja1987
  • 141
  • 1
  • 6