-
Notifications
You must be signed in to change notification settings - Fork 11.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[move] new fungible token example: synthetic currency backed by baske… #1221
Conversation
75d10b2
to
dcce483
Compare
Codecov Report
@@ Coverage Diff @@
## main #1221 +/- ##
==========================================
+ Coverage 80.64% 81.46% +0.81%
==========================================
Files 98 99 +1
Lines 20288 20367 +79
==========================================
+ Hits 16361 16591 +230
+ Misses 3927 3776 -151
Continue to review full report at Codecov.
|
} | ||
|
||
/// Needed to deposit a 1:1 ratio of SUI and MANAGED for minting, but deposited a different ratio | ||
const EBAD_DEPOSIT_RATIO: u64 = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: we need to figure out a canonical way of ordering module members.
|
||
/// === Writes === | ||
|
||
/// Mint BASKET coins by accepting an equal number of SUI and MANAGED coins |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't fully understand how a Basket works. Why providing an equal number of SUI and MANAGED will generate an equal number of BASKET? Does the pricing of these coins not play a role?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this system is similar to Uniswap where you get a liquidity token for providing liquidity to one or both of the sides of the pool. It can be improved to support flexible rates for each of the currency. But that's my guess. 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is that the value of BASKET fluctuates with the value of the assets in the reserve.
For a real-life example, SDR is a synthetic currency composed of a basket of USD, EUR, RMB, JPY, and GBP. I will add a comment about this + a link
Similarly, you might want a synthetic currency backed by a basket of NFT's that changes over time (e.g., some DAO's do this https://www.coindesk.com/markets/2022/02/10/flamingodaos-nft-portfolio-is-now-worth-1b/). Probably need a separate example to show how this would work, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…t of other currencies Useful to show how to represent a "reserve" via a singleton shared object. A variant of this approach can also be used to issue a token that is backed by a basket of NFT's.
dcce483
to
d127457
Compare
Spelling out Special Drawing Rights (SDR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Sam!
…t of other currencies
Useful to show how to represent a "reserve" via a singleton shared object. A variant of this approach can also be used to issue a token that is backed by a basket of NFT's.