tc39 / proposal-decimal

Built-in exact decimal numbers for JavaScript
http://tc39.es/proposal-decimal/
456 stars 17 forks source link

Trading platforms are moving to JavaScript #79

Open Vasile-Peste opened 1 year ago

Vasile-Peste commented 1 year ago

Hello, Currently part of the JavaScript community is in need for a Decimal type.

I'm the founder and maintainer of Mida, a Node.js framework for trading in financial markets, to solve the floating point error we have created our own decimal type, but this is not the point of this post.

This is a list of applications in need for a Decimal type

  1. Most Crypto Exchanges and Trading Platforms expose REST and WS APIs in JSON format, most of the consumers are Python and JavaScript users. I don't have numbers here, but I'd say that clearly Python is the most used and Node.js/JavaScript is at the second place. In fact the documentations and examples of this platforms are either in Python or JavaScript, prices from their API responses are strings as they expect us to have some ready-to-use decimal type, but unfortunately that's not the case.

References:

  1. Most Blockchain projects are written in Solidity and JavaScript

References:

All this platforms are relatively new, but as we can see they already endorsed JavaScript, they are growing day by day, I don't see a remote future for organisations having a JavaScript codebase for their financial applications.

Regards, Vasile

jessealama commented 1 year ago

Thanks for letting us know about this! That all sounds great. I'll take a look into those links.

Vasile-Peste commented 1 year ago

If you need I can add more links/documentations with concrete examples, just let me know and I'll be happy to help

jessealama commented 5 days ago

I guess the need for decimals in these kinds of use cases -- beyond simply having some kind of decimal datatype at all -- is basic arithmetic (addition, subtraction, multiplication, division, remainder, rounding). Beyond that, are there any other kinds of mathematical operations that might be used?