zetamarkets / sdk

SDK for accessing the Zeta program
Other
85 stars 29 forks source link

Round price to nearest tick #195

Closed filipzeta closed 1 year ago

filipzeta commented 1 year ago

Automatically round price conversions to nearest tick size to prevent program errors. Examples:

10.0099999999 = 10010000
10.0009999999 = 10001000
10.0000999999 = 10000100
10.0000099999 = 10000000

10.006 = 10006000
10.0006 = 10000600
10.00006 = 10000100
10.000006 = 10000000

10.004 = 10004000
10.0004 = 10000400
10.00004 = 10000000
10.000004 = 10000000