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
  1. DEVELOPERS
  2. Contract

MESHSwapView

PreviousMESHswapRouterNextFactory

Last updated 2 years ago

This contract can check asset details and exchange estimates of meshswap service

Address

  • Polygon Mainnet :

Read-Only Functions

getPoolData

function getPoolData(address lp) public view returns (
        uint miningRate,
        uint rateDecimals,
        address token0,
        uint reserveA,
        address token1,
        uint reserveB,
        uint airdropCount,
        address[] memory airdropTokens,
        uint[] memory airdropSettings 
    )
  • Details of the pool

  • Airdrop only between startBlock and endBlock of blocks in the network

  • Parameters

    • miningRate : MESH distribution ratio numerator value

    • rateDecimals : MESH distribution ratio denominator

      • 예) Daily MESH distribution ratio

        • miningRate - 130323276365080043, rateDecimals - 10000000000000000

        • 130323276365080043 / 10000000000000000 = 13.03...%

    • token0 : LP token0

    • reserveA : Amount of token0 held by LP

    • token1 : LP token1

    • reserveB : Amount of token1 held by LP

    • airdropCount : Number of airdrop plans in progress at LP

    • airdropTokens : Airdrop token address array

    • airdropSettings : Airdrop info array

      • [0]: blockAmount, [1]: startBlock, [2]: endBlock

  • airdropSettings Data format

    • 예) Token0, Token1 Airdrop

      • airdropTokens = [ Token0 address, Token1 address]

      • airdropSettings = [ Token0 blockAmount, Token0 startBlock, Token0 endBlock, Token1 blockAmount, Token1 startBlock, Token1 endBlock ]

getPendingReward

function getPendingReward(address lp, address user) public view returns ( 
    uint meshReward, 
    uint airdropCount, 
    address[] memory airdropTokens, 
    uint[] memory airdropRewards )
  • User's claimable reward information

  • Parameters

    • meshReward : Claimable MESH

    • airdropCount : Number of airdrop plans the LP has

    • airdropTokens : Airdrop token address array

    • airdropRewards : Arrangement of Airdrop token amount Information claimable

  • airdrop data format

    • 예) Token0, Token1 Airdrop

      • airdropTokens = [ Token0 address, Token1 address]

      • airdropSettings = [ Token0 reward, Token1 reward ]

estimateSwap

function estimateSwap(
    uint amountIn, 
    address[] memory path
) public view returns (uint amountOut)
  • MESHswap swap estimate lookup function

  • Input Parameters

    • amountIn : Token amount to be exchanged

    • path : exchange token path

  • example

    • WMATIC -> MESH

      • amountIn = 1000000000000000000 ( =1 WMATIC )

      • path = ["0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270", "0x82362Ec182Db3Cf7829014Bc61E9BE8a2E82868a"]

    • WMATIC -> USDC -> MESH

      • path = ["0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270", "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", "0x82362Ec182Db3Cf7829014Bc61E9BE8a2E82868a"]

0xF61e4ede9128A9FA9a128cB7D161F4e73bd464Da