- Introduction
- Sections
The Contract to hold Pair Between Swap Tokens.
Name | Type | Description | optional |
---|---|---|---|
pair | TokenPair | Token Pair to hold two token | no |
lp_token_contract | ContractInstantiationInfo | ContractInstantiationInfo | no |
factory_info | Contract | Factory to manage this pair moving forwards | yes |
prng_seed | Binary | seed to use for viewing key | no |
entropy | Binary | Use to calculate viewing key | no |
admin_auth | Contract | Set the admin of AMMPair Contract | no |
custom_fee | CustomFee | The fee for the AMMPair, set to none to inherit fee from Factory | yes |
staking_contract | StakingContractInit | Staking Contract Init Config | yes |
Add address to whitelist, group of addresses which fee doesn't apply.
Name | Type | Description | optional |
---|---|---|---|
address | String | The address to add to whitelist | no |
{
"complete_task": {
"status": "success"
}
}
Address to remove from whitelist.
Name | Type | Description | optional |
---|---|---|---|
addresses | Vec | The addresses to remove from whitelist | no |
{
"complete_task": {
"status": "success"
}
}
Set Custom Pair Fee to be used in Pair Contract.
Name | Type | Description | optional |
---|---|---|---|
custom_fee | CustomFee | Custom Shade Dao and LP Fees | yes |
{
"complete_task": {
"status": "success"
}
}
Set the Admin contract.
Name | Type | Description | optional |
---|---|---|---|
admin_auth | Contract | The admin authentication contract | yes |
{
"complete_task": {
"status": "success"
}
}
Recover Funds for Address.
Name | Type | Description | optional |
---|---|---|---|
token | TokenType | Token type of token to be recovered | no |
amount | Unit128 | The amount | no |
to | String | The address to send the amount to | no |
msg | Binary | Message to pass in the send | yes |
{
"complete_task": {
"status": "success"
}
}
Get information about the token pair.
Name | Type | Description | optional |
---|---|---|---|
{
"liquidity_token": "LP Token Contract",
"factory": "Factory Contract",
"pair": "Token Pair with two Token Type",
"amount_0": "Balance of Token 0",
"amount_1": "Balance of Token 1",
"total_liquidity": "Total liquidity of pool",
"contract_version": "Contract Version of the Smart Contract"
}
Get Estimated Price for amount.
Name | Type | Description | optional |
---|---|---|---|
offer | TokenAmount | amount for price estimation | no |
exclude_fee | bool | exclude fee in price estimation | yes |
{
"estimated_price": "String",
}
Get Information about trade history.
Name | Type | Description | optional |
---|---|---|---|
api_key | String | The API key to authenticate | no |
pagination | Pagination | The start and limit | no |
{
"data": "[array of trade history]",
}
{
"pair": "TokenPair",
"lp_token_contract": "ContractInstantiationInfo",
"factory_info": "Contract",
"prng_seed": "Binary",
"entropy": "Binary",
"admin_auth": "Contract",
"staking_contract": " Option<StakingContractInit>",
"custom_fee": "Option<CustomFee>",
"callback": "Option<Callback>",
}
Get Count of trade for pair contract.
Name | Type | Description | optional |
---|---|---|---|
{
"count": "trade count",
}
Get Configuration of AMMPair Contract.
Name | Type | Description | optional |
---|---|---|---|
{
"factory_contract": "Contract",
"lp_token": "Contract",
"staking_contract": "Option<Contract>",
"pair": "TokenPair",
"custom_fee": "Option<CustomFee>",
}
Get Estimated Liquidity.
Name | Type | Description | optional |
---|---|---|---|
deposit | TokenPairAmount | Token Pair to deposit | no |
{
"lp_token": "Uint128",
"total_lp_token": "Uint128",
}
Get All addresses from whitelist.
Name | Type | Description | optional |
---|---|---|---|
{
"amount": "Get all whitelist's addresses",
}
Swap Native Tokens.
Name | Type | Description | optional |
---|---|---|---|
offer | TokenAmount | Amount and Token Type | no |
expected_return | Uint128 | Slippage, amount willing to accept | yes |
to | String | The address to remove from LP | yes |
{
"complete_task": {
"status": "success"
}
}
Update the viewing Key for a Pair.
Name | Type | Description | optional |
---|---|---|---|
viewing_key | String | The viewing key | no |
{
"complete_task": {
"status": "success"
}
}
Extension of the SNIP20 receive callback used when receiving SNIP20 tokens used for trades.
Name | Type | Description | Optional |
---|---|---|---|
from | String | who invokes the callback | no |
amount | Uint128 | amount sent | no |
msg | Binary | Message to Invoke in Pair Contract | yes |
{
"complete_task": {
"status": "success"
}
}
Add Liquidity to the Pool and Staking Contract if configured.
Name | Type | Description | optional |
---|---|---|---|
deposit | TokenPairAmount | Amount and Token Type | no |
expected_return | Uint128 | slippage, amount willing to accept | yes |
staking | bool | Add his LP token to Staking if it is allowed | yes |
{
"complete_task": {
"status": "success"
}
}
Swap tokens.
Name | Type | Description | optional |
---|---|---|---|
to | String | who invokes the callback | yes |
expected_return | Uint128 | Slippage, amount willing to accept | yes |
{
"complete_task": {
"status": "success"
}
}
Remove liquidity for address and remove from staking if applicable.
Name | Type | Description | optional |
---|---|---|---|
from | String | address to remove liquidity | yes |
{
"complete_task": {
"status": "success"
}
}