subscan
Runtime Modules / XYK
Spec Version:
Call Functions
Name
Lookup
Parameters
create_pool65004
add_liquidity65014
remove_liquidity65023
sell65035
buy65045
Events
Name
Lookup
Attributes
LiquidityAdded6500["AccountId","AssetId","AssetId","Balance","Balance"]
LiquidityRemoved6501["AccountId","AssetId","AssetId","Balance"]
PoolCreated6502["AccountId","AssetId","AssetId","Balance","AssetId","AccountId"]
PoolDestroyed6503["AccountId","AssetId","AssetId","AssetId","AccountId"]
SellExecuted6504["AccountId","AssetId","AssetId","Balance","Balance","AssetId","Balance","AccountId"]
BuyExecuted6505["AccountId","AssetId","AssetId","Balance","Balance","AssetId","Balance","AccountId"]
Storage Functions
Name
Type
ShareToken{"origin":"Map","n_map_type":{"hashers":["Blake2_128Concat"],"key_vec":["AccountId"],"value":"U32","keys_id":0,"value_id":4}}
TotalLiquidity{"origin":"Map","n_map_type":{"hashers":["Blake2_128Concat"],"key_vec":["AccountId"],"value":"U128","keys_id":0,"value_id":6}}
PoolAssets{"origin":"Map","n_map_type":{"hashers":["Blake2_128Concat"],"key_vec":["AccountId"],"value":"Tuple:U32U32","keys_id":0,"value_id":36}}
Constants
Name
Type
Value
NativeAssetIdU3200000000
GetExchangeFeeTuple:U32U3203000000e8030000
MinTradingLimitU128e8030000000000000000000000000000
MinPoolLiquidityU128e8030000000000000000000000000000
MaxInRatioU12803000000000000000000000000000000
MaxOutRatioU12803000000000000000000000000000000
Error Types
Name
Docs
CannotCreatePoolWithSameAssetsIt is not allowed to create a pool between same assets.
InsufficientLiquidityLiquidity has not reached the required minimum.
InsufficientTradingAmountAmount is less than min trading limit.
ZeroLiquidityLiquidity is zero.
ZeroInitialPriceIt is not allowed to create a pool with zero initial price.Not used, kept for backward compatibility
CreatePoolAssetAmountInvalidOverflowNot used, kept for backward compatibility
InvalidMintedLiquidityOverflow
InvalidLiquidityAmountOverflow
AssetAmountExceededLimitAsset amount has exceeded given limit.
AssetAmountNotReachedLimitAsset amount has not reached given limit.
InsufficientAssetBalanceAsset balance is not sufficient.
InsufficientPoolAssetBalanceNot enough asset liquidity in the pool.
InsufficientNativeCurrencyBalanceNot enough core asset liquidity in the pool.
TokenPoolNotFoundLiquidity pool for given assets does not exist.
TokenPoolAlreadyExistsLiquidity pool for given assets already exists.
AddAssetAmountInvalidOverflow
RemoveAssetAmountInvalidOverflow
SellAssetAmountInvalidOverflow
BuyAssetAmountInvalidOverflow
FeeAmountInvalidOverflow
CannotApplyDiscountOverflow
MaxOutRatioExceededMax fraction of pool to buy in single transaction has been exceeded.
MaxInRatioExceededMax fraction of pool to sell in single transaction has been exceeded.
OverflowOverflow
CannotCreatePoolPool cannot be created due to outside factors.