Meshswap
  • Introduction
  • What is MESH?
    • MESH Allocation
    • MESH Tokenomics
    • MESH Redistribution Policy
  • Get started
    • Create a Wallet
    • Add Polygon Network & Tokens
    • How to move your assets to wallet
      • Transferring MATIC
        • [Binance, Kucoin, Gate.io] How to move MATIC from CEX to Wallet 1
        • [Coinbase, OKX, Upbit, Bithumb, Coinone] How to move MATIC to Wallet 2
        • [Polygon Bridge] How to move MATIC to Wallet 3
      • How to get WETH, MATIC, USDC, USDT, DAI
      • How to get oETH, oMATIC, oUSDC, oUSDT, oDAI
      • XRP: The Quickest and easiest way to transfer your asset
      • How to get oXRP in your KuCoin wallet and deposit in Meshswap
      • How to transfer BUSD from Binance to the Polygon network
      • Transferring TON
        • Create Wallets supporting TON network
        • How to transfer TON from wallet to Meshswap
        • How to transfer TON from Huobi to the Polygon network
  • More
    • Risk & Security
    • Privacy Policy
    • Contract & Audit
    • Contact & Team
    • Events
      • Early-bird MESH Airdrop Events(End)
      • Meshswap x Kucoin Partnership Giveaway Event(End)
  • PRODUCTS
    • Swaps
    • Lend
      • How to deposit your assets on Lending pools
      • The Detailed Policy of Lending Pool Deposit
    • Yield Farm
      • How to deposit your assets on Yield Farming pools
    • Leveraged Yield Farm
      • How to deposit your assets on Leveraged Yield Farming pools
      • Detailed Policy of Leverage Farm
    • Long/Short Margin Trading
      • Open and Close Long/Short Positions
        • Open Long Positions
        • Open Short Positions
        • Close Long Positions
        • Close Short Positions
      • Long/Short Margin Trading Details Policy
    • Interest rate
    • Stake
      • How to stake MESH
      • Staking Policy
    • Pool Voting
      • How to participate in Pool Voting with vMESH
    • Ecopot
    • Drops
    • Pool Airdrop
    • Governance
      • Governance Voting Policy
  • DEVELOPERS
    • Contract
      • MESH
      • MESHswapRouter
      • MESHSwapView
      • Factory
      • Exchange
      • PoolVoting
      • VotingMESH
      • Treasury
      • Distribution
      • Governor
      • SinglePool
      • SinglePool Factory
      • PlusPool
      • PlusPool Factory
      • EcoPotVoting
      • EcoPot
    • Airdrop
      • Set Airdrop Operator
      • Start Airdop
    • EcoPot
      • Set EcoPot
      • Start EcoPot
  • Meshswap Protocol
  • Orbit Bridge
Powered by GitBook
On this page
  • Code
  • Address
  • Events, Read-Only Functions, and State-Changing Functions
  1. DEVELOPERS
  2. Contract

PlusPool

This contract manages the leveraged assets of Meshswap's plus pool liquidity providers. Liquidity providers can maximize their returns with positive assets (deposited assets + utilized assets) by using positive deposits according to their deposited assets. However, a high asset utilization ratio can result in automatic returns, which can result in losses.

Code

Github Link: (Will be updated after official launch)

Address

  • Contract adress after production is deployed

Events, Read-Only Functions, and State-Changing Functions

Events

ChangeBorrowFactor

event ChangeBorrowFactor(uint newBorrowFactor);
  • Event log of borrow factor change

ChangeLiquidationFactor

event ChangeLiquidationFactor(uint newLiquidationFactor);
  • Event log of liquidation factor change

ChangeBorrowable

event ChangeBorrowable(address token, bool b);
  • Event that occurs when availability is changed

GiveReward

event GiveReward(address user, uint amount, uint lastIndex, uint rewardSum);
  • Event log of when mined MESH is claimed and distributed

  • Parameters

    • user : address of the user who claimed

    • amount : the amount of MESH claimed

    • lastIndex : index result of the pair of the wallet after claiming

    • rewardSum : The amount of MESH that has been accrued so far

GiveAirdropReward

event GiveAirdropReward(address user, address dist, uint amount, uint currentIndex, uint userAirdropSum);
  • Event log of when airdrop token is claimed and distributed

  • Parameters

    • user : address of the user who claimed

    • dist : Airdrop contract address

    • amount : the amount of token claimed

    • lastIndex : index result of the pair of the wallet after claiming

    • rewardSum : The amount of token that has been accrued so far

OpenPosition

event OpenPosition(address user, uint amount0, uint amount1, uint borrow0, uint borrow1, uint amountLP, uint userLP);
  • Events that occur when depositing to PlusPool

  • If the token to deposit is MESH, msg.value is provided.

  • Parameters

    • user : address of the user

    • amount0 : The deposit amount of token0

    • amount1 : The deposit amount of token1

    • borrow0 : The utilization amount of token0

    • borrow1: The utilization amount of token1

    • amountLP: The amount of LP tokens minted due to additional liquidity

    • userLP : the total amount of LP tokens minted due to additional liquidity

ClosePosition

event ClosePosition(address user, uint amountLP, uint amount0, uint amount1, uint userLP);
  • Events that occur when withdraw liquidity

  • Parameters

    • user : address of the user

    • amountLP: The amount of LP tokens burned due to liquidity removal

    • amount0 : The withdraw amount of token0

    • amount1 : The withdraw amount of token1

    • userLP : the total amount of LP tokens minted due to additional liquidity

Liquidate

event Liquidate(address user, uint idx, uint debt0, uint debt1, uint lp, uint debtRatio, uint time);
  • Event that occur when the automatic return system activates

  • Parameters

    • user : address of the user

    • idx : Number of auto-return count

    • dept0 : Number of token0 returned automatically

    • dept1 : Number of token1 returned automatically

    • lp : the total amount of LP tokens

    • debtRatio : Asset utilization ratio in case of automatic return

    • time : Automatic return time

Read-Only Functions

totalLP

  • mint/burn depending on liquidity addition/removal

lpToken

  • target liquidity pool address

token0

  • The first token address composed of the pair

token1

  • The second token address composed of the pair

borrowable0

  • Whether token0 can be borrowable

borrowable1

  • Whether token1 can be borrowable

liquidationFactor

  • automatic return factor

  • It is a value between 1 and 1e18, in units of 1/1e16%

  • Default - 0.85e18

borrowFactor

  • Utilization cost interest rate of utilized assets

  • It is a value between 1 and 1e18, in units of 1/1e16%

  • Default - 0.67e18

userLP

  • Number of PlusPool tokens held by each address

liquidationBonusRate

  • Ratio of resources to be used for MESH buyback & incineration in case of automatic return

liquidationCount

function liquidationCount(address user) public view returns (uint)
  • Returns the user's cumulative automatic return count

State-Changing Functions

claimReward

function claimReward() public
  • Method that a user calls to claim the claimable MESH that has accumulated for the pair

  • When called, MESH is claimed from the Factory and paid to msg.sender

  • Even if the method is not called directly, it is automatically called when the LP token balance of the user’s wallet changes.

    • When liquidity is added

    • When liquidity is removed

openPositionETH

function openPositionETH(uint amount1, uint borrow0, uint borrow1, uint minAmountLP) public payable
  • Method that depositing MATIC to PlusPool

  • After liquidity is provided, the LP token corresponding to the pool share is minted in the msg.sender wallet.

  • If there is claimable MESH when called, the claim proceeds to msg.sender.

  • Parameter

    • amount1 : The deposit amount of token1

    • borrow0 : The utilization amount of WMATIC

    • borrow1: The utilization amount of token1

    • minAmountLP : Minimum Guaranteed LP amount

openPositionToken

function openPositionToken(uint amount0, uint amount1, uint borrow0, uint borrow1, uint minAmountLP) public payable
  • Method that depositing to PlusPool

  • After liquidity is provided, the LP token corresponding to the pool share is minted in the msg.sender wallet.

  • If there is claimable MESH when called, the claim proceeds to msg.sender.

  • Parameter

    • amount0 : The deposit amount of token0

    • amount1 : The deposit amount of token1

    • borrow0 : The utilization amount of token0

    • borrow1: The utilization amount of token1

    • minAmountLP : Minimum Guaranteed LP amount

closePositionETH

function closePositionETH(uint amountLP, uint minAmount0, uint minAmount1) public
  • Returns the amount of LP tokens, and distributes the corresponding MATIC and token1 to the msg.sender wallet

  • The returned LP token amount is burned

  • If there is claimable MESH and Airdrop when called, the claim proceeds to msg.sender.

  • Parameters

    • amountLP: The amount of LP tokens burned due to liquidity removal

    • minAmount0 : The withdraw amount of token0

    • minAmount1 : The withdraw amount of token1

closePositionToken

function closePositionToken(uint amountLP, uint minAmount0, uint minAmount1) public
  • Returns the amount of LP tokens, and distributes the corresponding token0 and token1 to the msg.sender wallet

  • The returned LP token amount is burned

  • If there is claimable MESH and Airdrop when called, the claim proceeds to msg.sender.

  • Parameters

    • amountLP: The amount of LP tokens burned due to liquidity removal

    • minAmount0 : The withdraw amount of token0

    • minAmount1 : The withdraw amount of token1

PreviousSinglePool FactoryNextPlusPool Factory

Last updated 2 years ago