Introducing OpenLeverage

A permissionless margin trading protocol enables traders to long or short any pair on many DEXs efficiently and securely.

OpenLeverage
6 min readJun 22, 2021

The permissionless nature of Decentralized Finance allows any tokens to be listed and traded with rapid growth in liquidity and volume. But users today are still difficult to find permissionless markets when looking for leverage trading. Centralized exchanges are under immense regulatory pressure and are costly to make any market due to their self-centered business model. Existing Decentralized Leverage Trading Protocols provide only minimal pairs and market depth and cannot scale to meet demand from rapid market development. To truly build DeFi’s vision of global financial access, there needs to be a decentralized, permissionless, scalable, secure leverage trading facility that serves the long tail and fast-growing DeFi market.

Introducing OpenLeverage

OpenLeverage is a permissionless margin trading protocol, which enables traders to long or short any trading pair on DEXs efficiently and securely.

The mission of OpenLeverage Protocol is to create an entirely permissionless decentralized margin trading infrastructure. Therefore, no permission must be needed to create a margin trading market for any pair. This is a stance the development team put into the protocol design.

Key features:

  • Margin Trading with Liquidity on DEX, connecting traders to trade with the most liquid decentralized markets like Uniswap, Pancakeswap, and more.
  • Risk Isolation Lending Pools, have two separate pools for each pair, and different risk and interest rate parameters for each pool, which allows lenders to invest according to the risk-reward ratio.
  • Risk Calculation with a Real-time AMM Price, calculates collateral ratio with real-time AMM pricing for any pair available from a DEX.
  • 2 Phases Liquidations, forces a liquidation to be completed in two different transactions to avoid flash loan attacks and cascading liquidation events.
  • LToken, an interest rate bearing token for each lending pool, allows tokenomics integration with projects.
  • OLE Token, a governance token, minted by protocol usage which allows holders to vote or stake to get rewards and protocol privileges.
  • An intuitive and user-friendly UI designed for decentralized margin trading.

These features make OpenLeverage the most scalable margin trading protocol:

  • Anyone can create lending pools for any trading pair available on a DEX, with default interest rate and risk parameters, which the community can change via the governance process.
  • Lenders can earn higher yields by depositing assets into the lending pools, earning interest from borrowed assets, receiving OLE rewards, or receiving rewards by re-staking their LTokens to join other projects’ reward programs.
  • Traders can borrow and trade all with one click in a single transaction.
  • Projects can integrate with the OpenLeverage protocol to facilitate leverage trading on specific trading pairs by integrating LToken.
  • Liquidators can trigger liquidations to earn rewards based on gas prices if the trade’s collateral ratio falls below the market limit.

How It Works

OpenLeverage is a decentralized lending and margin trading protocol built for EVM-compatible blockchain.

Anyone can create lending pools for a specific pair on a DEX. As an example, someone might be interested in doing leverage trading on the FEI/USDC pair, so they create two lending pools for the FEI/USDC pair of Uniswap.

Anyone can create isolated pools for users to lend or borrow for margin trades.

Next, a user can provide liquidity in the FEI → USDC pool, which means providing FEI to be borrowed to buy USDC. Or users can choose to provide liquidity in the USDC → FEI pool instead. Lenders will receive variable interest based on the pool’s utilization. This is similar to how the Compound protocol works.

Lenders receive LToken of the pool as an interest-bearing token, which can then be re-staked to other yield farms to receive further rewards.

Traders can choose to borrow from either pool to swap to another token as a leveraged position. In this example, the trader borrows USDC by putting down the same amount of USDC as collateral to make a 2X margin trade, swapped into FEI position with the liquidity pools of Uniswap, and locked in the smart contract. By taking advantage of liquidity on a DEX, we don’t have to create separate liquidity or an order book for leverage trading.

Once the trader closes the position, the protocol swaps the FEI position back to USDC by repaying the loan with interest, which returns the deposit plus or minus any profit or loss back to the trader.

Intuitive User Interface with Air Design

Isolated Risk With Real-time Pricing

All asset pairs experience different volatility by nature. To support a permissionless margin trading market, isolated pools are needed with risk parameters associated with the pair. Each pair has its own collateral ratio, according to the pair's volatility and the block time and throughput of the chain. The protocol can support from 1.5X to 10X leverage trading.

Real-time pricing from the on-chain AMM model is taken as reference and used in risk calculation and liquidation. This is important for widening and speeding up the leverage trading market in a decentralized environment, as compared to waiting for a Chainlink oracle to be created or updating market data. As Vitalik suggested, prices from a DEX provide native data maintained on-chain, are secured by technical and economical design, and are the defacto oracle for more DeFi use cases, such as margin trading.

To avoid flash loan attacks, there are restrictions implemented in the protocol design:

  • No open, close, or liquidation operations can be in the same transaction.
  • Liquidation operations happen in two transactions to avoid attackers manipulating prices and triggering liquidations to gain benefits or creating cascading liquidation events.

Furthermore, 1/3 of the transaction fees are set aside as insurance to compensate lenders if the loan fails to maintain the solvency of the pool.

OLE Tokenomics

Please note OLE token will NOT be launched until a further stage.

The OLE token is the governance token that allows users to vote, as well as stake to get rewards and other protocol privileges. Users can mine OLE through borrowing, lending, liquidating positions, farming, or inviting friends to join the protocol.

We believe in the power of community, so we reserved 70% of all OLE tokens for distribution for community mining, and the remaining 30% are held by the development team and project investors in a prolonged vesting schedule.

Full details of the tokenomics will be provided before the OLE token launch in an Initial DEX Offering (IDO). Please see below for how to Join Us to stay up to date on further announcements.

License

The smart contracts in the OpenLeverage Repository, except libraries or interfaces for external integration, will be under the Business Source License 1.1 — effectively a time-delayed GPL-2.0-or-later license. The license limits the use of the OpenLeverage source code in a commercial or production setting for up to two years, at which point it will convert to a GPL license into perpetuity.

Audits

We believe security is of utmost importance for our community and followed secure development best practices throughout its development.

Our security review process included:

  • A full-length audit from Certik
  • An audit by Peckshield is underway
  • A comprehensive test suite, including automated tests with Truffle

Major bugs discovered as part of the testing and auditing process were fixed. While we have tried our hardest to ensure the safety of the OpenLeverage protocol, we cannot guarantee all bugs have already been discovered and resolved.

To help find any remaining vulnerabilities, a public bug bounty will run over the next 30 days, with up to $50,000 offered for critical bugs. More detail on the public bug bounty can be found here.

What’s Next for OpenLeverage

  • The OpenLeverage smart contracts have been deployed to the Kovan testnet with Uniswap V2 Kovan integration, giving the community time to get hands-on experience with the protocol and DApp before the official launch.
  • Mainnet support will be launched on Ethereum with Uniswap V3, date to be followed.
  • BSC version will be deployed with Integration to Pancakeswap.
  • OpenLeverage is already on the whitelist of Arbitrum. A Layer 2 solution is under development and test. The gas cost will be significantly lower with Arbitrum.
  • Partnering with projects to integrate with the OpenLeverage Protocol.
  • Additional infrastructure to support tranches lending, order routing cross DEXs, margin trading with limit orders, and various other use cases will be built with the OpenLeverage community after the mainnet launch.

Join Us

To learn more about OpenLeverage:

If you are interested in integrating with OpenLeverage or joining us to work on open finance as a Community Manager or Blockchain Developer, please email us at hello@openleverage.finance. We are looking forward to hearing from you.

--

--

OpenLeverage
OpenLeverage

Written by OpenLeverage

A permissionless decentralized lending and margin trading protocol. https://openleverage.finance/, http://discord.gg/openleverage.

Responses (1)