GithubHelp home page GithubHelp logo

Feature : XRC-20 And AMM protocol about xdagj HOT 2 OPEN

LucasMLK avatar LucasMLK commented on August 15, 2024 1
Feature : XRC-20 And AMM protocol

from xdagj.

Comments (2)

LucasMLK avatar LucasMLK commented on August 15, 2024 1

AMM(Automated Market Maker) Protocol

  1. add_liquidity xrc-20/xdag
index name bytes value Description
1 Protocol 1 2 AMM
2 Operation 1 1 add_liquidity
3 Token Name 5 BTC Token name
4 AmountDesire 8 1 The amount of token you wish to deposit.
5 AmountMin 1 5 Percentage of Minimal Deposited Token.
6 deadline 1 168801901704 request expiration time. (unix timestamp)
  1. add_liquidity xrc-20/xrc-20
index name bytes value Description
1 Protocol 1 2 AMM
2 Operation 1 2 add_liquidity
3 TokenA 5 BTC Token name A
4 TokenB 5 USDT Token name B
5 AmountADesire 8 1 The amount of token A you wish to deposit.
6 AmountBDesire 8 30000 The amount of token B you wish to deposit.
7 AmountAMin 1 5 Percentage of Minimal Deposited Token A.
8 AmountBMin 1 5 Percentage of Minimal Deposited Token B.
9 deadline 1 168801901704 request expiration time. (unix timestamp)
  1. remove_liquidity xrc-20/xdag
index name bytes value Description
1 Protocol 1 2 AMM
2 Operation 1 3 add_liquidity
3 Token Name 5 BTC Token name
4 Liquidity 8 1 Amount to transfer: States the amount of the xrc-20 to add_liquidity.
5 AmountAMin 1 5 Percentage of Minimal Deposited Token A.
6 AmountBMin 1 5 Percentage of Minimal Deposited Token B.
7 deadline 1 168801901704 request expiration time. (unix timestamp)
  1. remove_liquidity xrc-20/xrc-20
index name bytes value Description
1 Protocol 1 2 AMM
2 Operation 1 4 remove_liquidity
3 TokenA 5 BTC Token name of A
4 TokenB 5 USDT Token name of B
5 Liquidity 8 1 Amount to transfer: States the amount of the xrc-20 to add_liquidity.
6 AmountAMin 1 5 Percentage of Minimal Deposited Token A.
7 AmountBMin 1 5 Percentage of Minimal Deposited Token B.
8 deadline 1 168801901704 request expiration time. (unix timestamp)
  1. swap xrc-20/xdag
index name bytes value Description
1 Protocol 1 2 AMM
2 Operation 1 5 swap
3 amountIn 8 100 Swap Token Input Amount.
4 amountOutMin 8 1000000 Swap Token Min Output Amount.
5 path 15 BTC USDT Token name array(split by 5 bytes).
6 deadline 1 168801901704 request expiration time. (unix timestamp)
  1. swap xrc-20/xrc-20
index name bytes value Description
1 Protocol 1 2 AMM
2 Operation 1 6 swap
3 amountOut 8 100 Swap Token Output Amount.
4 amountInMax 8 1000000 Swap Token Max Output Amount.
5 path 15 BTC USDT Token name array(split by 5 bytes).
6 deadline 1 168801901704 request expiration time. (unix timestamp)

from xdagj.

LucasMLK avatar LucasMLK commented on August 15, 2024

Protocol Design:

index name bytes Type Description
1 Protocol 1 unsigned number Protocol: XRC-20:1 , AMM: 2

XRC-20 Protocol

  1. Deploy xrc-20
index name bytes value Description
1 Protocol 1 1 xrc-20
2 Token Name 5 BTC Token name
3 Operation 1 1 deploy
4 Max 8 21000000 Max supply: set max supply of the XRC-20
5 Lim 8 10000 Mint limit: If letting users mint to themsleves
6 Dec 1 8 Decimals: set decimal precision, max is 8
7 permissions 1 0 Permissions: 0: allow everyone mint, 1: only allow Deploy address mint
  1. Mint xrc-20
index name bytes value Description
1 Protocol 1 1 xrc-20
2 Token Name 5 BTC Token name
3 Operation 1 2 mint
4 Amount 16 100000000 Amount to mint: States the amount of the xrc-20 to mint. Has to be less than "lim" above if stated.
  1. Transfer xrc-20
index name bytes value Description
1 Protocol 1 1 xrc-20
2 Token Name 5 BTC Token name
3 Operation 1 3 transfer
4 Amount 16 100000000 Amount to transfer: States the amount of the xrc-20 to transfer.

from xdagj.

Related Issues (20)

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.