Author

Topic: CryptoNote orderbook math (Read 113 times)

newbie
Activity: 154
Merit: 0
September 09, 2018, 01:51:31 PM
#1
Hey guys, Looking to see if anyone may be able to chime in with some experience.

I'm working on a small exchange for Bukz, we will be able to trade among several CryptoNote. With CryptoNotes there's variable decimal places for each note. I'm trying to figure the best way of adding and subtracting when doing orderbook transactions.

I am storing each coins balance in atomic units, so 1buz = 100000000. since Bukz uses 8 decimal points I can divide that by 8 and add a precision function to display the current balance as 1.00000000 etc.

Now if another coin uses 9 decimal places, If I add the two atomic units together and then divide them with their respectable decimal units will this math come out correctly? Or is there another way to do this I'm yet to realize? Any help appreciated, good cheer.
Jump to: