0f / 0F-ARK-2108

0 stars 0 forks source link

0f-ARK-011: Use the most precise token scale available #12

Open lgalabru opened 3 years ago

lgalabru commented 3 years ago

Context

The Arkadiko contracts are dealing with the token decimal precision at the contract levels. Contracts are explicitly manipulating cents (USDA: 1 cent = 1000 tokens) and STX, instead of manipulating tokens (micro quantities) directly, and letting UI components dealing with display using the get-decimals method required in SIP10 tokens.

As a consequence, a token must have a value >= 0.01 usda for being a collateral. If a token falls under this limit, consequences are unclear.

This precision choice also impact code readability: it requires salting the codebase with 100/1000/100000 multipliers/dividers.

Recommendation

Use tokens / micro quantities everywhere, and let the UI resolve the decimal precision (balance of 100000 USDA tokens = 1 USDA).

nieldeckx commented 3 years ago

Improving in the following PR: https://github.com/arkadiko-dao/arkadiko/pull/227/files