Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Loopring Protocol: Build a DEX or Write a Fee Burning Contract (2 x $3,500) #7
What is Loopring Protocol?
Loopring is a protocol for building decentralized exchanges or otherwise incorporating non-custodial exchange functionality. The architecture utilizes off-chain order messaging and on-chain settlement. Our order model allows for multiple disparate trading pairs to be matched in order-rings to improve liquidity.
Loopring is awarding $7,000 in LRC across 2 separate projects
# 1 - Build a DEX or P2P trade platform (Prize: $3,500 in LRC)
Loopring’s design distinguishes between frontend and backend services.
On the frontend, there are wallets or GUIs that users/traders interact with. On the backend, there are relays/ring-miners who match orders, effectively providing Matching-as-a-Service (MaaS). These two functions cooperate and share trading fees with each other in extremely flexible ways. Collectively, we call an entity that does both, a DEX.
For this challenge, we impose no restrictions. If you want to build a mobile Ethereum wallet or a web interface that speaks to our own reference ring-miner, that’s great. If you want to build your own backend relay/ring-miner, even better!
The reason we say “or P2P trade platform” is because Loopring supports another order type: P2P trades. In these cases, orders are not sent to ring-mining backends, but rather are matched directly with a counterparty. Basically, wallets are the only party in consideration here, no MaaS. P2P orders can be used for many applications beyond just sending trades amongst friends. For example, an ICO platform can use these orders to sell assets in the ‘primary’ market.
We will judge based on a mix of:
# 2 - Write an LRC Fee Burning Contract (Prize: $3,500 in LRC)
In Loopring Protocol 2.0, we have introduced a new fee model. One of the many changes is that a part of the fee earned by wallets and miners is reserved to burn LRC (we call this the burn rate). If the fee is paid in LRC this is straighforward, we simply burn the LRC directly. If the fee is paid in a non-LRC token however, we first have to sell the non-LRC token for LRC so the LRC can be burned.
Write a contract that sells the non-LRC tokens and burns the resulting LRC. You are free to sell the tokens in any way you like. Of course, we'd like to burn as much LRC as possible with these funds. Selling the funds should also be completely trustless. Anyone will be able to trigger the function that is used to burn the LRC.
As a part of the Loopring smart contracts, we have a dedicated contract holding all fees called FeeHolder. Contracts can be authorized to withdraw the part of the fees that needs to be burned. It's up to these contracts to implement a way to sell the non-LRC tokens in some way for LRC. The BurnManager currently can only burn LRC directly.
Your folder should look like this:
See the readme at the protocol 2 repository.
Get In Touch
We’ll be leading a workshop on Friday at 11pm on how to build with Loopring, so please come by and say hello! Please also join our Discord for further help throughout the weekend or to find a hacking team/partner!
We have open source projects that you can start with.