Giter Site home page Giter Site logo

Comments (4)

LogvinovLeon avatar LogvinovLeon commented on May 25, 2024 1

Could you please paste an order (without signature)?
I just checked and we use greaterThan for all balance/allowance validations, which is correct.
This might be the problem with rounding during fillMakerAmount computation.
Will be nice to see takerAmount, makerAmount and fillTakerAmount.

from 0x-monorepo.

apackin avatar apackin commented on May 25, 2024

I haven't run into that one in a while, but here is a similar example:

Taker will be account: 0xEb71bad396acAa128aEadBC7dBD59ca32263DE01
Current ZRX balance: 7721349919979265

Trying to perform this batch fill:

[{
  "signedOrder": {
    "ecSignature": {
      "r": "0x878329a293bb14a42019d2f0583f0f6003e49cbf1ab738848bd37c5537b96a25",
      "s": "0x1b21ac49607606881c4f08c8f994410529fa9ad2b2252ec73ff561aff223d19f",
      "v": 27
    },
    "exchangeContractAddress": "0x90fe2af704b34e0224bf2299c838e04d4dcf1364",
    "expirationUnixTimestampSec": "1514452757",
    "feeRecipient": "0xeb71bad396acaa128aeadbc7dbd59ca32263de01",
    "maker": "0x825cf4ab733265702f9582cd4d10f457baeee38e",
    "makerFee": "0",
    "makerTokenAddress": "0x05d090b51c40b020eab3bfcb6a2dff130df22e9c",
    "makerTokenAmount": "989999999999999900",
    "salt": "87276384580698629138334991609897348028108012915977568200418381927530806470590",
    "taker": "0x0000000000000000000000000000000000000000",
    "takerFee": "1783783783783783",
    "takerTokenAddress": "0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570",
    "takerTokenAmount": "891891891891891791"
  },
  "takerTokenFillAmount": "7698255154515718"
}]

Receiving:

Error: INSUFFICIENT_TAKER_BALANCE
    at OrderValidationUtils.<anonymous> (order_validation_utils.js:215)
    at step (order_validation_utils.js:32)
    at Object.next (order_validation_utils.js:13)
    at fulfilled (order_validation_utils.js:4)
    at <anonymous>

I'm not sure if the fee is checked before or after balance, but I'm expecting that to be:
takerTokenFillAmount.dividedBy(signedOrder.takerTokenAmount).mul(signedOrder.takerFee).round(0) => 15396510309031

So the total order should be 15396510309031 + 7698255154515718 = 7713651664824749

from 0x-monorepo.

avonian avatar avonian commented on May 25, 2024

having the exact same issue here, sample code https://gist.githubusercontent.com/avonian/834cbb25f60299036261b4b3fefa3857/raw/5962518ee5632e753f739cbaed6b38754d8d3959/INSUFFICIENT_MAKER_BALANCE

from 0x-monorepo.

LogvinovLeon avatar LogvinovLeon commented on May 25, 2024

I think - this release should fix it https://github.com/0xProject/0x.js/releases/tag/v0.22.2

from 0x-monorepo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.