I am using the 0x Price and Quote API for my project and encountered the following Problem which could be a bug in the API.
Token Decimals:
- 0x514cdb9cd8a2fb2bdcf7a3b8ddd098caf466e548 has 9 Decimals
- 0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce has 18 Decimals
The response includes the following values among others:
- "buyAmount": "17621716298148718"
- "sellAmount": "91852168466729"
- "sellTokenToEthRate": "681573019064660.96173915"
- "buyTokenToEthRate": "131484453.43337870913186545"
sellAmount is corrently based on 9 Decimals --> sellAmount / sellTokenToEthRate = 0.13476497146 ETH which is correct.
However buyAmount is also based on 9 Decimals --> buyAmount / buyTokenToEthRate = 134141724.605 which is not correct and 9 decimals off the correct value.
Is this a know issue or am I doing something wrong here? Appreciate the help!
sellAmount / sellTokenToEthRate
andbuyAmount / buyTokenToEthRate
be about the same?