Coder Social home page Coder Social logo

jex-sc-dex-pair's Introduction

jex-sc-dex-pair

Liquidity pool smart contract with x*y=k AMM

List of endpoints

  • addInitialLiquidity
  • addLiquidity
  • addLiquiditySingle
  • configureLiqProvidersFees
  • configurePlatformFees
  • enableMintBurn
  • estimateAddLiquiditySingle
  • estimateAmountIn
  • estimateAmountOut
  • estimateRemoveLiquidity
  • estimateRemoveLiquiditySingle
  • getAnalyticsForLastEpochs
  • getFirstToken
  • getLiqProvidersFees
  • getPlatformFees
  • getPlatformFeesReceiver
  • getSecondToken
  • getStatus
  • init
  • isPaused
  • issueLpToken
  • pause
  • removeLiquidity
  • removeLiquiditySingle
  • swapTokensFixedInput
  • swapTokensFixedOutput
  • unpause

How-to deploy a pool

Deploy the smart contract

Prepare snippets shell file in interaction folder.

And run:

xxx.snippets.sh deploy

Check results in the explorer.

Issue LP token

xxx.snippets.sh issueLpToken

Check results in the explorer.

Enable LP token mint/burn

The smart contract needs to be able to mint and burn LP tokens.

To do so, run:

xxx.snippets.sh enableMintBurn

Check results in the explorer.

Configure fees

Configure fees for liquidity providers and platform fees.

xxx.snippets.sh configureLiqProvidersFees
xxx.snippets.sh configurePlatformFees

Note: 100 = 1%, 20 = 0.2%

Add initial liquidity

Adding initial liquidity will determine the initial exchange rate of tokens and the value of 1 LP token.

For example, adding 10,000 JEX and 1 wEGLD:

  • initial exchange rate will be 1 wEGLD = 10,000 JEX (1 JEX = 0.0001 wEGLD)
  • 1 LP token will be worth (1 wEGLD + 10,000 JEX)
xxx.snippets.sh addInitialLiquidity

Check results in the explorer.

jex-sc-dex-pair's People

Contributors

javier-nft avatar

Watchers

 avatar

Forkers

morphesdt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.