createPool method

TransactionBlock createPool(
  1. String baseAssetType,
  2. String quoteAssetType,
  3. int tickSize,
  4. int lotSize,
)

Create pool for trading pair.

baseAssetType Full coin type of the base asset, eg: "0x3d0d0ce17dcd3b40c2d839d96ce66871ffb40e1154a8dd99af72292b3d10d7fc::wbtc::WBTC"

quoteAssetType Full coin type of quote asset, eg: "0x3d0d0ce17dcd3b40c2d839d96ce66871ffb40e1154a8dd99af72292b3d10d7fc::usdt::USDT"

tickSize Minimal Price Change Accuracy of this pool, eg: 10000000. The number must be an integer float scaled by FLOAT_SCALING_FACTOR.

lotSize Minimal Lot Change Accuracy of this pool, eg: 10000.

Implementation

///
/// [baseAssetType] Full coin type of the base asset, eg: "0x3d0d0ce17dcd3b40c2d839d96ce66871ffb40e1154a8dd99af72292b3d10d7fc::wbtc::WBTC"
  ///
/// [quoteAssetType] Full coin type of quote asset, eg: "0x3d0d0ce17dcd3b40c2d839d96ce66871ffb40e1154a8dd99af72292b3d10d7fc::usdt::USDT"
  ///
/// [tickSize] Minimal Price Change Accuracy of this pool, eg: 10000000. The number must be an integer float scaled by `FLOAT_SCALING_FACTOR`.
  ///
/// [lotSize] Minimal Lot Change Accuracy of this pool, eg: 10000.
TransactionBlock createPool(
	String baseAssetType,
	String quoteAssetType,
	int tickSize,
	int lotSize,
) {
	final txb = TransactionBlock();
	// create a pool with CREATION_FEE
    final coin = txb.splitCoins(txb.gas, [txb.pureInt(CREATION_FEE)]);
	txb.moveCall(
		"$PACKAGE_ID::$MODULE_CLOB::create_pool",
		typeArguments: [baseAssetType, quoteAssetType],
		arguments: [txb.pureInt(tickSize), txb.pureInt(lotSize), coin],
	);
	return txb;
}