Loopring Portal is Live: A Look Inside

Magic Pan
Loopring Protocol
Published in
4 min readApr 17, 2024

Introducing Loopring Portal

Loopring Portal functions as an isolated margin account, empowering users to borrow tokens with collateral. Alongside facilitating leveraged trading, it broadens the trading scope by tapping into liquidity from centralized exchanges (CEX) for tokens not available on Loopring DEX.

With the new feature, users can now engage in margin trading with tokens not available even on the Ethereum network. During bullish trends, users can borrow USDT to purchase their preferred tokens, while during bearish trends, they can borrow the target token to sell. This opens up profit-making opportunities in both upward and downward markets, relying on the user’s strategic trading skills.

Using Loopring Portal

To grasp the mechanics of Loopring Portal, let’s draw a parallel with a familiar scenario: owning a credit card with a predefined spending limit. Similar to this, users initially lock a certain amount of assets as collateral in Loopring L2 upon entering Loopring Portal, analogous to being granted a specific “credit” within the Portal.

Subsequently, users can borrow USDT to acquire other tokens or borrow different tokens to sell for USDT. The borrowing limit, or accessible “credit,” is contingent upon the precise value of collateral locked in Loopring L2. Higher collateral value translates to greater credit usability in Loopring Portal.

For transactions requiring assets not held by the user, borrowing incurs a fee charged on an hourly basis. In the initial transaction within Loopring Portal, users must borrow a certain asset to commence — either borrowing USDT to purchase a specific token or borrowing the token to sell for USDT.

Maintaining Delta-Nature

With each trade transaction, Loopring hedges the operation on a CEX, ensuring the Portal remains delta-neutral. Consequently, while users may experience gains or losses through their Portal activities, the Portal itself mitigates the risk of asset value fluctuation.

Position Close Mechanism

Upon locking assets as collateral in Loopring Portal, users pre-sign a contract agreeing to trade the entire collateral for a pre-minted NFT (non-fungible token) representing the position. Upon position closure, users must either purchase this NFT in case of a loss or receive the profit transferred by the Loopring Relayer if no loss is incurred.

In scenarios where user activities lead to losses nearing the value of collateral in Loopring L2, an automatic liquidation process is triggered. Given the absence of smart contract support in Loopring L2, liquidation is handled by Loopring Relayer. Presently, the Margin Level for forced liquidation aligns with Binance margin trading standards, set at 110%.

Users will have the option to provide additional collateral to prevent liquidation. Initially, only one asset will be permitted as collateral, requiring users to supply the same type of asset to increase collateral. However, in a future update, we plan to enable users to add multiple permitted assets as collateral, providing greater flexibility and risk management capabilities.

Understanding Margin Level

Margin Level is calculated as:

Margin Level = (Collateral Value + All Digital Assets in Loopring Portal Account) / (Total Liabilities + Outstanding Interest)

Where:

  • Collateral Value: Assets locked in Loopring L2 as collateral
  • Total Liabilities: Current total market value of all outstanding margin loans in the Loopring Portal Account
  • Outstanding Interest: (Amount of Each Margin Loan) * (Loan Time in Hours) * (Hourly Interest Rate)

Overall Flowchart

Trustless vs. Trusted Service

Loopring L2 doesn’t support the full complexity of completely trustless smart contract logic inherent in a general-purpose ZK-EVM (Zero-Knowledge Ethereum Virtual Machine) implementation. Consequently, the current iteration of Loopring Portal necessitates a degree of trust in Loopring Relayer’s operation. Users engage in trades with Loopring Relayer, pledging their collateral for a specific NFT representing their potential loss

  • Profit Scenario: If a user experiences a profit, they can acquire the corresponding NFT with negligible value. Loopring Relayer then disburses the profit to the user upon position closure.
  • Loss Scenario: In cases of partial or complete loss, users must purchase the NFT with the corresponding loss value. Consequently, there will be an asset loss in the user’s collateral after position closure.

Despite the reliance on Loopring Relayer, users benefit from transparent transaction recording within Loopring Portal. All transactions are rolled up on the Ethereum mainnet. This transaction history is not only accessible via the Loopring explorer but also retrievable from the Ethereum layer, encompassing NFT transactions during position closure.

In essence, user transactions are fully traceable, and in the event of any dispute, a non-revocable record exists for each party to arbitrate. While Loopring has endeavored to implement Loopring Portal in a trust-minimized manner, reliance on Loopring Relayer for settlement persists, accompanied by the trust assumption that Loopring Relayer will operate in good faith.

Moreover, given that all transactions are precisely rolled up on-chain, any malicious behavior from Loopring Relayer can be effectively addressed by the community. This evil behavior is almost impossible to happen, as the cost of unethical conduct from Loopring Relayer would be prohibitively high.

About Loopring

Loopring is an Ethereum Layer 2 zkRollup protocol for scalable, secure DeFi and NFT applications. Loopring builds non-custodial, high-performance products atop our L2, including the Loopring Wallet — a mobile Ethereum Smart Wallet, and the Loopring L2 web app — an entire L2 ecosystem, including orderbook and AMM DEX, NFTs and Loopring Earn products. To learn more, follow us on Medium or see Loopring.org.

Twitter Discord Reddit GitHub Docs YouTube Instagram

--

--