SX Vaults follow interest yielding strategies that are designed to maximize the yield of the deposited asset and minimize risk.
Local
$ git checkout v1.0.0
$ eosio-cpp vaults.sx.cpp -I include
$ shasum -a 256 vaults.sx.wasm
e7ef5b2a98b84aa70429e99e2bca9a3c52b87962b55fc0cd8b3632bd732f767e vaults.sx.wasm
EOS Mainnet
$ cleos -u https://api.eosn.io get code vaults.sx
code hash: e7ef5b2a98b84aa70429e99e2bca9a3c52b87962b55fc0cd8b3632bd732f767e
Users can send EOS
tokens to vaults.sx
to receive SXEOS
tokens.
Users can send SXEOS
tokens to vaults.sx
to receive back their EOS
+ any interest accumulated during the time period holding the SXEOS
asset.
Each vault is initially priced at 1:10,000 ratio, as interest are accrued in the vaults, the price ratio decreases, thus increasing the price.
deposit / supply
# `deposit` EOS => SXEOS @ 1:1 ratio
$ cleos transfer myaccount vaults.sx "1.0000 EOS" ""
# `redeem` SXEOS => EOS @ 1:1 ratio + accrued fees
$ cleos transfer myaccount vaults.sx "10000.0000 SXEOS" "" --contract token.sx
{asset} deposit
- vault deposit amount{asset} staked
- vault staked amount{asset} supply
- vault active supply{name} account
- account to/from deposit balance{time_point_sec} last_updated
- last updated timestamp
{
"deposit": {"quantity": "2000.0000 EOS", "contract": "eosio.token"},
"staked": {"quantity": "800.0000 EOS", "contract": "eosio.token"},
"supply": {"quantity": "1000000.0000 SXEOS", "contract": "token.sx"},
"account": "flash.sx",
"last_updated": "2020-11-23T00:00:00"
}
Set initial vault deposit balance & supply
- authority:
get_self()
{extended_symbol} deposit
- deposit symbol{symbol_code} supply_id
- liquidity supply symbol{name} account
- account to/from deposit balance
$ cleos push action vaults.sx setvault '[["4,EOS", "eosio.token"], "SXEOS", "flash.sx"]' -p vaults.sx
Update vault deposit balance & supply
- authority:
get_self()
or vaultaccount
{symbol_code} id
- deposit symbol
$ cleos push action vaults.sx update '["EOS"]' -p vaults.sx