createCustomizedPool method

TransactionBlock createCustomizedPool(
  1. String baseAssetType,
  2. String quoteAssetType,
  3. int tickSize,
  4. int lotSize,
  5. int takerFeeRate,
  6. int makerRebateRate,
)

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 interger float scaled by FLOAT_SCALING_FACTOR.

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

takerFeeRate Customized taker fee rate, float scaled by FLOAT_SCALING_FACTOR, Taker_fee_rate of 0.25% should be 2_500_000 for example

makerRebateRate Customized maker rebate rate, float scaled by FLOAT_SCALING_FACTOR, should be less than or equal to the taker_rebate_rate

Implementation

TransactionBlock createCustomizedPool(
		String baseAssetType,
		String quoteAssetType,
		int tickSize,
		int lotSize,
		int takerFeeRate,
		int makerRebateRate,
	) {
		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_customized_pool",
			typeArguments: [baseAssetType, quoteAssetType],
			arguments: [
				txb.pureInt(tickSize),
				txb.pureInt(lotSize),
				txb.pureInt(takerFeeRate),
				txb.pureInt(makerRebateRate),
				coin.result,
			],
		);
		return txb;
	}