3 ms·
Thanks man! Had to read about what Numeraire[1] means for answering, didn't know that concept! My approach was to treat all accepted stablecoins as having the
by tcgv 6y ago
Thanks man!
Had to read about what Numeraire[1] means for answering, didn't know that concept!
My approach was to treat all accepted stablecoins as having the same value pegged to the USD.
Upon depositing tokens a conversion is made to normalize the value that is added to the address balance in the exchange, since different stable coins may have different decimal places in their representation.
You can see this code here in the "depositTokens" function of the "CreditProvider" contract:
- https://github.com/TCGV/DeFiOptions/blob/master/contracts/finance/CreditProvider.sol#L78 https://github.com/TCGV/DeFiOptions/blob/master/contracts/fi...
The "token conversion rate" is applied in line 85 to the deposited value.
[1] https://en.wikipedia.org/wiki/Num%C3%A9raire https://en.wikipedia.org/wiki/Num%C3%A9raire