LogoLogo
  • MetaLend Litepaper
  • MetaLend + Blast + Thruster Trading Competition
  • MetaLend Audits and Security Updates
  • MetaLend Ronin Lottery & Trading Competitions
  • Bridging Between Ronin, ETH, Polygon and BSC
  • MetaLend Trading
  • Crypto Wallets
  • Privacy Policy
  • Terms Of Service
  • MetaLend Deposit Bonus - December 2024
  • Ronin Terms of Service
Powered by GitBook
On this page
  • MetaLend Limit Orders on Blast
  • MetaLend Implementation on Ronin Chain
  • Table of Contents
  • Borrowing Assets
  • Collateral Value & Max LTV
  • MetaLend <> Sky Mavis Partnership
  • Deployed Ronin Smart Contracts
  • Appraisal Engine
  • Staked RON
  • Risk and Liquidation
  • Supplying Assets
  • Interest Rate Calculations
  • Governance & Decentralization

MetaLend Litepaper

Last Updated: August 15th 2024

NextMetaLend + Blast + Thruster Trading Competition

Last updated 8 months ago

Official Dapp:

MetaLend gives users all the power of a centralized exchange, with none of the custodial risk. Today users only trust centralized exchanges with 10-20% of their crypto assets, yet these centralized exchanges still dominate the crypto trading market thanks to their easy to use interfaces. MetaLend is a website and app built on leading DeFi protocols that makes tracking, trading and borrowing against crypto assets as easy as using any exchange - all without taking custody of any user assets! Our users can:

  1. Track all their tokens across multiple wallets and chains in a single portfolio view

  2. Trade any on-chain tokens, including setting Limit or Recurring orders (coming soon)

  3. Take out loans against their crypto or easily trade with margin.

MetaLend currently has 35,000 users who leverage us to track and manage over $1B in self-custodied assets.

MetaLend Limit Orders on Blast

MetaLend Limit Orders allow traders to set a price target to execute buy or sell orders. Simply set your price target and we'll handle the rest!

  • On Chain and Non Custodial

  • Gasless - we'll cover all the gas costs associated with the order.

  • Built on Thruster and other leading Blast DEXs - all orders settle on DEXs native to Blast

How It Works

To create a limit order, a user needs to simply click on "Trade" and then go to the "Limit" tab. Once there the user can choose the tokens to swap, set a trigger price (in either the buying or selling token) and set an expiration date for the swap.

When setting a limit order, the token you are swapping can stay in your wallet and will be used to execute the limit order transaction when the trigger price is hit.

Once a limit order is created, it can be seen on the same page by scrolling down slightly. Here you can filter through all previous limit orders.

Once a limit order is fulfilled, you will receive an email from us with the exact transaction ID and the funds will instantly be deposited in your wallet. You will also receive emails if your limit order is expired or if it fails due to insufficient funds.

Fees

MetaLend implements tier based fees that vary depending on the trading volume you are executing. Fees are the same across market orders and limit orders.

Tier 1

Orders less than $10,000 in value have a 0.3% fee.

Tier 2

Orders between $10,000 - $50,000 in value have a 0.2% fee.

Tier 3:

Orders over $50,000 in value have a 0.1% fee.

MetaLend Implementation on Ronin Chain

Version 2.0, November 2nd 2023

Authors: Sudjeev Singh, Nikhil Bhardwaj, Tegjeev Singh, Jan Smrza

Abstract

In this paper we introduce a protocol which leverages liquidity pools with algorithmically set interest rates to enable lending against yield generating ERC-20 and ERC-721 assets, while keeping these assets in a productive state. MetaLend is a fork of and has been inspired by the Compound protocol.

Table of Contents

Borrowing Assets

MetaLend enables borrowers to take out ERC-20 based loans against yield-generating ERC-20 (Staked RON and Staked AXS) and ERC-721 assets (specifically Axie Lands). Borrowers still have full rights to any yield that is generated by those assets.

Collateral Value & Max LTV

All MetaLend loans are over-collateralized to protect the protocol from the risk of borrowers being unable or unwilling to pay back their loans.

If a borrower crosses the max loan-to-value, their collateral is subject to liquidation as defined by the rules in the ‘Risk and Liquidation’ section below.

Current Max Loan-To-Value: 30% for NFTs, 50% for Tokens

The Max LTV is set by ERC-721 asset category (e.g. Axie Land) and will initially be set by the centralized authority MetaLend, Inc. before eventually passing over to the owners of governance tokens upon decentralization.

Payback Period

There is no defined payback period for loans - if a borrower’s collateral value drops or their interest accrues to the point where they’ve crossed the max LTV the protocol will initiate asset liquidation to pay down the loan.

MetaLend <> Sky Mavis Partnership

The MetaLend protocol is deployed directly on the Ronin chain and all loans are processed via smart contracts on Ronin with no change of custody taking place, the only way a user can lose ownership of an asset is if the conditions of shortfall are met (see section on LTV/liquidations below).

MetaLend enables for asset owners to continue earning staking rewards during an active loan (e.g. Staked Land, AXS) - not only does it enable, but also has functionality to automate re-staking for the user directly via the dapp. In the future - MetaLend is working with the Ronin team to enable gameplay while an asset is being used as collateral for a loan.

Deployed Ronin Smart Contracts

Name
Address

Metalend Comptroller

Metalend MetaComptroller

Metalend WETH Market

Metalend cAxie

Metalend Interest Rate Model

Metalend Liquidity Assessor

Metalend Price Oracle

Metalend Appraisal Oracle

Metalend cAxieLand

Metalend Staking Manager

Metalend cAXS

Metalend cRON

Metalend Maximillion

Metalend Axie Mystic Validator

Appraisal Engine

ERC-721

All ERC-721 collateral that is locked within the MetaLend protocol is ascribed a value based on it’s specific appraisal engine. A specific appraisal engine is built for each ERC-721 category that is accepted as collateral, and all collateralized assets are re-appraised hourly (frequency will increase over time). These models are subject to update as we improve the system and push appraisals on chain.

MetaLend only supports Axie Lands as collateral and no longer supports Axies or Mystic Axies.

Model Version 2 (deployed May 23rd, 2023):

This update was made over Model Version 1 in order to provide users with more accurate and stable appraisals, while maintaining protocol stability.

Model Version 1 (Deprecated):

The appraisal engines are currently run off-chain and are expected to move on-chain at a future date when MetaLend, Inc. verifies it is secure and feasible at scale.

Protecting Appraisals Against Market Manipulation

In simpler terms, the appraisal process eliminates unusual transaction prices by examining the average deviation from the typical price of similar transactions, aka outliers. We have also added caps to certain collateral categories to ensure that the protocol does not grow to the point where there are so many assets within the protocol that it could influence market pricing.

ERC-20

MetaLend now accepts Staked AXS as collateral for loans. Users can add their AXS to MetaLend, it will automatically be Staked for them and they can claim any rewards once every 24 hours (MetaLend takes a 1% service fee of the rewards claimed). Users can borrow up to 50% of the value of their Staked AXS in WETH. MetaLend does currently have a 50,000 Staked AXS collateral limit within the protocol, this is to ensure financial stability and gradual growth of the protocol. We'll be working to hopefully raise this cap much higher soon!

For more details on this cap, please see the following analysis:

Compounding AXS Rewards

MetaLend provides automatic “compounding” (restaking) of staked rewards for supported assets including AXS and Axie Land. This is achieved through a “mediator” mechanism where a Ronin contract is created only once for each user EOA upon their first deposit of any stake-eligible asset. All transactions to the mediator are proxied directly to the Ronin official staking contracts (AXS, Axie Land) for managing accrual and payout of rewards.

The increased APR that MetaLend is able to provide through compounding is a result of daily restaking. Our offchain service layer checks whether a user is eligible to restake (claim + redeposit) based on Ronin’s 24 hour cooldown rule and facilitates this transaction, charging a 1% service fee on the daily accrued rewards.

Staked RON

Similar to AXS, Metalend allows users to stake their RON (currently through governing validators) and maximize yield through daily compounding. This supplied RON can also be used as collateral to take out a borrow against in any of our supported markets (RON, USDC, WETH).

Transfer In of Non-Collateralized RON

Transferring-in of non-collateralized RON can be done towards any validator which you currently do not use to hold collateralized RON. You can increase the balance at any time. We automatically re-stake the rewards from this validator to itself. For this, you have to supply RON to our re-staking admin address which sends the transactions on your behalf.

Transfer In of Collateralized RON

Transferring-in of collateralized RON can be done in two ways:

  1. Move existing stake towards a given validator to the protocol as a collateral. This does not refresh the lockup period and the collateral is available as soon as the lockup expires (or immediately if the lockup has already expired).

  2. Stake a new amount towards a validator. If the validator is already used to hold a non-collateralized stake amount, both the existing amount + the new amount are transferred to the protocol as a collateral. This amount is available as a collateral after 3 days once the lockup expires.

In both cases, the transfer can be done only to empty validators or validators which currently hold non-collateralized RON. At no point in time can the balance of a validator which holds collateralized RON be increased.

During this transfer, you have to select an empty validator or a validator which currently holds non-collateralized RON as a target for re-staking of the rewards.

In edge-case if you have all validators except the last one used to hold collateralized RON, you cannot use the last available validator as a collateral, because at least one validator must be available at all times as the target for re-staking rewards of validators which hold collateralized RON.

If a validator is used as a target for re-staking rewards of other validators and you would like to stake collateralized RON towards this validator, the target of all the validators will shift to the newly selected target.

Delegation lock-up (transfer out of non-col RON)

Since we re-stake rewards on your behalf daily, the lockup period is being refreshed continuously. This means as long as re-staking is being done for a given validator, it is not possible to transfer out the assets. Thus, in order to withdraw, you have to opt-out of the rewards (or select a new target for re-staking of the rewards) so that the lockup period can expire. After opting-out, you will be available to transfer out after 3 days at maximum. Re-staking is being done daily at approximately ~00:30 which refreshes the period for next 72 hours.

If the validator which holds non-collateralized RON is being used as a target for re-staking rewards you have to select a new target for re-staking of the rewards for this validator and all other validators which are currently re-staking towards it.

Delegation lock-up (transfer out of principal)

Due to the existing 3 day lockup period it takes at maximum 3 days for RON transferred to the protocol to become collateral. Once the period is over, your liquidity increases as well as your maximum available borrow. At this point the RON amount can be:

  1. Withdrawn by yourself (if you have sufficiently enough liquidity so that withdrawing the amount would not trigger shortfall)

  2. Liquidated (if you get into shortfall)

Working with multiple validators

Each validator which holds collateralized RON must have a different re-staking target (empty or validator with existing non-collateralized RON).

Each non-collateralized validator can re-staking rewards into itself or to a different empty validator or validator with existing non-collateralized RON.

If you would like to have some RON available to become a collateral at all times immediately (with no 3 days wait), we recommend staking a certain non-collateralized amount with a validator and opting-out of rewards (or selecting a different target for this validator). This means that the lockup period expires after 3 days and in the future, you can move the assets to the protocol which will be available to use as collateral immediately.

Risk and Liquidation

What happens if a borrower goes over the Max LTV (Borrow Limit)?

If a borrower exceeds their borrow limit, MetaLend will immediately list their collateral for sale with a 10% liquidation discount - liquidators will be able to repay up to 10% of the loan at a time. If the protocol is forced to sell a larger asset to pay down the loan, the difference (minus gas fees) will always go back to the borrower. MetaLend leverages this liquidation strategy to mitigate risk during a market crash.

Example:

If the max LTV is 30% and a user has 50 Axie Lands with a total worth of $100,000 as collateral - their max loan amount will be $30,000.

If said user takes out a $20,000 loan, they’re below the max loan - but if the Axie Land market drops and their collateral goes from being worth $100,000 to being worth $65,000 they are now above your max loan by $500. As their collateral is dropping in value the borrower will receive notifications from MetaLend (if they’ve provided their email/phone) and if the borrower doesn't pay back part of their loan or add more collateral to get back below the 30% mark then the protocol will sell Axie Lands needed to get them under the 30% threshold. Liquidators can pay back 10% of the loan at a time.

For example in this case a liquidators may buy a single Axie Land for $1000 and use that to pay off the underwater part of the loan. This would bring the loan to $19,000 and the collateral value to $64,000 - the borrower can still pay off the entire remainder of the loan and remove collateral if they wish.

Communication

MetaLend will communicate via email and/or text notifications (if user information is provided) to ensure users are aware as they approach their max LTV threshold.

Supplying Assets

MetaLend enables suppliers to stake their ERC-20 tokens into “lending pools” in order to earn APY. The funds in these liquidity pools are then used to provide loans to the borrowers. Upon adding funds into the pool, the lenders receive a mToken which represents their deposit and tracks their interest earned.

Lenders are paid out 85% of the total borrower interest, 15% goes to the protocol.

Functionally speaking, suppliers interest is accrued per ETH block mined and they can remove their deposited ERC-21 plus interest at any point.

Interest Rate Calculations

MetaLend leverages algorithmically set APYs to incentivize borrowers and lenders to behave in a way that ensures a base set of liquidity to remain within the MetaLend liquidity pools.

APY is variable and is a function of the Utilization of the liquidity pool - the higher the utilization of the pool, the higher the APY. We leverage two curves and an inflection point known as the ‘Kink’. The function of the kink is to define the utilization rate at which APY rapidly rises to incentivize borrowers and lenders to add more liquidity to the pool.

The exact APY curves for launch of the ETH pool to provide liquidity for Axie’s can be seen below:

Borrower Curve 1: y = 0.43x

Kink: 70%

Borrower Curve 2 Slope: y = 9x - 6

Lender APY Calculation: Borrow APY * Utilization Rate * Lender Rev Share

The APY curves are set by liquidity pool (e.g. ETH) and will initially be set by the centralized authority MetaLend, Inc. before eventually passing over to the owners of governance tokens upon decentralization.

Calculating the APY Using Rate Per Block

The Annual Percentage Yield (APY) for supplying or borrowing in each market can be calculated using the value of supplyRatePerBlock (for supply APY) or borrowRatePerBlock (for borrow APY) in this formula:

Rate = cToken.supplyRatePerBlock(); // Integer
Rate = 37893566
ETH Mantissa = 1 * 10 ^ 18 (ETH has 18 decimal places)
Blocks Per Day = 7200 (12 seconds per block)
Days Per Year = 365

APY = ((((Rate / ETH Mantissa * Blocks Per Day + 1) ^ Days Per Year)) - 1) * 100

Here is an example of calculating the supply and borrow APY with Web3.js JavaScript:

const ethMantissa = 1e18;
const blocksPerDay = 7200; // 12 seconds per block
const daysPerYear = 365;

const cToken = new web3.eth.Contract(cEthAbi, cEthAddress);
const supplyRatePerBlock = await cToken.methods.supplyRatePerBlock().call();
const borrowRatePerBlock = await cToken.methods.borrowRatePerBlock().call();
const supplyApy = (((Math.pow((supplyRatePerBlock / ethMantissa * blocksPerDay) + 1, daysPerYear))) - 1) * 100;
const borrowApy = (((Math.pow((borrowRatePerBlock / ethMantissa * blocksPerDay) + 1, daysPerYear))) - 1) * 100;
console.log(`Supply APY for ETH ${supplyApy} %`);
console.log(`Borrow APY for ETH ${borrowApy} %`);

Calculating the APR Using Rate Per Block

Here is an example of calculating the supply and borrow APR with Web3.js JavaScript:

const ethMantissa = 1e18;
const blocksPerYear = 5 * 60 * 24 * 365; // 12 seconds per block
const daysPerYear = 365;

const cToken = new web3.eth.Contract(cZrxAbi, cZrxAddress);
const supplyRatePerBlock = await cToken.methods.supplyRatePerBlock().call();
const borrowRatePerBlock = await cToken.methods.borrowRatePerBlock().call();
const supplyApr = supplyRatePerBlock / ethMantissa * blocksPerYear * 100;
const borrowApr = borrowRatePerBlock / ethMantissa * blocksPerYear * 100;
console.log(`Supply APR ${(supplyApr).toFixed(3)} %`);
console.log(`Borrow APR ${(borrowApr).toFixed(3)} %`);

Governance & Decentralization

The following rights in the protocol are controlled by the admin:

● The ability to list a new mToken market

● The ability to update the interest rate model per market

● The ability to update the appraisal engine per market

● The ability to withdraw the reserve of an mToken

● The ability to choose a new admin, such as a DAO controlled by the community; because this DAO can itself choose a new admin, the administration has the ability to evolve over time, based on the decisions of the stakeholders.

Contracts Logic contract with the implementation for the proxy - logic contract: Main proxy contract -

Admin of the proxy - the contract which has the ability to upgrade implementation which is secured by a multi-key gnosis safe Blast Gold Operator and Contract Address:

Each appraisal engine computes the floor price of its category. In the case of Axie Land, each land type defines a category (Savannah, Mystic, Forest and Arctic are the only types supported as collateral at this time). Metalend's floor price model, adapted from the Coinbase Cloud floor price model, is used in the calculation and can be accessed .

Each appraisal engine uses a K-Nearest Neighbor Classifier to learn about token pricing from real-time marketplace transactions. Upon receiving a token ID, it effectively locates comparable ERC-721 tokens of the same type that have been sold or listed for sale. The appraisal is then calculated by weighting these transaction prices with the category's floor price, in proportion to the available pricing data for the token. Metalend's floor price model, adapted from the Coinbase Cloud floor price model, is used in the calculation and can be accessed .

Metalend applies well-established outlier detection techniques during the data preprocessing phase of modeling. Specifically, a threshold on the log of transaction prices as well as an on all transactions are used to identify and remove anomalous transactions from consideration in the appraisal process.

Let’s consider Ronin’s official staking pool rewards (found on their ), for example 37% APR as of May 8 2023 - note that this is subject to change.

MetaLend will begin with centralized control of the protocol (such as choosing the interest rate model per asset), and over time, will transition to complete community and stakeholder control. Admin Currently the protocol admin is a secure on the Ronin chain with secure participation by core contributors, ensuring that no single actor can perform nefarious actions against the protocol.

https://blastscan.io/address/0x905de5924686ccd8c6a1142a99607b28571fdc6c
https://blastscan.io/address/0xD99d4faAAe29Faa37182BC719c2FF6A2F665dd9a
https://blastscan.io/address/0xbBc4dd33402742C6BDe5ba79A420840f2b6801bf
https://blastscan.io/address/0x434bc24332641ebd47e23a53a4356c6eb9626d4a
https://blastscan.io/address/0x17B08A20fb077F394B35bcbFc63071eD5227f787
Metalend.tech
Discord
here
here
median absolute deviation
interquartile range
staking dashboard
Gnosis multisig EOA
Borrowing Assets
Collateral Value & Max LTV
MetaLend <> Sky Mavis Partnership
Deployed Ronin Contracts
Appraisal Engine
Compounding AXS Rewards
Staked RON
Risk and Liquidation
Supplying Assets
Interest Rate Calculations
Governance & Decentralization
0x9E8FD99Fc64Cd2fF4B5846361a7eC457f2b3808e
0x9d5A8a83dd2B66236d52790a091C58ab666D1D8B
0x446450d57b4F26691b6cfac92BAdBA5C8D875a4E
0x4642720767A068e41fb7734Db39c00fb0B66a7Ee
0xCbB6DcDD897a3c1917100c651B1e5715f8bebA5D
0xBFA169E8cA62189388f752B89E6A5d31F8799d9e
0xCDd106f90E612841946e0b54ce33E8fC8E42079c
0x4f6da48BF7b065634995C5d177E6beB162a5602f
0xd54C02D1880E33f53ca2e516a0e979EeA30c265C
0xc52B45Fa1C7D5E9837737B5dfEA00440D6875Deb
0xC737cCA751142ac9b51cB8ef475042DfCea9287a
0x1Bf2b273745DF6a38E5e5f907DcD4d204A4bfE30
0x8EC33467a63ff3C660369D60dcBa3B98EbD3642d
0x03cBDc84a8352735133B7989199c1B4d06Fe2A77
Metalend.tech
135KB
Metalend <> Katana Price Oracle.pdf
pdf
Page cover image