BuildOnViction / tomochain-v1

The efficient blockchain for the token economy
https://tomochain.com
GNU Lesser General Public License v3.0
51 stars 22 forks source link

[TomoX] BasePrice should depend on tokenDecimal #633

Closed thanhnguyennguyen closed 5 years ago

thanhnguyennguyen commented 5 years ago

BasePrice should depend on tokenDecimal of baseToken instead of hard code 10^18 common/constants.go:34

var BasePrice = big.NewInt(1000000000000000000) // 1
thanhnguyennguyen commented 5 years ago
quoteQuantity = price * amount / 10^(baseDecimal)

price in smallest unit of quoteToken amount in smallest unit of baseToken

thanhnguyennguyen commented 5 years ago

refer tomochain/tomox-sdk-ui/issues/107

thanhnguyennguyen commented 5 years ago

fixed in #646