diem / move

Home of the Move programming language
Apache License 2.0
341 stars 129 forks source link

[Feature Request] Implementing more DeFi contracts in Move #70

Open runtian-zhou opened 2 years ago

runtian-zhou commented 2 years ago

πŸš€ Feature Request

Motivation

DeFi contracts are gaining lots of attention these days as they bring new innovation to the crypto and finance market. However, most of the smart contracts are written in solidity. It is important for us to see if we can implement something similar in Move and use this experience to access our gap to a wilder adoption of Move.

Pitch

Under experimental folder, we've already implemented a few interesting contracts, including a primitive token type and a simplified uniswap protocol. It would be nice if we can implement more code like this to access the usability of Move in the DeFi space.

If you would like to contribute, please refer to this [tutorial] to see how the basic-coin example is implemented and tested. This should offer you an overview of the developing flow of a Move package.

Here's a non-exhaustive list of DeFi contract that we might want to implement:

Feel free to extend this list if there's any emerging new smart contracts.

DigtalFinanceAndWorld commented 2 years ago

Great move! We are very much interested! We are thinking of after implementing a few DeFi/NFT/Meta/Game projects, we can come up with an AutoMove Translator which can help porting Smart Contract DAPP projects from other blockchain eco-systems.

sblackshear commented 2 years ago

Would love to see these, especially if they include prover specs. Some other pointers I know of from StarCoin (and let me tag @lerencao @jolestar to see if there are more, as well as @mkurnikov from Pontem)

jolestar commented 2 years ago

Great move! There are already some Defi projects implemented with Move, can we collect them in one repo or document? like awesome-move?

  1. Starswap a Uniswap like protocol implemented with Move on Starcoin
  2. Wenwen a stable coin implemented with Move on Starcoin
  3. FAI a stable coin implemented with Move on Starcoin
  4. FLY An OHM fork impletion in Move on Starcoin
jolestar commented 2 years ago
  • All of the different instantiations of Coin<T> from Diem, StarCoin, 0L, and Pontem. There are some very different minting/burning/issuance properties implemented in these coins, and it would be great to have them (as well as some toy examples) all in one place. Assets are the building blocks of DeFi--devs need to know how to create assets with fixed supply, algorithmic issuance, etc before they can start lending, swapping, etc.

We need to find a way to share Move library between Move blockchain projects. I hope the Move project dependency like:


                                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                     β”‚Move Std lib β”‚
                                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚Move DeFi libβ”‚          β”‚Move Commons lib   β”‚
                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

                                                                      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                                                      β”‚ Move Chain independent lib    β”‚
                                                                      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ StarcoinFramework β”‚     β”‚ DiemFramework     β”‚    β”‚ 0lFramework       β”‚   β”‚ PontemFramework   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Maybe we need to start a new issue to discuss this?

sblackshear commented 2 years ago

Great move! There are already some Defi projects implemented with Move, can we collect them in one repo or document? like awesome-move?

Fantastic idea. We should have done something like this a long time ago.

Spent some time building out https://github.com/MystenLabs/awesome-move with your links and several others--please share and contribute!

runtian-zhou commented 2 years ago

On package reorg, now that we have a packaging system, do you think we can get started by creating sub folders under experiment folder and have different crate relying on each other?

jolestar commented 2 years ago

Maybe we need to start a new issue to discuss this?

I write an issue for this https://github.com/diem/move/issues/91