Send user's assets to SecretSwap contract and provide liquidity.
Assets can be both SNIP20 and native tokens. It can be distinguished with the key under info.token
or info.native_token
.
{
"provide_liquidity": {
"assets": [
{
"info": {
"token": {
"contract_addr": "<HumanAddr>",
"token_code_hash": "<HASH>",
"viewing_key": "" // empty
}
},
"amount": "10"
},
{
"info": {
"native_token": {
"denom": "uscrt"
}
},
"amount": "10"
}
],
"slippage_tolerance": 0.1 // optinonal
}
}
Swap between the given two tokens. offer_asset
is your source asset and to
is your destination token contract.
{
"swap": {
"offer_asset": {
"info": {
"native_token": {
"denom": "uluna"
}
},
"amount": "10"
},
"expected_return": "13", // optional
"belief_price": 0.1, // optional
"max_spread": 0.1, // optional
"to": "<HumanAddr>" // optional
}
}
{
"swap": {
"offer_asset": {
"info": {
"token": {
"contract_addr": "<HumanAddr>",
"token_code_hash": "<HASH>",
"viewing_key": "" // empty
}
},
"amount": "10"
},
"expected_return": "13", // optional
"belief_price": 0.1, // optional
"max_spread": 0.1, // optional
"to": "<HumanAddr>" // optional
}
}
{
"simulation": {
"offer_asset": {
"info": {
"token": {
"contract_addr": "<HumanAddr>",
"token_code_hash": "<HASH>",
"viewing_key": "" // empty
}
},
"amount": "10"
}
}
}
{
"reverse_simulation": {
"ask_asset": {
"info": {
"token": {
"contract_addr": "<HumanAddr>",
"token_code_hash": "<HASH>",
"viewing_key": "" // empty
}
},
"amount": "10"
}
}
}