Skip to content

SX Curve is an amplified AMM (automated market maker) swap liquidity pool designed efficiently for stable currencies and/or highly correlated assets.

License

Notifications You must be signed in to change notification settings

stableex/sx.curve

Repository files navigation

SX Curve

SX Curve is an amplified AMM (automated market maker) swap liquidity pool designed efficiently for stable currencies and/or highly correlated assets.

Audits

SHA256 Checksum

Local

$ git checkout v1.0.3
$ eosio-cpp --version
eosio-cpp version 1.7.0
$ eosio-cpp curve.sx.cpp -I include
$ shasum -a 256 curve.sx.wasm
a9aa7e60901cfc3ffe481099daa7f13f0b9cdba19c64ffd18aa5789932336f8c  curve.sx.wasm

EOS Mainnet

$ cleos -u https://eos.greymass.com get code curve.sx
code hash: a9aa7e60901cfc3ffe481099daa7f13f0b9cdba19c64ffd18aa5789932336f8c

Quickstart

convert

memo schema: swap,<min_return>,<pair_ids>

$ cleos transfer myaccount curve.sx "10.0000 USDT" "swap,0,SXA" --contract tethertether
# => receive "10.0000 USN@danchortoken"

deposit

memo schema: deposit,<pair_id>

$ cleos transfer myaccount curve.sx "10.0000 USDT" "deposit,SXA" --contract tethertether
$ cleos transfer myaccount curve.sx "10.0000 USN" "deposit,SXA" --contract danchortoken
$ cleos push action curve.sx deposit '["myaccount", "SXA", 200000]' -p myaccount
# => receive "20.0000 [email protected]"

withdraw

memo schema: N/A

$ cleos transfer myaccount curve.sx "20.0000 SXA" "" --contract lptoken.sx
# => receive "10.0000 USDT@tethertether" + "10.0000 USN@danchortoken"

cancel

$ cleos transfer myaccount curve.sx "10.0000 USDT" "deposit,SXA" --contract tethertether
$ cleos push action curve.sx cancel '["myaccount", "SXA"]' -p myaccount
# => receive "10.0000 USDT@tethertether"

C++

#include "curve.sx.hpp"

// User Inputs
const asset in = asset{10'0000, {"USDT", 4}};
const symbol_code pair_id = symbol_code{"SXA"};

// Calculated Output
const asset out = sx::curve::get_amount_out( in, pair_id );
//=> "10.0000 USN"

Dependencies

Testing

Requirements:

  • Bats - Bash Automated Testing System
  • EOSIO - nodeos is the core service daemon & cleos command line tool
  • Blanc - Toolchain for WebAssembly-based Blockchain Contracts
$ ./scripts/build.sh
$ ./scripts/restart.sh
$ ./test.sh

About

SX Curve is an amplified AMM (automated market maker) swap liquidity pool designed efficiently for stable currencies and/or highly correlated assets.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published