Giter Site home page Giter Site logo

simpleswap's Introduction

simpleswap

simpleswap is a blockchain built using Cosmos SDK and Tendermint and created with Ignite CLI. ● Liquidity providers can provide liquidity in any of stablecoins whitelisted on module params ● Liquidity providers get share token after providing liquidity ● Tokens provided by liquidity providers are put on module account ● Users can swap any coins as long as liquidity's available ● Fee percentage (e.g. 0.3%) is configured on params ● Swap fee's given to liquidity providers ● Liquidity providers can withdraw liquidity and collected fees at any time

Get started

  • ignite version: v0.27.1
  • sudo curl https://get.ignite.com/[email protected] | sudo bash
  • sudo mv ignite /usr/local/bin/
ignite chain serve

serve command installs dependencies, builds, initializes, and starts your blockchain in development.

Interacting with simpleswap module

  • On another terminal use the commands given below

Create Pool (whitlelist)

- simpleswapd  tx simpleswap create-pool "1000eth,1000weth" "6,6" 100 --from alice
- Note: Can only be done by owner, removed for testing(anyone can create pool)

Add liquidity

- simpleswapd  tx simpleswap add-liquidity poole546c64ea2770e4bf76808611963b12673ed7af8d2a1194ce584ae9a5c987255 "1000eth,1000weth" --from alice
- Note: pool_id can be queried using simpleswapd query or a event is emitted with pool id when a new pool is created.
- By default pool id for weth and eth will be `poole546c64ea2770e4bf76808611963b12673ed7af8d2a1194ce584ae9a5c987255`

Swap

- simpleswapd tx simpleswap swap poole546c64ea2770e4bf76808611963b12673ed7af8d2a1194ce584ae9a5c987255 100weth 1eth --from alice

Withdraw

- simpleswapd tx simpleswap withdraw cosmos14tpfntxwkv30d6re3hrk8ny72r50vpalkapy2k poole546c64ea2770e4bf76808611963b12673ed7af8d2a1194ce584ae9a5c987255 200poole546c64ea2770e4bf76808611963b12673ed7af8d2a1194ce584ae9a5c987255 --from alice

Query

  • simpleswapd query simpleswap pools all 10
  • This will return pool data

Web Frontend

Ignite CLI has scaffolded a Vue.js-based web app in the vue directory. Run the following commands to install dependencies and start the app:

cd vue
npm install
npm run serve

The frontend app is built using the @starport/vue and @starport/vuex packages. For details, see the monorepo for Ignite front-end development.

Release

To release a new version of your blockchain, create and push a new tag with v prefix. A new draft release with the configured targets will be created.

git tag v0.1
git push origin v0.1

After a draft release is created, make your final changes from the release page and publish it.

Install

To install the latest version of your blockchain node's binary, execute the following command on your machine:

curl https://get.ignite.com/username/simpleswap@latest! | sudo bash

username/simpleswap should match the username and repo_name of the Github repository to which the source code was pushed. Learn more about the install process.

Learn more

simpleswap's People

Contributors

amityadav0 avatar

Watchers

 avatar

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.