Pair

Transaction

Provide Liquidity

Send user’s assets to a STARFLEIT contract in order to provide liquidity.

The asset can be both a CW20 token and a native token(including IBC token) and the key under info: token and native_token distinguish them.

{
  "provide_liquidity": {
    "assets": [
      {
        "info" : {
            "token": {
                "contract_addr": "<Addr>"
            }
        },
        "amount": "10"
      },
      {
        "info" : {
            "native_token": {
                "denom": "afet"
            }
        },
        "amount": "10"
      }
    ],
    "receiver": "<Addr>", // optional, LP token receiver
    "deadline": 1682583565, // optional, unix epoch
    "slippage_tolerance": "0.005" // optional
  }
}

Swap

Swap between the given two tokens. It can be considered as trade.
offer_asset is your source asset and to is a destination address to receive, which is optional.
Base64() means that this JSON message should be encoded into Base64.

{
    "swap": {
        "offer_asset": {
            "info" : {
                "native_token": {
                    "denom": "afet"
                }
            },
            "amount": "10"
        },
        "belief_price": 0.1,  // optional
        "max_spread": 0.1, // optional
        "to": "<Addr>", // optional
        "deadline": 1682583565 // optional, unix epoch
    }
}
{
    "send": {
        "contract": "<Addr>",
        "amount": "10",
        "msg": Base64({
            "swap": {
                "offer_asset": {
                    "info" : {
                        "token": {
                            "contract_addr": "<Addr>"
                        }
                    },
                    "amount": "10"
                },
                "belief_price": 0.1,  // optional
                "max_spread": 0.1, // optional
                "to": "<Addr>", // optional
                "deadline": 1682583565 // optional, unix epoch
            }
        })
    }
}

Query

Pool

{
    "pool": {}
}

Simulation

{
    "simulation": {
        "offer_asset": {
            "info" : {
                "token": {
                    "contract_addr": "<Addr>"
                }
            },
            "amount": "10"
        }
    }
}

Reverse Simulation

{
    "reverse_simulation": {
        "ask_asset": {
            "info" : {
                "token": {
                    "contract_addr": "<Addr>"
                }
            },
            "amount": "10"
        }
    }
}