KLAYswap
English
English
  • Introduction
  • Protocol Overview
  • Core Concept
  • KLAYswap Advantages
  • Risk & Security
  • Privacy Policy
  • Audit
  • TOKENOMICS
    • KSP
      • KSP TOKENOMICS
      • Automation of KSP distribution rate
        • Voting policy on passing governance
        • KSP distribution ratio reflection policy
      • KSP Allocation
  • PRODUCT
    • SWAP
    • Single-side Deposit
      • Detailed policy of Single Deposit
    • Pair Deposit
    • V3 Pair Deposit
      • V2 to V3 Migration
        • V2 to V3 Migration Guide
        • V2 to V3 Migration Policy
      • V3 Pair Deposit
        • V3 Deposit Guide
        • V3 pair Deposit Policy
      • V3 to V3 Migration
        • V3 to V3 Migration Guide
        • V3 to V3 Migration Policy
      • V3 Pair Withdraw
        • V3 Withdraw Guide
        • V3 Withdraw Policy
    • Plus Deposit
      • Detailed policy of Plus Deposit
    • Long/Short Position Deposit
      • Open and Close Long/Short Positions
        • Open Short Positions
        • Open Long Positions
        • Remove Long Position
        • Remove Short Position
      • Position Deposit Details Policy
    • KSP Staking & Voting
      • Staking, Pool Voting Policy
    • Governance
      • Governance Voting Policy
    • Drops
    • Ecopot
    • Pool Airdrop
    • APR & APY
      • TVL
      • Pool
      • Staking
    • Interest rate
  • DEVELOPERS
    • Contract
      • Factory
      • Exchange
      • PoolVoting
      • VotingKSP
      • Treasury
      • Distribution
      • Governor
      • SinglePool
      • SinglePool Factory
      • PlusPool
      • PlusPool Factory
      • Store
      • Utils
      • Single/Plus Utils
      • Helper
      • EcoPotVoting
      • EcoPot
      • V3
        • V3Factory
        • V3Pool
        • NonfungiblePositionManager
        • NonfungibleTokenPositionDescriptor
        • V3SwapRouter
        • V3Migrator
        • V3Estimator
        • PositionMigrator
        • V3Treasury
        • V3AirdropOperator
        • UniversalRouter
    • Airdrop
      • Set Airdrop Operator
      • Start Airdrop
    • EcoPot
      • Set EcoPot
      • Start EcoPot
  • HOW-TO GUIDES
    • KLAYswap Guide
    • How to add liquidity on KLAYswap
    • [Burrito Wallet] How to deposit assets using mobile devices?
    • How to create a liquidity pool on KLAYswap
    • How to stake and vote on KLAYswap
    • How to deposit assets
      • Deposit Klaytn-based assets
      • Deposit Ethereum-based assets
      • Deposit XRP
    • FAQ
  • KLAYswap
  • Orbit Bridge
  • KLAYswap git
  • Orbit Bridge git
  • KLAYswap audit report
Powered by GitBook
On this page
  • Code
  • Address
  • Events, Read-Only Functions, and State-Changing Functions

Was this helpful?

  1. DEVELOPERS
  2. Contract

Helper

PreviousSingle/Plus UtilsNextEcoPotVoting

Last updated 2 years ago

Was this helpful?

The Helper smart contract is a contract that helps deposit LP with single token, even if you do not bring two tokens.

Code

Github Link: (Will be updated after official launch)

Address

  • Cypress :

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

State-Changing Functions

estimateLP

function estimateLP(address lp, address token, uint amount, uint swap, bool validPool) public view returns (uint estLP, uint realInput, uint estTarget)
  • Method to estimate the expected amounts, depositing with single token.

  • Parameters

    • lp : Address of LP token

    • token : Token address to be deposited

    • amount : Amount of token not to be swapped

    • swap : Amount of token to swap

    • validPool : Whether it is a pool with KSP rewards

  • Returns

    • estLP : Expected number of LP token to be minted

    • realInput : Actual number of input amount

    • estTarget : Amount of tokens to be receivedthrough swap

estimateSwapAmount

function estimateSwapAmount(address lp, address token, uint amount) public view returns (uint maxLP, uint maxSwap, uint targetAmount)
  • Method to change the mining weight per liquidity pair

  • Parameters

    • lp : Address of LP

    • token : Token address to be deposited

    • amount : Amount of token to be deposited

  • Returns

    • maxLP : Expected number of LP token to be minted

    • maxSwap : Expected amount of token to swap

    • targetAmount : Amount of tokens to be received through swap

State-Changing Functions

addLiquidityWithKlay

function addLiquidityWithKlay(address lp, uint limit, uint inputForLiquidity, uint targetForLiquidity) public payable
  • Method to add liquidity only providing KLAY.

  • Parameters

    • lp : address of LP token

    • limit : Minimum amounts of LP tokens to be minted.

    • inputForLiquidity : Expected amount of KLAY to provide LP

      • 1% slippage allowed

    • targetForLiquidity : Expected amount of target token to provide LP

      • 1% slippage allowed

    • msg.value : KLAY amount of token to be provided.

addLiquidityWithKCT

function addLiquidityWithKCT(address lp, address token, uint amount, uint limit, uint inputForLiquidity, uint targetForLiquidity) public
  • Method to add liquidity only providing single token.

  • Parameters

    • lp : address of LP token

    • token : Token address to be deposited

    • amount : Amount of token to be deposited

    • limit : Minimum amounts of LP tokens to be minted.

    • inputForLiquidity : Expected amount of input token to provide LP

      • 1% slippage allowed

    • targetForLiquidity : Expected amount of target token to provide LP

      • 1% slippage allowed

0x0363053524610888Fb883A5C0b16Fb55aA4701Cf