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).
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) andSTX
, instead of manipulating tokens (micro quantities) directly, and letting UI components dealing with display using theget-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).