# Stop šŸ˜ˆ Loss Protocol ## Project Description šŸ˜ˆ The stoploss protocol is a decentralized protocol against impermanent losses. Is allows Liquidity Providers (LPs) to limit their impermanent losses on Automated Market Makers (AMMs, eg. Uniswap) in a safe, automated and non-custodial way. ### Problem Statement Impermanent losses for LPs is recognized in the industry as the biggest problem of AMMs: "*Impermanent loss is by far one of the biggest detriments to the success of DEXs like Uniswap."* ā€” Lucas and Cooper *Ā« :Imp:ermanent losses has become a problem about equal to having an elephant in the living room. It's so big you just can't ignore it. Ā»* ā€” :smiling-imp: ** ![Banner]( ### Alpha specs Most LPs supplying liquidity to AMMs such as Uniswap suffer from Impermanent losses. Stoploss allows LPs to limit those losses via a protocol that triggers automated liquidations based on users' maximum acceptable loss. Example: - Provide 700 DAI as liquidity in the ETH/DAI uniswap pool - Place a stop-loss order guaranteeing 500 DAI - If the liquidity of the LP gets close to 500 DAI (500+X%), LP position will get liquidated, 500 DAI will be sent to the LP.* OR For the most bullish of us - Provide 3 ETH in the ETH/DAI pool - Place a stop-loss order guaranteeing 2 ETH - If the liquidity of the LP gets close to 3ETH (3ETH+X%), tLP position will get liquidated, 3ETH DAI will be sent to the LP.*

Stoploss showcase

How it's made

Smart contracts: Stoploss Factory => Create Stoploss pools + Stoploss Oracle Each Stoploss pool is linked to uniswap router 02 and uniswap pair. Each Stoploss pool use the stoploss Oracle to get price data (TWAP of Uniswap Pair). Example: To protect against IL in the Uniswap ETH/DAI pair: - We create a Stoploss pool through the factory and an oracle - Users make stoploss order from this Stoploss pool. They can send directly LP Tokens, or they can send DAI that we convert for them into LP token, interacting with Uniswap Router Contract. We have a subgraph that stores all Stoploss order created and all price oracle updates. We deployed on kovan on top of live uniswap contracts. Everything works fine. Data to create stoploss order: web3 Data to fetch stoploss orders states: the graph protocol Side note: we simplified last minute the oracle to make better UX for the demo.

Technologies used

EthereumSolidityThe Graph