-
Notifications
You must be signed in to change notification settings - Fork 122
Chainlink hackathon Loopring AMM
Reading material:
- 3.6 design doc: https://github.com/Loopring/protocols/blob/master/packages/loopring_v3/DESIGN.md
- 3.6 presentation: https://docs.google.com/presentation/d/1egIy5DGSpaiipBTyPZolwce-4Jj2dy9zzAR2j_Q9gqI/edit#slide=id.g92033399d9_2_56
Loopring 3.6 introduces AMMs on the protocol level using the balancer curve. AMM can be enabled for a token on an account by setting a non-zero AMM weight. When multiple weights are non-zero, AMM is automatically enabled for all those tokens. Any number of tokens on the account can have a non-zero weight to create a pool of multiple tokens.
Enabling AMM is easy, but if the funds are pooled together we need to keep track of which user owns how large a part of the total balance in the pool account. This is where the AMM pool contract comes in. This is just a normal smart contract which interacts with layer 2 in a specific way, though you don't have to worry about this too much. The demo contract implements this already so you can focus on the actual pool implementation in solidity.
Modify the demo AMM pool contract to implement a real working AMM pool. A $1500 bounty is provided for an AMM pool that doesn't have external dependencies (Uniswap, Balancer,...). There is also a $1500 bounty for an AMM pool contract does uses ChainLink to enhance the AMM in certain ways (StableCredit, bancorV2, dodo,...) by e.g. playing with the weights or minting a stable coin.
Clone https://github.com/Loopring/protocols.git
. Checkout the protocol36-ammpool
branch. Follow the build instructions provided here: https://github.com/Loopring/protocols/tree/master/packages/loopring_v3
A demo implementation of an AMM pool contract is provided in contracts/test/AmmPool.sol
. Modify this contract to add the requested features. Focus on modifying beforeBlockSubmitted
(more specifically the functions called there) and implement your required changes. We don't expect a fully working and tested implementation, we are mainly interested in interesting AMM use cases that we can use to build upon.
Loopring Foundation
nothing here