Giter Club home page Giter Club logo

instaswap-sdk's Introduction

Cosmos Swap

Swap any two tokens on the Cosmos network

An account can stake coins into a pool that is composed of ATOM and any other single token. Once a pool has been created by an account(s) staking their coins, people can than swap/trade within that pool to gain one token over another.

How many tokens an individual gets from another token is relative to how many tokens of each exist in the pool. Say you have a pool of two tokens, ATOM and RUNE. There are 20 RUNE tokens, and 50 ATOM tokens. If you swap 10 RUNE tokens, we add those to the pool (for a total of 30), see that our addition makes up for 1/3rd of the present tokens, which means we get 1/3rd of the ATOM tokens, which is 16.6666666667. This ensures that we never run out of tokens in a pool from swapping.

Development

Setup a local server

make start

See test and demo scripts for how to use the API

Test

Run tests

make test

TODO

  • Stakers gain fees when people swap tokens
  • Use real accAddresses instead of hacky made up accounts stored without this module's KVstore.

instaswap-sdk's People

Contributors

jackzampolin avatar gamarin2 avatar cbarraford avatar okwme avatar tac0turtle avatar sunnya97 avatar hschoenburg avatar maxim-levy avatar maxmijn avatar zramsay avatar jpthor avatar liamsi avatar yangyanqing avatar alexanderbez avatar eg-easy avatar dimiandre avatar patrickwieth avatar masashisalvador57f avatar jtakalai avatar jleni avatar hello2mao avatar cpolitano avatar bigmaning avatar t-bast avatar aknuds1 avatar scriptonist avatar andynog avatar corollari avatar

Watchers

James Cloos 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.