Source on GitHub

Qswap

Idx 13·Since e209·6 ABI versions
NAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAML
11Procedures
8Functions
1Structs
6ABI Versions

Current ABI

e209Open Snapshot →

Procedures

11State-changing
procIssueAsset#1
in 25Bout 8B
input4 fields · 25B
nametypeoffsetbyteslayout
assetNameuint6408
numberOfSharessint6488
unitOfMeasurementuint64168
numberOfDecimalPlacessint8241
output1 field · 8B
nametypeoffsetbyteslayout
issuedNumberOfSharessint6408
procTransferShareOwnershipAndPossession#2
in 80Bout 8B
input4 fields · 80B
nametypeoffsetbyteslayout
assetIssuerid032
assetNameuint64328
newOwnerAndPossessorid4032
amountsint64728
output1 field · 8B
nametypeoffsetbyteslayout
transferredAmountsint6408
procCreatePool#3
in 40Bout 1B
input2 fields · 40B
nametypeoffsetbyteslayout
assetIssuerid032
assetNameuint64328
output1 field · 1B
nametypeoffsetbyteslayout
successuint801
procAddLiquidity#4
in 64Bout 24B
input5 fields · 64B
nametypeoffsetbyteslayout
assetIssuerid032
assetNameuint64328
assetAmountDesiredsint64408
quAmountMinsint64488
assetAmountMinsint64568
output3 fields · 24B
nametypeoffsetbyteslayout
userIncreaseLiquiditysint6408
quAmountsint6488
assetAmountsint64168
procRemoveLiquidity#5
in 64Bout 16B
input5 fields · 64B
nametypeoffsetbyteslayout
assetIssuerid032
assetNameuint64328
burnLiquiditysint64408
quAmountMinsint64488
assetAmountMinsint64568
output2 fields · 16B
nametypeoffsetbyteslayout
quAmountsint6408
assetAmountsint6488
procSwapExactQuForAsset#6
in 48Bout 8B
input3 fields · 48B
nametypeoffsetbyteslayout
assetIssuerid032
assetNameuint64328
assetAmountOutMinsint64408
output1 field · 8B
nametypeoffsetbyteslayout
assetAmountOutsint6408
procSwapQuForExactAsset#7
in 48Bout 8B
input3 fields · 48B
nametypeoffsetbyteslayout
assetIssuerid032
assetNameuint64328
assetAmountOutsint64408
output1 field · 8B
nametypeoffsetbyteslayout
quAmountInsint6408
procSwapExactAssetForQu#8
in 56Bout 8B
input4 fields · 56B
nametypeoffsetbyteslayout
assetIssuerid032
assetNameuint64328
assetAmountInsint64408
quAmountOutMinsint64488
output1 field · 8B
nametypeoffsetbyteslayout
quAmountOutsint6408
procSwapAssetForExactQu#9
in 56Bout 8B
input4 fields · 56B
nametypeoffsetbyteslayout
assetIssuerid032
assetNameuint64328
assetAmountInMaxsint64408
quAmountOutsint64488
output1 field · 8B
nametypeoffsetbyteslayout
assetAmountInsint6408
procSetInvestRewardsInfo#10
in 32Bout 1B
input1 field · 32B
nametypeoffsetbyteslayout
newInvestRewardsIdid032
output1 field · 1B
nametypeoffsetbyteslayout
successuint801
procTransferShareManagementRights#11
in 52Bout 8B
input3 fields · 52B
nametypeoffsetbyteslayout
assetAsset040
numberOfSharessint64408
newManagingContractIndexuint32484
output1 field · 8B
nametypeoffsetbyteslayout
transferredNumberOfSharessint6408

Functions

8Read-only
funcFees#1
in 0Bout 32B
output8 fields · 32B
nametypeoffsetbyteslayout
assetIssuanceFeeuint3204
poolCreationFeeuint3244
transferFeeuint3284
swapFeeuint32124
shareholderFeeuint32164
investRewardsFeeuint32204
qxFeeuint32244
burnFeeuint32284
funcGetPoolBasicState#2
in 40Bout 32B
input2 fields · 40B
nametypeoffsetbyteslayout
assetIssuerid032
assetNameuint64328
output4 fields · 32B
nametypeoffsetbyteslayout
poolExistssint6408
reservedQuAmountsint6488
reservedAssetAmountsint64168
totalLiquiditysint64248
funcGetLiquidityOf#3
in 72Bout 8B
input3 fields · 72B
nametypeoffsetbyteslayout
assetIssuerid032
assetNameuint64328
accountid4032
output1 field · 8B
nametypeoffsetbyteslayout
liquiditysint6408
funcQuoteExactQuInput#4
in 48Bout 8B
input3 fields · 48B
nametypeoffsetbyteslayout
assetIssuerid032
assetNameuint64328
quAmountInsint64408
output1 field · 8B
nametypeoffsetbyteslayout
assetAmountOutsint6408
funcQuoteExactQuOutput#5
in 48Bout 8B
input3 fields · 48B
nametypeoffsetbyteslayout
assetIssuerid032
assetNameuint64328
quAmountOutsint64408
output1 field · 8B
nametypeoffsetbyteslayout
assetAmountInsint6408
funcQuoteExactAssetInput#6
in 48Bout 8B
input3 fields · 48B
nametypeoffsetbyteslayout
assetIssuerid032
assetNameuint64328
assetAmountInsint64408
output1 field · 8B
nametypeoffsetbyteslayout
quAmountOutsint6408
funcQuoteExactAssetOutput#7
in 48Bout 8B
input3 fields · 48B
nametypeoffsetbyteslayout
assetIssuerid032
assetNameuint64328
assetAmountOutsint64408
output1 field · 8B
nametypeoffsetbyteslayout
quAmountInsint6408
funcInvestRewardsInfo#8
in 0Bout 36B
output2 fields · 36B
nametypeoffsetbyteslayout
investRewardsFeeuint3204
investRewardsIdid432

Structs

1Shared types
structAsset
40B2 fields
fields
nametypeoffsetbyteslayout
issuerid032
assetNameuint64328

Raw JSON

/v1/contracts/13
contracts/13.json
{
  "contractIndex": 13,
  "contractName": "Qswap",
  "contractAddress": "NAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAML",
  "epoch": 209,
  "coreVersion": "v1.287.1",
  "structs": {
    "Asset": {
      "name": "Asset",
      "byteLength": 40,
      "fields": [
        {
          "name": "issuer",
          "type": "id",
          "offset": 0,
          "byteLength": 32
        },
        {
          "name": "assetName",
          "type": "uint64",
          "offset": 32,
          "byteLength": 8
        }
      ]
    }
  },
  "procedures": [
    {
      "kind": "procedure",
      "inputType": 1,
      "name": "IssueAsset",
      "inputFields": [
        {
          "name": "assetName",
          "type": "uint64",
          "offset": 0,
          "byteLength": 8
        },
        {
          "name": "numberOfShares",
          "type": "sint64",
          "offset": 8,
          "byteLength": 8
        },
        {
          "name": "unitOfMeasurement",
          "type": "uint64",
          "offset": 16,
          "byteLength": 8
        },
        {
          "name": "numberOfDecimalPlaces",
          "type": "sint8",
          "offset": 24,
          "byteLength": 1
        }
      ],
      "outputFields": [
        {
          "name": "issuedNumberOfShares",
          "type": "sint64",
          "offset": 0,
          "byteLength": 8
        }
      ],
      "inputSize": 25,
      "outputSize": 8
    },
    {
      "kind": "procedure",
      "inputType": 2,
      "name": "TransferShareOwnershipAndPossession",
      "inputFields": [
        {
          "name": "assetIssuer",
          "type": "id",
          "offset": 0,
          "byteLength": 32
        },
        {
          "name": "assetName",
          "type": "uint64",
          "offset": 32,
          "byteLength": 8
        },
        {
          "name": "newOwnerAndPossessor",
          "type": "id",
          "offset": 40,
          "byteLength": 32
        },
        {
          "name": "amount",
          "type": "sint64",
          "offset": 72,
          "byteLength": 8
        }
      ],
      "outputFields": [
        {
          "name": "transferredAmount",
          "type": "sint64",
          "offset": 0,
          "byteLength": 8
        }
      ],
      "inputSize": 80,
      "outputSize": 8
    },
    {
      "kind": "procedure",
      "inputType": 3,
      "name": "CreatePool",
      "inputFields": [
        {
          "name": "assetIssuer",
          "type": "id",
          "offset": 0,
          "byteLength": 32
        },
        {
          "name": "assetName",
          "type": "uint64",
          "offset": 32,
          "byteLength": 8
        }
      ],
      "outputFields": [
        {
          "name": "success",
          "type": "uint8",
          "offset": 0,
          "byteLength": 1
        }
      ],
      "inputSize": 40,
      "outputSize": 1
    },
    {
      "kind": "procedure",
      "inputType": 4,
      "name": "AddLiquidity",
      "inputFields": [
        {
          "name": "assetIssuer",
          "type": "id",
          "offset": 0,
          "byteLength": 32
        },
        {
          "name": "assetName",
          "type": "uint64",
          "offset": 32,
          "byteLength": 8
        },
        {
          "name": "assetAmountDesired",
          "type": "sint64",
          "offset": 40,
          "byteLength": 8
        },
        {
          "name": "quAmountMin",
          "type": "sint64",
          "offset": 48,
          "byteLength": 8
        },
        {
          "name": "assetAmountMin",
          "type": "sint64",
          "offset": 56,
          "byteLength": 8
        }
      ],
      "outputFields": [
        {
          "name": "userIncreaseLiquidity",
          "type": "sint64",
          "offset": 0,
          "byteLength": 8
        },
        {
          "name": "quAmount",
          "type": "sint64",
          "offset": 8,
          "byteLength": 8
        },
        {
          "name": "assetAmount",
          "type": "sint64",
          "offset": 16,
          "byteLength": 8
        }
      ],
      "inputSize": 64,
      "outputSize": 24
    },
    {
      "kind": "procedure",
      "inputType": 5,
      "name": "RemoveLiquidity",
      "inputFields": [
        {
          "name": "assetIssuer",
          "type": "id",
          "offset": 0,
          "byteLength": 32
        },
        {
          "name": "assetName",
          "type": "uint64",
          "offset": 32,
          "byteLength": 8
        },
        {
          "name": "burnLiquidity",
          "type": "sint64",
          "offset": 40,
          "byteLength": 8
        },
        {
          "name": "quAmountMin",
          "type": "sint64",
          "offset": 48,
          "byteLength": 8
        },
        {
          "name": "assetAmountMin",
          "type": "sint64",
          "offset": 56,
          "byteLength": 8
        }
      ],
      "outputFields": [
        {
          "name": "quAmount",
          "type": "sint64",
          "offset": 0,
          "byteLength": 8
        },
        {
          "name": "assetAmount",
          "type": "sint64",
          "offset": 8,
          "byteLength": 8
        }
      ],
      "inputSize": 64,
      "outputSize": 16
    },
    {
      "kind": "procedure",
      "inputType": 6,
      "name": "SwapExactQuForAsset",
      "inputFields": [
        {
          "name": "assetIssuer",
          "type": "id",
          "offset": 0,
          "byteLength": 32
        },
        {
          "name": "assetName",
          "type": "uint64",
          "offset": 32,
          "byteLength": 8
        },
        {
          "name": "assetAmountOutMin",
          "type": "sint64",
          "offset": 40,
          "byteLength": 8
        }
      ],
      "outputFields": [
        {
          "name": "assetAmountOut",
          "type": "sint64",
          "offset": 0,
          "byteLength": 8
        }
      ],
      "inputSize": 48,
      "outputSize": 8
    },
    {
      "kind": "procedure",
      "inputType": 7,
      "name": "SwapQuForExactAsset",
      "inputFields": [
        {
          "name": "assetIssuer",
          "type": "id",
          "offset": 0,
          "byteLength": 32
        },
        {
          "name": "assetName",
          "type": "uint64",
          "offset": 32,
          "byteLength": 8
        },
        {
          "name": "assetAmountOut",
          "type": "sint64",
          "offset": 40,
          "byteLength": 8
        }
      ],
      "outputFields": [
        {
          "name": "quAmountIn",
          "type": "sint64",
          "offset": 0,
          "byteLength": 8
        }
      ],
      "inputSize": 48,
      "outputSize": 8
    },
    {
      "kind": "procedure",
      "inputType": 8,
      "name": "SwapExactAssetForQu",
      "inputFields": [
        {
          "name": "assetIssuer",
          "type": "id",
          "offset": 0,
          "byteLength": 32
        },
        {
          "name": "assetName",
          "type": "uint64",
          "offset": 32,
          "byteLength": 8
        },
        {
          "name": "assetAmountIn",
          "type": "sint64",
          "offset": 40,
          "byteLength": 8
        },
        {
          "name": "quAmountOutMin",
          "type": "sint64",
          "offset": 48,
          "byteLength": 8
        }
      ],
      "outputFields": [
        {
          "name": "quAmountOut",
          "type": "sint64",
          "offset": 0,
          "byteLength": 8
        }
      ],
      "inputSize": 56,
      "outputSize": 8
    },
    {
      "kind": "procedure",
      "inputType": 9,
      "name": "SwapAssetForExactQu",
      "inputFields": [
        {
          "name": "assetIssuer",
          "type": "id",
          "offset": 0,
          "byteLength": 32
        },
        {
          "name": "assetName",
          "type": "uint64",
          "offset": 32,
          "byteLength": 8
        },
        {
          "name": "assetAmountInMax",
          "type": "sint64",
          "offset": 40,
          "byteLength": 8
        },
        {
          "name": "quAmountOut",
          "type": "sint64",
          "offset": 48,
          "byteLength": 8
        }
      ],
      "outputFields": [
        {
          "name": "assetAmountIn",
          "type": "sint64",
          "offset": 0,
          "byteLength": 8
        }
      ],
      "inputSize": 56,
      "outputSize": 8
    },
    {
      "kind": "procedure",
      "inputType": 10,
      "name": "SetInvestRewardsInfo",
      "inputFields": [
        {
          "name": "newInvestRewardsId",
          "type": "id",
          "offset": 0,
          "byteLength": 32
        }
      ],
      "outputFields": [
        {
          "name": "success",
          "type": "uint8",
          "offset": 0,
          "byteLength": 1
        }
      ],
      "inputSize": 32,
      "outputSize": 1
    },
    {
      "kind": "procedure",
      "inputType": 11,
      "name": "TransferShareManagementRights",
      "inputFields": [
        {
          "name": "asset",
          "type": "struct",
          "offset": 0,
          "byteLength": 40,
          "structRef": "Asset"
        },
        {
          "name": "numberOfShares",
          "type": "sint64",
          "offset": 40,
          "byteLength": 8
        },
        {
          "name": "newManagingContractIndex",
          "type": "uint32",
          "offset": 48,
          "byteLength": 4
        }
      ],
      "outputFields": [
        {
          "name": "transferredNumberOfShares",
          "type": "sint64",
          "offset": 0,
          "byteLength": 8
        }
      ],
      "inputSize": 52,
      "outputSize": 8
    }
  ],
  "functions": [
    {
      "kind": "function",
      "inputType": 1,
      "name": "Fees",
      "inputFields": [],
      "outputFields": [
        {
          "name": "assetIssuanceFee",
          "type": "uint32",
          "offset": 0,
          "byteLength": 4
        },
        {
          "name": "poolCreationFee",
          "type": "uint32",
          "offset": 4,
          "byteLength": 4
        },
        {
          "name": "transferFee",
          "type": "uint32",
          "offset": 8,
          "byteLength": 4
        },
        {
          "name": "swapFee",
          "type": "uint32",
          "offset": 12,
          "byteLength": 4
        },
        {
          "name": "shareholderFee",
          "type": "uint32",
          "offset": 16,
          "byteLength": 4
        },
        {
          "name": "investRewardsFee",
          "type": "uint32",
          "offset": 20,
          "byteLength": 4
        },
        {
          "name": "qxFee",
          "type": "uint32",
          "offset": 24,
          "byteLength": 4
        },
        {
          "name": "burnFee",
          "type": "uint32",
          "offset": 28,
          "byteLength": 4
        }
      ],
      "inputSize": 0,
      "outputSize": 32
    },
    {
      "kind": "function",
      "inputType": 2,
      "name": "GetPoolBasicState",
      "inputFields": [
        {
          "name": "assetIssuer",
          "type": "id",
          "offset": 0,
          "byteLength": 32
        },
        {
          "name": "assetName",
          "type": "uint64",
          "offset": 32,
          "byteLength": 8
        }
      ],
      "outputFields": [
        {
          "name": "poolExists",
          "type": "sint64",
          "offset": 0,
          "byteLength": 8
        },
        {
          "name": "reservedQuAmount",
          "type": "sint64",
          "offset": 8,
          "byteLength": 8
        },
        {
          "name": "reservedAssetAmount",
          "type": "sint64",
          "offset": 16,
          "byteLength": 8
        },
        {
          "name": "totalLiquidity",
          "type": "sint64",
          "offset": 24,
          "byteLength": 8
        }
      ],
      "inputSize": 40,
      "outputSize": 32
    },
    {
      "kind": "function",
      "inputType": 3,
      "name": "GetLiquidityOf",
      "inputFields": [
        {
          "name": "assetIssuer",
          "type": "id",
          "offset": 0,
          "byteLength": 32
        },
        {
          "name": "assetName",
          "type": "uint64",
          "offset": 32,
          "byteLength": 8
        },
        {
          "name": "account",
          "type": "id",
          "offset": 40,
          "byteLength": 32
        }
      ],
      "outputFields": [
        {
          "name": "liquidity",
          "type": "sint64",
          "offset": 0,
          "byteLength": 8
        }
      ],
      "inputSize": 72,
      "outputSize": 8
    },
    {
      "kind": "function",
      "inputType": 4,
      "name": "QuoteExactQuInput",
      "inputFields": [
        {
          "name": "assetIssuer",
          "type": "id",
          "offset": 0,
          "byteLength": 32
        },
        {
          "name": "assetName",
          "type": "uint64",
          "offset": 32,
          "byteLength": 8
        },
        {
          "name": "quAmountIn",
          "type": "sint64",
          "offset": 40,
          "byteLength": 8
        }
      ],
      "outputFields": [
        {
          "name": "assetAmountOut",
          "type": "sint64",
          "offset": 0,
          "byteLength": 8
        }
      ],
      "inputSize": 48,
      "outputSize": 8
    },
    {
      "kind": "function",
      "inputType": 5,
      "name": "QuoteExactQuOutput",
      "inputFields": [
        {
          "name": "assetIssuer",
          "type": "id",
          "offset": 0,
          "byteLength": 32
        },
        {
          "name": "assetName",
          "type": "uint64",
          "offset": 32,
          "byteLength": 8
        },
        {
          "name": "quAmountOut",
          "type": "sint64",
          "offset": 40,
          "byteLength": 8
        }
      ],
      "outputFields": [
        {
          "name": "assetAmountIn",
          "type": "sint64",
          "offset": 0,
          "byteLength": 8
        }
      ],
      "inputSize": 48,
      "outputSize": 8
    },
    {
      "kind": "function",
      "inputType": 6,
      "name": "QuoteExactAssetInput",
      "inputFields": [
        {
          "name": "assetIssuer",
          "type": "id",
          "offset": 0,
          "byteLength": 32
        },
        {
          "name": "assetName",
          "type": "uint64",
          "offset": 32,
          "byteLength": 8
        },
        {
          "name": "assetAmountIn",
          "type": "sint64",
          "offset": 40,
          "byteLength": 8
        }
      ],
      "outputFields": [
        {
          "name": "quAmountOut",
          "type": "sint64",
          "offset": 0,
          "byteLength": 8
        }
      ],
      "inputSize": 48,
      "outputSize": 8
    },
    {
      "kind": "function",
      "inputType": 7,
      "name": "QuoteExactAssetOutput",
      "inputFields": [
        {
          "name": "assetIssuer",
          "type": "id",
          "offset": 0,
          "byteLength": 32
        },
        {
          "name": "assetName",
          "type": "uint64",
          "offset": 32,
          "byteLength": 8
        },
        {
          "name": "assetAmountOut",
          "type": "sint64",
          "offset": 40,
          "byteLength": 8
        }
      ],
      "outputFields": [
        {
          "name": "quAmountIn",
          "type": "sint64",
          "offset": 0,
          "byteLength": 8
        }
      ],
      "inputSize": 48,
      "outputSize": 8
    },
    {
      "kind": "function",
      "inputType": 8,
      "name": "InvestRewardsInfo",
      "inputFields": [],
      "outputFields": [
        {
          "name": "investRewardsFee",
          "type": "uint32",
          "offset": 0,
          "byteLength": 4
        },
        {
          "name": "investRewardsId",
          "type": "id",
          "offset": 4,
          "byteLength": 32
        }
      ],
      "inputSize": 0,
      "outputSize": 36
    }
  ],
  "effectiveFromEpoch": 209,
  "effectiveToEpoch": null
}