@mysten/deepbook-v3 0.22.2 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/client.d.ts +167 -1
- package/dist/cjs/client.js +354 -3
- package/dist/cjs/client.js.map +2 -2
- package/dist/cjs/contracts/utils/index.d.ts +13 -0
- package/dist/cjs/contracts/utils/index.js +6 -9
- package/dist/cjs/contracts/utils/index.js.map +2 -2
- package/dist/cjs/index.d.ts +3 -1
- package/dist/cjs/index.js +16 -3
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/transactions/deepbook.d.ts +189 -1
- package/dist/cjs/transactions/deepbook.js +548 -1
- package/dist/cjs/transactions/deepbook.js.map +2 -2
- package/dist/cjs/types/index.d.ts +41 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/utils/config.d.ts +8 -8
- package/dist/cjs/utils/config.js +12 -11
- package/dist/cjs/utils/config.js.map +2 -2
- package/dist/cjs/utils/constants.d.ts +8 -0
- package/dist/cjs/utils/constants.js +18 -7
- package/dist/cjs/utils/constants.js.map +2 -2
- package/dist/cjs/utils/errors.d.ts +42 -0
- package/dist/cjs/utils/errors.js +70 -0
- package/dist/cjs/utils/errors.js.map +7 -0
- package/dist/cjs/utils/validation.d.ts +50 -0
- package/dist/cjs/utils/validation.js +67 -0
- package/dist/cjs/utils/validation.js.map +7 -0
- package/dist/esm/client.d.ts +167 -1
- package/dist/esm/client.js +355 -4
- package/dist/esm/client.js.map +2 -2
- package/dist/esm/contracts/utils/index.d.ts +13 -0
- package/dist/esm/contracts/utils/index.js +6 -9
- package/dist/esm/contracts/utils/index.js.map +2 -2
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.js +31 -5
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/transactions/deepbook.d.ts +189 -1
- package/dist/esm/transactions/deepbook.js +549 -2
- package/dist/esm/transactions/deepbook.js.map +2 -2
- package/dist/esm/types/index.d.ts +41 -0
- package/dist/esm/types/index.js.map +1 -1
- package/dist/esm/utils/config.d.ts +8 -8
- package/dist/esm/utils/config.js +12 -11
- package/dist/esm/utils/config.js.map +2 -2
- package/dist/esm/utils/constants.d.ts +8 -0
- package/dist/esm/utils/constants.js +18 -7
- package/dist/esm/utils/constants.js.map +2 -2
- package/dist/esm/utils/errors.d.ts +42 -0
- package/dist/esm/utils/errors.js +50 -0
- package/dist/esm/utils/errors.js.map +7 -0
- package/dist/esm/utils/validation.d.ts +50 -0
- package/dist/esm/utils/validation.js +47 -0
- package/dist/esm/utils/validation.js.map +7 -0
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -8
- package/src/client.ts +427 -4
- package/src/contracts/utils/index.ts +27 -11
- package/src/index.ts +21 -2
- package/src/transactions/deepbook.ts +647 -2
- package/src/types/index.ts +47 -0
- package/src/utils/config.ts +28 -15
- package/src/utils/constants.ts +17 -6
- package/src/utils/errors.ts +67 -0
- package/src/utils/validation.ts +91 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/transactions/deepbook.ts"],
|
|
4
|
-
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport { coinWithBalance } from '@mysten/sui/transactions';\nimport type { Transaction } from '@mysten/sui/transactions';\n\nimport { OrderType, SelfMatchingOptions } from '../types/index.js';\nimport type {\n\tCreatePermissionlessPoolParams,\n\tPlaceLimitOrderParams,\n\tPlaceMarketOrderParams,\n\tSwapParams,\n} from '../types/index.js';\nimport type { DeepBookConfig } from '../utils/config.js';\nimport {\n\tDEEP_SCALAR,\n\tFLOAT_SCALAR,\n\tGAS_BUDGET,\n\tMAX_TIMESTAMP,\n\tPOOL_CREATION_FEE,\n} from '../utils/config.js';\n\n/**\n * DeepBookContract class for managing DeepBook operations.\n */\nexport class DeepBookContract {\n\t#config: DeepBookConfig;\n\n\t/**\n\t * @param {DeepBookConfig} config Configuration for DeepBookContract\n\t */\n\tconstructor(config: DeepBookConfig) {\n\t\tthis.#config = config;\n\t}\n\n\t/**\n\t * @description Place a limit order\n\t * @param {PlaceLimitOrderParams} params Parameters for placing a limit order\n\t * @returns A function that takes a Transaction object\n\t */\n\tplaceLimitOrder = (params: PlaceLimitOrderParams) => (tx: Transaction) => {\n\t\tconst {\n\t\t\tpoolKey,\n\t\t\tbalanceManagerKey,\n\t\t\tclientOrderId,\n\t\t\tprice,\n\t\t\tquantity,\n\t\t\tisBid,\n\t\t\texpiration = MAX_TIMESTAMP,\n\t\t\torderType = OrderType.NO_RESTRICTION,\n\t\t\tselfMatchingOption = SelfMatchingOptions.SELF_MATCHING_ALLOWED,\n\t\t\tpayWithDeep = true,\n\t\t} = params;\n\n\t\ttx.setGasBudgetIfNotSet(GAS_BUDGET);\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst balanceManager = this.#config.getBalanceManager(balanceManagerKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst inputPrice = Math.round((price * FLOAT_SCALAR * quoteCoin.scalar) / baseCoin.scalar);\n\t\tconst inputQuantity = Math.round(quantity * baseCoin.scalar);\n\n\t\tconst tradeProof = tx.add(this.#config.balanceManager.generateProof(balanceManagerKey));\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::place_limit_order`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.object(balanceManager.address),\n\t\t\t\ttradeProof,\n\t\t\t\ttx.pure.u64(clientOrderId),\n\t\t\t\ttx.pure.u8(orderType),\n\t\t\t\ttx.pure.u8(selfMatchingOption),\n\t\t\t\ttx.pure.u64(inputPrice),\n\t\t\t\ttx.pure.u64(inputQuantity),\n\t\t\t\ttx.pure.bool(isBid),\n\t\t\t\ttx.pure.bool(payWithDeep),\n\t\t\t\ttx.pure.u64(expiration),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Place a market order\n\t * @param {PlaceMarketOrderParams} params Parameters for placing a market order\n\t * @returns A function that takes a Transaction object\n\t */\n\tplaceMarketOrder = (params: PlaceMarketOrderParams) => (tx: Transaction) => {\n\t\tconst {\n\t\t\tpoolKey,\n\t\t\tbalanceManagerKey,\n\t\t\tclientOrderId,\n\t\t\tquantity,\n\t\t\tisBid,\n\t\t\tselfMatchingOption = SelfMatchingOptions.SELF_MATCHING_ALLOWED,\n\t\t\tpayWithDeep = true,\n\t\t} = params;\n\n\t\ttx.setGasBudgetIfNotSet(GAS_BUDGET);\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst balanceManager = this.#config.getBalanceManager(balanceManagerKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst tradeProof = tx.add(this.#config.balanceManager.generateProof(balanceManagerKey));\n\t\tconst inputQuantity = Math.round(quantity * baseCoin.scalar);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::place_market_order`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.object(balanceManager.address),\n\t\t\t\ttradeProof,\n\t\t\t\ttx.pure.u64(clientOrderId),\n\t\t\t\ttx.pure.u8(selfMatchingOption),\n\t\t\t\ttx.pure.u64(inputQuantity),\n\t\t\t\ttx.pure.bool(isBid),\n\t\t\t\ttx.pure.bool(payWithDeep),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Modify an existing order\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} balanceManagerKey The key to identify the BalanceManager\n\t * @param {string} orderId Order ID to modify\n\t * @param {number} newQuantity New quantity for the order\n\t * @returns A function that takes a Transaction object\n\t */\n\tmodifyOrder =\n\t\t(poolKey: string, balanceManagerKey: string, orderId: string, newQuantity: number) =>\n\t\t(tx: Transaction) => {\n\t\t\tconst pool = this.#config.getPool(poolKey);\n\t\t\tconst balanceManager = this.#config.getBalanceManager(balanceManagerKey);\n\t\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\t\tconst tradeProof = tx.add(this.#config.balanceManager.generateProof(balanceManagerKey));\n\t\t\tconst inputQuantity = Math.round(newQuantity * baseCoin.scalar);\n\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::modify_order`,\n\t\t\t\targuments: [\n\t\t\t\t\ttx.object(pool.address),\n\t\t\t\t\ttx.object(balanceManager.address),\n\t\t\t\t\ttradeProof,\n\t\t\t\t\ttx.pure.u128(orderId),\n\t\t\t\t\ttx.pure.u64(inputQuantity),\n\t\t\t\t\ttx.object.clock(),\n\t\t\t\t],\n\t\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Cancel an existing order\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} balanceManagerKey The key to identify the BalanceManager\n\t * @param {string} orderId Order ID to cancel\n\t * @returns A function that takes a Transaction object\n\t */\n\tcancelOrder =\n\t\t(poolKey: string, balanceManagerKey: string, orderId: string) => (tx: Transaction) => {\n\t\t\ttx.setGasBudgetIfNotSet(GAS_BUDGET);\n\t\t\tconst pool = this.#config.getPool(poolKey);\n\t\t\tconst balanceManager = this.#config.getBalanceManager(balanceManagerKey);\n\t\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\t\tconst tradeProof = tx.add(this.#config.balanceManager.generateProof(balanceManagerKey));\n\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::cancel_order`,\n\t\t\t\targuments: [\n\t\t\t\t\ttx.object(pool.address),\n\t\t\t\t\ttx.object(balanceManager.address),\n\t\t\t\t\ttradeProof,\n\t\t\t\t\ttx.pure.u128(orderId),\n\t\t\t\t\ttx.object.clock(),\n\t\t\t\t],\n\t\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Cancel all open orders for a balance manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} balanceManagerKey The key to identify the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tcancelAllOrders = (poolKey: string, balanceManagerKey: string) => (tx: Transaction) => {\n\t\ttx.setGasBudgetIfNotSet(GAS_BUDGET);\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst balanceManager = this.#config.getBalanceManager(balanceManagerKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst tradeProof = tx.add(this.#config.balanceManager.generateProof(balanceManagerKey));\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::cancel_all_orders`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.object(balanceManager.address),\n\t\t\t\ttradeProof,\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Withdraw settled amounts for a balance manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} balanceManagerKey The key to identify the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawSettledAmounts = (poolKey: string, balanceManagerKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst balanceManager = this.#config.getBalanceManager(balanceManagerKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst tradeProof = tx.add(this.#config.balanceManager.generateProof(balanceManagerKey));\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::withdraw_settled_amounts`,\n\t\t\targuments: [tx.object(pool.address), tx.object(balanceManager.address), tradeProof],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Add a deep price point for a target pool using a reference pool\n\t * @param {string} targetPoolKey The key to identify the target pool\n\t * @param {string} referencePoolKey The key to identify the reference pool\n\t * @returns A function that takes a Transaction object\n\t */\n\taddDeepPricePoint = (targetPoolKey: string, referencePoolKey: string) => (tx: Transaction) => {\n\t\tconst targetPool = this.#config.getPool(targetPoolKey);\n\t\tconst referencePool = this.#config.getPool(referencePoolKey);\n\t\tconst targetBaseCoin = this.#config.getCoin(targetPool.baseCoin);\n\t\tconst targetQuoteCoin = this.#config.getCoin(targetPool.quoteCoin);\n\t\tconst referenceBaseCoin = this.#config.getCoin(referencePool.baseCoin);\n\t\tconst referenceQuoteCoin = this.#config.getCoin(referencePool.quoteCoin);\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::add_deep_price_point`,\n\t\t\targuments: [\n\t\t\t\ttx.object(targetPool.address),\n\t\t\t\ttx.object(referencePool.address),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [\n\t\t\t\ttargetBaseCoin.type,\n\t\t\t\ttargetQuoteCoin.type,\n\t\t\t\treferenceBaseCoin.type,\n\t\t\t\treferenceQuoteCoin.type,\n\t\t\t],\n\t\t});\n\t};\n\n\t/**\n\t * @description Claim rebates for a balance manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} balanceManagerKey The key to identify the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tclaimRebates = (poolKey: string, balanceManagerKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst balanceManager = this.#config.getBalanceManager(balanceManagerKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst tradeProof = tx.add(this.#config.balanceManager.generateProof(balanceManagerKey));\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::claim_rebates`,\n\t\t\targuments: [tx.object(pool.address), tx.object(balanceManager.address), tradeProof],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Mint a referral for a pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {number} multiplier The multiplier for the referral\n\t * @returns A function that takes a Transaction object\n\t */\n\tmintReferral = (poolKey: string, multiplier: number) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst adjustedNumber = Math.round(multiplier * FLOAT_SCALAR);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::mint_referral`,\n\t\t\targuments: [tx.object(pool.address), tx.pure.u64(adjustedNumber)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Update the referral multiplier for a pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {number} multiplier The multiplier for the referral\n\t * @returns A function that takes a Transaction object\n\t */\n\tupdateDeepbookReferralMultiplier =\n\t\t(poolKey: string, referral: string, multiplier: number) => (tx: Transaction) => {\n\t\t\tconst pool = this.#config.getPool(poolKey);\n\t\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\t\tconst adjustedNumber = Math.round(multiplier * FLOAT_SCALAR);\n\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::update_deepbook_referral_multiplier`,\n\t\t\t\targuments: [tx.object(pool.address), tx.object(referral), tx.pure.u64(adjustedNumber)],\n\t\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Claim the rewards for a referral\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} referral The referral to claim the rewards for\n\t * @returns A function that takes a Transaction object\n\t */\n\tclaimReferralRewards = (poolKey: string, referral: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\tconst [baseRewards, quoteRewards, deepRewards] = tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::claim_referral_rewards`,\n\t\t\targuments: [tx.object(pool.address), tx.object(referral)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\n\t\treturn { baseRewards, quoteRewards, deepRewards };\n\t};\n\n\t/**\n\t * @description Update the allowed versions for a pool\n\t * @param {string} poolKey The key of the pool to be updated\n\t * @returns A function that takes a Transaction object\n\t */\n\tupdatePoolAllowedVersions = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::update_pool_allowed_versions`,\n\t\t\targuments: [tx.object(pool.address), tx.object(this.#config.REGISTRY_ID)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Gets an order\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} orderId Order ID to get\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetOrder = (poolKey: string, orderId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_order`,\n\t\t\targuments: [tx.object(pool.address), tx.pure.u128(orderId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Prepares a transaction to retrieve multiple orders from a specified pool.\n\t * @param {string} poolKey - The identifier key for the pool to retrieve orders from.\n\t * @param {string[]} orderIds - Array of order IDs to retrieve.\n\t * @returns {Function} A function that takes a Transaction object\n\t */\n\tgetOrders = (poolKey: string, orderIds: string[]) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_orders`,\n\t\t\targuments: [tx.object(pool.address), tx.pure.vector('u128', orderIds)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Burn DEEP tokens from the pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tburnDeep = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::burn_deep`,\n\t\t\targuments: [tx.object(pool.address), tx.object(this.#config.DEEP_TREASURY_ID)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the mid price for a pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tmidPrice = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::mid_price`,\n\t\t\targuments: [tx.object(pool.address), tx.object.clock()],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Check if a pool is whitelisted\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\twhitelisted = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::whitelisted`,\n\t\t\targuments: [tx.object(pool.address)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the quote quantity out for a given base quantity in\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {number} baseQuantity Base quantity to convert\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetQuoteQuantityOut = (poolKey: string, baseQuantity: number) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_quote_quantity_out`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.pure.u64(baseQuantity * baseCoin.scalar),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the base quantity out for a given quote quantity in\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {number} quoteQuantity Quote quantity to convert\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetBaseQuantityOut = (poolKey: string, quoteQuantity: number) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst quoteScalar = quoteCoin.scalar;\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_base_quantity_out`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.pure.u64(quoteQuantity * quoteScalar),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the quantity out for a given base or quote quantity\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {number} baseQuantity Base quantity to convert\n\t * @param {number} quoteQuantity Quote quantity to convert\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetQuantityOut =\n\t\t(poolKey: string, baseQuantity: number, quoteQuantity: number) => (tx: Transaction) => {\n\t\t\tconst pool = this.#config.getPool(poolKey);\n\t\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\t\tconst quoteScalar = quoteCoin.scalar;\n\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_quantity_out`,\n\t\t\t\targuments: [\n\t\t\t\t\ttx.object(pool.address),\n\t\t\t\t\ttx.pure.u64(baseQuantity * baseCoin.scalar),\n\t\t\t\t\ttx.pure.u64(quoteQuantity * quoteScalar),\n\t\t\t\t\ttx.object.clock(),\n\t\t\t\t],\n\t\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Get open orders for a balance manager in a pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} managerKey Key of the balance manager\n\t * @returns A function that takes a Transaction object\n\t */\n\taccountOpenOrders = (poolKey: string, managerKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst manager = this.#config.getBalanceManager(managerKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::account_open_orders`,\n\t\t\targuments: [tx.object(pool.address), tx.object(manager.address)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get level 2 order book specifying range of price\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {number} priceLow Lower bound of the price range\n\t * @param {number} priceHigh Upper bound of the price range\n\t * @param {boolean} isBid Whether to get bid or ask orders\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetLevel2Range =\n\t\t(poolKey: string, priceLow: number, priceHigh: number, isBid: boolean) => (tx: Transaction) => {\n\t\t\tconst pool = this.#config.getPool(poolKey);\n\t\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_level2_range`,\n\t\t\t\targuments: [\n\t\t\t\t\ttx.object(pool.address),\n\t\t\t\t\ttx.pure.u64((priceLow * FLOAT_SCALAR * quoteCoin.scalar) / baseCoin.scalar),\n\t\t\t\t\ttx.pure.u64((priceHigh * FLOAT_SCALAR * quoteCoin.scalar) / baseCoin.scalar),\n\t\t\t\t\ttx.pure.bool(isBid),\n\t\t\t\t\ttx.object.clock(),\n\t\t\t\t],\n\t\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Get level 2 order book ticks from mid-price for a pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {number} tickFromMid Number of ticks from mid-price\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetLevel2TicksFromMid = (poolKey: string, tickFromMid: number) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_level2_ticks_from_mid`,\n\t\t\targuments: [tx.object(pool.address), tx.pure.u64(tickFromMid), tx.object.clock()],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the vault balances for a pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tvaultBalances = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::vault_balances`,\n\t\t\targuments: [tx.object(pool.address)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the pool ID by asset types\n\t * @param {string} baseType Type of the base asset\n\t * @param {string} quoteType Type of the quote asset\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetPoolIdByAssets = (baseType: string, quoteType: string) => (tx: Transaction) => {\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_pool_id_by_asset`,\n\t\t\targuments: [tx.object(this.#config.REGISTRY_ID)],\n\t\t\ttypeArguments: [baseType, quoteType],\n\t\t});\n\t};\n\n\t/**\n\t * @description Swap exact base amount for quote amount\n\t * @param {SwapParams} params Parameters for the swap\n\t * @returns A function that takes a Transaction object\n\t */\n\tswapExactBaseForQuote = (params: SwapParams) => (tx: Transaction) => {\n\t\ttx.setGasBudgetIfNotSet(GAS_BUDGET);\n\t\ttx.setSenderIfNotSet(this.#config.address);\n\n\t\tif (params.quoteCoin) {\n\t\t\tthrow new Error('quoteCoin is not accepted for swapping base asset');\n\t\t}\n\t\tconst { poolKey, amount: baseAmount, deepAmount, minOut: minQuote } = params;\n\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst deepCoinType = this.#config.getCoin('DEEP').type;\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\tconst baseCoinInput =\n\t\t\tparams.baseCoin ??\n\t\t\tcoinWithBalance({ type: baseCoin.type, balance: Math.round(baseAmount * baseCoin.scalar) });\n\n\t\tconst deepCoin =\n\t\t\tparams.deepCoin ??\n\t\t\tcoinWithBalance({ type: deepCoinType, balance: Math.round(deepAmount * DEEP_SCALAR) });\n\n\t\tconst minQuoteInput = Math.round(minQuote * quoteCoin.scalar);\n\n\t\tconst [baseCoinResult, quoteCoinResult, deepCoinResult] = tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::swap_exact_base_for_quote`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\tbaseCoinInput,\n\t\t\t\tdeepCoin,\n\t\t\t\ttx.pure.u64(minQuoteInput),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\n\t\treturn [baseCoinResult, quoteCoinResult, deepCoinResult] as const;\n\t};\n\n\t/**\n\t * @description Swap exact quote amount for base amount\n\t * @param {SwapParams} params Parameters for the swap\n\t * @returns A function that takes a Transaction object\n\t */\n\tswapExactQuoteForBase = (params: SwapParams) => (tx: Transaction) => {\n\t\ttx.setGasBudgetIfNotSet(GAS_BUDGET);\n\t\ttx.setSenderIfNotSet(this.#config.address);\n\n\t\tif (params.baseCoin) {\n\t\t\tthrow new Error('baseCoin is not accepted for swapping quote asset');\n\t\t}\n\t\tconst { poolKey, amount: quoteAmount, deepAmount, minOut: minBase } = params;\n\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst deepCoinType = this.#config.getCoin('DEEP').type;\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\tconst quoteCoinInput =\n\t\t\tparams.quoteCoin ??\n\t\t\tcoinWithBalance({\n\t\t\t\ttype: quoteCoin.type,\n\t\t\t\tbalance: Math.round(quoteAmount * quoteCoin.scalar),\n\t\t\t});\n\n\t\tconst deepCoin =\n\t\t\tparams.deepCoin ??\n\t\t\tcoinWithBalance({ type: deepCoinType, balance: Math.round(deepAmount * DEEP_SCALAR) });\n\n\t\tconst minBaseInput = Math.round(minBase * baseCoin.scalar);\n\n\t\tconst [baseCoinResult, quoteCoinResult, deepCoinResult] = tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::swap_exact_quote_for_base`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\tquoteCoinInput,\n\t\t\t\tdeepCoin,\n\t\t\t\ttx.pure.u64(minBaseInput),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\n\t\treturn [baseCoinResult, quoteCoinResult, deepCoinResult] as const;\n\t};\n\n\t/**\n\t * @description Create a new pool permissionlessly\n\t * @param {CreatePermissionlessPoolParams} params Parameters for creating permissionless pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tcreatePermissionlessPool = (params: CreatePermissionlessPoolParams) => (tx: Transaction) => {\n\t\ttx.setSenderIfNotSet(this.#config.address);\n\t\tconst { baseCoinKey, quoteCoinKey, tickSize, lotSize, minSize, deepCoin } = params;\n\t\tconst baseCoin = this.#config.getCoin(baseCoinKey);\n\t\tconst quoteCoin = this.#config.getCoin(quoteCoinKey);\n\t\tconst deepCoinType = this.#config.getCoin('DEEP').type;\n\n\t\tconst baseScalar = baseCoin.scalar;\n\t\tconst quoteScalar = quoteCoin.scalar;\n\n\t\tconst adjustedTickSize = Math.round((tickSize * FLOAT_SCALAR * quoteScalar) / baseScalar);\n\t\tconst adjustedLotSize = Math.round(lotSize * baseScalar);\n\t\tconst adjustedMinSize = Math.round(minSize * baseScalar);\n\n\t\tconst deepCoinInput =\n\t\t\tdeepCoin ??\n\t\t\tcoinWithBalance({\n\t\t\t\ttype: deepCoinType,\n\t\t\t\tbalance: POOL_CREATION_FEE,\n\t\t\t});\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::create_permissionless_pool`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.REGISTRY_ID), // registry_id\n\t\t\t\ttx.pure.u64(adjustedTickSize), // adjusted tick_size\n\t\t\t\ttx.pure.u64(adjustedLotSize), // adjusted lot_size\n\t\t\t\ttx.pure.u64(adjustedMinSize), // adjusted min_size\n\t\t\t\tdeepCoinInput,\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the trade parameters for a given pool, including taker fee, maker fee, and stake required.\n\t * @param {string} poolKey Key of the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tpoolTradeParams = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::pool_trade_params`,\n\t\t\targuments: [tx.object(pool.address)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the book parameters for a given pool, including tick size, lot size, and min size.\n\t * @param {string} poolKey Key of the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tpoolBookParams = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::pool_book_params`,\n\t\t\targuments: [tx.object(pool.address)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the account information for a given pool and balance manager\n\t * @param {string} poolKey Key of the pool\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\taccount = (poolKey: string, managerKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::account`,\n\t\t\targuments: [tx.object(pool.address), tx.object(managerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the locked balance for a given pool and balance manager\n\t * @param {string} poolKey Key of the pool\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tlockedBalance = (poolKey: string, managerKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::locked_balance`,\n\t\t\targuments: [tx.object(pool.address), tx.object(managerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the DEEP price conversion for a pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetPoolDeepPrice = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_order_deep_price`,\n\t\t\targuments: [tx.object(pool.address)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the balance manager IDs for a given owner\n\t * @param {string} owner The owner address to get balance manager IDs for\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetBalanceManagerIds = (owner: string) => (tx: Transaction) => {\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::registry::get_balance_manager_ids`,\n\t\t\targuments: [tx.object(this.#config.REGISTRY_ID), tx.pure.address(owner)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the balances for a referral\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} referral The referral to get the balances for\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetReferralBalances = (poolKey: string, referral: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_referral_balances`,\n\t\t\targuments: [tx.object(pool.address), tx.object(referral)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAAgC;AAGhC,mBAA+C;AAQ/C,oBAMO;AAnBP;AAwBO,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA,EAM7B,YAAY,QAAwB;AALpC;AAcA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAkB,CAAC,WAAkC,CAAC,OAAoB;AACzE,YAAM;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,aAAa;AAAA,QACb,YAAY,uBAAU;AAAA,QACtB,qBAAqB,iCAAoB;AAAA,QACzC,cAAc;AAAA,MACf,IAAI;AAEJ,SAAG,qBAAqB,wBAAU;AAClC,YAAM,OAAO,mBAAK,SAAQ,QAAQ,OAAO;AACzC,YAAM,iBAAiB,mBAAK,SAAQ,kBAAkB,iBAAiB;AACvE,YAAM,WAAW,mBAAK,SAAQ,QAAQ,KAAK,QAAQ;AACnD,YAAM,YAAY,mBAAK,SAAQ,QAAQ,KAAK,SAAS;AACrD,YAAM,aAAa,KAAK,MAAO,QAAQ,6BAAe,UAAU,SAAU,SAAS,MAAM;AACzF,YAAM,gBAAgB,KAAK,M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AoB;AAC9D,SAAG,SAAS;AAAA,QACX,QAAQ,GAAG,mBAAK,SAAQ,mBAAmB;AAAA,QAC3C,WAAW,CAAC,GAAG,OAAO,mBAAK,SAAQ,WAAW,GAAG,GAAG,KAAK,QAAQ,KAAK,CAAC;AAAA,MACxE,CAAC;AAAA,IACF;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+BAAsB,CAAC,SAAiB,aAAqB,CAAC,OAAoB;AACjF,YAAM,OAAO,mBAAK,SAAQ,QAAQ,OAAO;AACzC,YAAM,WAAW,mBAAK,SAAQ,QAAQ,KAAK,QAAQ;AACnD,YAAM,YAAY,mBAAK,SAAQ,QAAQ,KAAK,SAAS;AAErD,aAAO,GAAG,SAAS;AAAA,QAClB,QAAQ,GAAG,mBAAK,SAAQ,mBAAmB;AAAA,QAC3C,WAAW,CAAC,GAAG,OAAO,KAAK,OAAO,GAAG,GAAG,OAAO,QAAQ,CAAC;AAAA,QACxD,eAAe,CAAC,SAAS,MAAM,UAAU,IAAI;AAAA,MAC9C,CAAC;AAAA,IACF;AAtzBC,uBAAK,SAAU;AAAA,EAChB;AAszBD;AA7zBC;",
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport { coinWithBalance } from '@mysten/sui/transactions';\nimport type { Transaction } from '@mysten/sui/transactions';\n\nimport { OrderType, SelfMatchingOptions } from '../types/index.js';\nimport type {\n\tCanPlaceLimitOrderParams,\n\tCanPlaceMarketOrderParams,\n\tCreatePermissionlessPoolParams,\n\tPlaceLimitOrderParams,\n\tPlaceMarketOrderParams,\n\tSwapParams,\n\tSwapWithManagerParams,\n} from '../types/index.js';\nimport type { DeepBookConfig } from '../utils/config.js';\nimport {\n\tDEEP_SCALAR,\n\tFLOAT_SCALAR,\n\tGAS_BUDGET,\n\tMAX_TIMESTAMP,\n\tPOOL_CREATION_FEE_DEEP,\n} from '../utils/config.js';\n\n/**\n * DeepBookContract class for managing DeepBook operations.\n */\nexport class DeepBookContract {\n\t#config: DeepBookConfig;\n\n\t/**\n\t * @param {DeepBookConfig} config Configuration for DeepBookContract\n\t */\n\tconstructor(config: DeepBookConfig) {\n\t\tthis.#config = config;\n\t}\n\n\t/**\n\t * @description Place a limit order\n\t * @param {PlaceLimitOrderParams} params Parameters for placing a limit order\n\t * @returns A function that takes a Transaction object\n\t */\n\tplaceLimitOrder = (params: PlaceLimitOrderParams) => (tx: Transaction) => {\n\t\tconst {\n\t\t\tpoolKey,\n\t\t\tbalanceManagerKey,\n\t\t\tclientOrderId,\n\t\t\tprice,\n\t\t\tquantity,\n\t\t\tisBid,\n\t\t\texpiration = MAX_TIMESTAMP,\n\t\t\torderType = OrderType.NO_RESTRICTION,\n\t\t\tselfMatchingOption = SelfMatchingOptions.SELF_MATCHING_ALLOWED,\n\t\t\tpayWithDeep = true,\n\t\t} = params;\n\n\t\ttx.setGasBudgetIfNotSet(GAS_BUDGET);\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst balanceManager = this.#config.getBalanceManager(balanceManagerKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst inputPrice = Math.round((price * FLOAT_SCALAR * quoteCoin.scalar) / baseCoin.scalar);\n\t\tconst inputQuantity = Math.round(quantity * baseCoin.scalar);\n\n\t\tconst tradeProof = tx.add(this.#config.balanceManager.generateProof(balanceManagerKey));\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::place_limit_order`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.object(balanceManager.address),\n\t\t\t\ttradeProof,\n\t\t\t\ttx.pure.u64(clientOrderId),\n\t\t\t\ttx.pure.u8(orderType),\n\t\t\t\ttx.pure.u8(selfMatchingOption),\n\t\t\t\ttx.pure.u64(inputPrice),\n\t\t\t\ttx.pure.u64(inputQuantity),\n\t\t\t\ttx.pure.bool(isBid),\n\t\t\t\ttx.pure.bool(payWithDeep),\n\t\t\t\ttx.pure.u64(expiration),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Place a market order\n\t * @param {PlaceMarketOrderParams} params Parameters for placing a market order\n\t * @returns A function that takes a Transaction object\n\t */\n\tplaceMarketOrder = (params: PlaceMarketOrderParams) => (tx: Transaction) => {\n\t\tconst {\n\t\t\tpoolKey,\n\t\t\tbalanceManagerKey,\n\t\t\tclientOrderId,\n\t\t\tquantity,\n\t\t\tisBid,\n\t\t\tselfMatchingOption = SelfMatchingOptions.SELF_MATCHING_ALLOWED,\n\t\t\tpayWithDeep = true,\n\t\t} = params;\n\n\t\ttx.setGasBudgetIfNotSet(GAS_BUDGET);\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst balanceManager = this.#config.getBalanceManager(balanceManagerKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst tradeProof = tx.add(this.#config.balanceManager.generateProof(balanceManagerKey));\n\t\tconst inputQuantity = Math.round(quantity * baseCoin.scalar);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::place_market_order`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.object(balanceManager.address),\n\t\t\t\ttradeProof,\n\t\t\t\ttx.pure.u64(clientOrderId),\n\t\t\t\ttx.pure.u8(selfMatchingOption),\n\t\t\t\ttx.pure.u64(inputQuantity),\n\t\t\t\ttx.pure.bool(isBid),\n\t\t\t\ttx.pure.bool(payWithDeep),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Modify an existing order\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} balanceManagerKey The key to identify the BalanceManager\n\t * @param {string} orderId Order ID to modify\n\t * @param {number} newQuantity New quantity for the order\n\t * @returns A function that takes a Transaction object\n\t */\n\tmodifyOrder =\n\t\t(poolKey: string, balanceManagerKey: string, orderId: string, newQuantity: number) =>\n\t\t(tx: Transaction) => {\n\t\t\tconst pool = this.#config.getPool(poolKey);\n\t\t\tconst balanceManager = this.#config.getBalanceManager(balanceManagerKey);\n\t\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\t\tconst tradeProof = tx.add(this.#config.balanceManager.generateProof(balanceManagerKey));\n\t\t\tconst inputQuantity = Math.round(newQuantity * baseCoin.scalar);\n\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::modify_order`,\n\t\t\t\targuments: [\n\t\t\t\t\ttx.object(pool.address),\n\t\t\t\t\ttx.object(balanceManager.address),\n\t\t\t\t\ttradeProof,\n\t\t\t\t\ttx.pure.u128(orderId),\n\t\t\t\t\ttx.pure.u64(inputQuantity),\n\t\t\t\t\ttx.object.clock(),\n\t\t\t\t],\n\t\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Cancel an existing order\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} balanceManagerKey The key to identify the BalanceManager\n\t * @param {string} orderId Order ID to cancel\n\t * @returns A function that takes a Transaction object\n\t */\n\tcancelOrder =\n\t\t(poolKey: string, balanceManagerKey: string, orderId: string) => (tx: Transaction) => {\n\t\t\ttx.setGasBudgetIfNotSet(GAS_BUDGET);\n\t\t\tconst pool = this.#config.getPool(poolKey);\n\t\t\tconst balanceManager = this.#config.getBalanceManager(balanceManagerKey);\n\t\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\t\tconst tradeProof = tx.add(this.#config.balanceManager.generateProof(balanceManagerKey));\n\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::cancel_order`,\n\t\t\t\targuments: [\n\t\t\t\t\ttx.object(pool.address),\n\t\t\t\t\ttx.object(balanceManager.address),\n\t\t\t\t\ttradeProof,\n\t\t\t\t\ttx.pure.u128(orderId),\n\t\t\t\t\ttx.object.clock(),\n\t\t\t\t],\n\t\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Cancel multiple orders\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} balanceManagerKey The key to identify the BalanceManager\n\t * @param {string[]} orderIds Array of order IDs to cancel\n\t * @returns A function that takes a Transaction object\n\t */\n\tcancelOrders =\n\t\t(poolKey: string, balanceManagerKey: string, orderIds: string[]) => (tx: Transaction) => {\n\t\t\ttx.setGasBudgetIfNotSet(GAS_BUDGET);\n\t\t\tconst pool = this.#config.getPool(poolKey);\n\t\t\tconst balanceManager = this.#config.getBalanceManager(balanceManagerKey);\n\t\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\t\tconst tradeProof = tx.add(this.#config.balanceManager.generateProof(balanceManagerKey));\n\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::cancel_orders`,\n\t\t\t\targuments: [\n\t\t\t\t\ttx.object(pool.address),\n\t\t\t\t\ttx.object(balanceManager.address),\n\t\t\t\t\ttradeProof,\n\t\t\t\t\ttx.pure.vector('u128', orderIds),\n\t\t\t\t\ttx.object.clock(),\n\t\t\t\t],\n\t\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Cancel all open orders for a balance manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} balanceManagerKey The key to identify the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tcancelAllOrders = (poolKey: string, balanceManagerKey: string) => (tx: Transaction) => {\n\t\ttx.setGasBudgetIfNotSet(GAS_BUDGET);\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst balanceManager = this.#config.getBalanceManager(balanceManagerKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst tradeProof = tx.add(this.#config.balanceManager.generateProof(balanceManagerKey));\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::cancel_all_orders`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.object(balanceManager.address),\n\t\t\t\ttradeProof,\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Withdraw settled amounts for a balance manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} balanceManagerKey The key to identify the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawSettledAmounts = (poolKey: string, balanceManagerKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst balanceManager = this.#config.getBalanceManager(balanceManagerKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst tradeProof = tx.add(this.#config.balanceManager.generateProof(balanceManagerKey));\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::withdraw_settled_amounts`,\n\t\t\targuments: [tx.object(pool.address), tx.object(balanceManager.address), tradeProof],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Withdraw settled amounts permissionlessly for a balance manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} balanceManagerKey The key to identify the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawSettledAmountsPermissionless =\n\t\t(poolKey: string, balanceManagerKey: string) => (tx: Transaction) => {\n\t\t\tconst pool = this.#config.getPool(poolKey);\n\t\t\tconst balanceManager = this.#config.getBalanceManager(balanceManagerKey);\n\t\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::withdraw_settled_amounts_permissionless`,\n\t\t\t\targuments: [tx.object(pool.address), tx.object(balanceManager.address)],\n\t\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Add a deep price point for a target pool using a reference pool\n\t * @param {string} targetPoolKey The key to identify the target pool\n\t * @param {string} referencePoolKey The key to identify the reference pool\n\t * @returns A function that takes a Transaction object\n\t */\n\taddDeepPricePoint = (targetPoolKey: string, referencePoolKey: string) => (tx: Transaction) => {\n\t\tconst targetPool = this.#config.getPool(targetPoolKey);\n\t\tconst referencePool = this.#config.getPool(referencePoolKey);\n\t\tconst targetBaseCoin = this.#config.getCoin(targetPool.baseCoin);\n\t\tconst targetQuoteCoin = this.#config.getCoin(targetPool.quoteCoin);\n\t\tconst referenceBaseCoin = this.#config.getCoin(referencePool.baseCoin);\n\t\tconst referenceQuoteCoin = this.#config.getCoin(referencePool.quoteCoin);\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::add_deep_price_point`,\n\t\t\targuments: [\n\t\t\t\ttx.object(targetPool.address),\n\t\t\t\ttx.object(referencePool.address),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [\n\t\t\t\ttargetBaseCoin.type,\n\t\t\t\ttargetQuoteCoin.type,\n\t\t\t\treferenceBaseCoin.type,\n\t\t\t\treferenceQuoteCoin.type,\n\t\t\t],\n\t\t});\n\t};\n\n\t/**\n\t * @description Claim rebates for a balance manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} balanceManagerKey The key to identify the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tclaimRebates = (poolKey: string, balanceManagerKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst balanceManager = this.#config.getBalanceManager(balanceManagerKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst tradeProof = tx.add(this.#config.balanceManager.generateProof(balanceManagerKey));\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::claim_rebates`,\n\t\t\targuments: [tx.object(pool.address), tx.object(balanceManager.address), tradeProof],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Mint a referral for a pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {number} multiplier The multiplier for the referral\n\t * @returns A function that takes a Transaction object\n\t */\n\tmintReferral = (poolKey: string, multiplier: number) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst adjustedNumber = Math.round(multiplier * FLOAT_SCALAR);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::mint_referral`,\n\t\t\targuments: [tx.object(pool.address), tx.pure.u64(adjustedNumber)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Update the referral multiplier for a pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {number} multiplier The multiplier for the referral\n\t * @returns A function that takes a Transaction object\n\t */\n\tupdateDeepbookReferralMultiplier =\n\t\t(poolKey: string, referral: string, multiplier: number) => (tx: Transaction) => {\n\t\t\tconst pool = this.#config.getPool(poolKey);\n\t\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\t\tconst adjustedNumber = Math.round(multiplier * FLOAT_SCALAR);\n\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::update_deepbook_referral_multiplier`,\n\t\t\t\targuments: [tx.object(pool.address), tx.object(referral), tx.pure.u64(adjustedNumber)],\n\t\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Claim the rewards for a referral\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} referral The referral to claim the rewards for\n\t * @returns A function that takes a Transaction object\n\t */\n\tclaimReferralRewards = (poolKey: string, referral: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\tconst [baseRewards, quoteRewards, deepRewards] = tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::claim_referral_rewards`,\n\t\t\targuments: [tx.object(pool.address), tx.object(referral)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\n\t\treturn { baseRewards, quoteRewards, deepRewards };\n\t};\n\n\t/**\n\t * @description Update the allowed versions for a pool\n\t * @param {string} poolKey The key of the pool to be updated\n\t * @returns A function that takes a Transaction object\n\t */\n\tupdatePoolAllowedVersions = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::update_pool_allowed_versions`,\n\t\t\targuments: [tx.object(pool.address), tx.object(this.#config.REGISTRY_ID)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Gets an order\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} orderId Order ID to get\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetOrder = (poolKey: string, orderId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_order`,\n\t\t\targuments: [tx.object(pool.address), tx.pure.u128(orderId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Prepares a transaction to retrieve multiple orders from a specified pool.\n\t * @param {string} poolKey - The identifier key for the pool to retrieve orders from.\n\t * @param {string[]} orderIds - Array of order IDs to retrieve.\n\t * @returns {Function} A function that takes a Transaction object\n\t */\n\tgetOrders = (poolKey: string, orderIds: string[]) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_orders`,\n\t\t\targuments: [tx.object(pool.address), tx.pure.vector('u128', orderIds)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Burn DEEP tokens from the pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tburnDeep = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::burn_deep`,\n\t\t\targuments: [tx.object(pool.address), tx.object(this.#config.DEEP_TREASURY_ID)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the mid price for a pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tmidPrice = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::mid_price`,\n\t\t\targuments: [tx.object(pool.address), tx.object.clock()],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Check if a pool is whitelisted\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\twhitelisted = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::whitelisted`,\n\t\t\targuments: [tx.object(pool.address)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the quote quantity out for a given base quantity in\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {number} baseQuantity Base quantity to convert\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetQuoteQuantityOut = (poolKey: string, baseQuantity: number) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_quote_quantity_out`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.pure.u64(baseQuantity * baseCoin.scalar),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the base quantity out for a given quote quantity in\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {number} quoteQuantity Quote quantity to convert\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetBaseQuantityOut = (poolKey: string, quoteQuantity: number) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst quoteScalar = quoteCoin.scalar;\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_base_quantity_out`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.pure.u64(quoteQuantity * quoteScalar),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the quantity out for a given base or quote quantity\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {number} baseQuantity Base quantity to convert\n\t * @param {number} quoteQuantity Quote quantity to convert\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetQuantityOut =\n\t\t(poolKey: string, baseQuantity: number, quoteQuantity: number) => (tx: Transaction) => {\n\t\t\tconst pool = this.#config.getPool(poolKey);\n\t\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\t\tconst quoteScalar = quoteCoin.scalar;\n\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_quantity_out`,\n\t\t\t\targuments: [\n\t\t\t\t\ttx.object(pool.address),\n\t\t\t\t\ttx.pure.u64(baseQuantity * baseCoin.scalar),\n\t\t\t\t\ttx.pure.u64(quoteQuantity * quoteScalar),\n\t\t\t\t\ttx.object.clock(),\n\t\t\t\t],\n\t\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Get open orders for a balance manager in a pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} managerKey Key of the balance manager\n\t * @returns A function that takes a Transaction object\n\t */\n\taccountOpenOrders = (poolKey: string, managerKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst manager = this.#config.getBalanceManager(managerKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::account_open_orders`,\n\t\t\targuments: [tx.object(pool.address), tx.object(manager.address)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get level 2 order book specifying range of price\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {number} priceLow Lower bound of the price range\n\t * @param {number} priceHigh Upper bound of the price range\n\t * @param {boolean} isBid Whether to get bid or ask orders\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetLevel2Range =\n\t\t(poolKey: string, priceLow: number, priceHigh: number, isBid: boolean) => (tx: Transaction) => {\n\t\t\tconst pool = this.#config.getPool(poolKey);\n\t\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_level2_range`,\n\t\t\t\targuments: [\n\t\t\t\t\ttx.object(pool.address),\n\t\t\t\t\ttx.pure.u64((priceLow * FLOAT_SCALAR * quoteCoin.scalar) / baseCoin.scalar),\n\t\t\t\t\ttx.pure.u64((priceHigh * FLOAT_SCALAR * quoteCoin.scalar) / baseCoin.scalar),\n\t\t\t\t\ttx.pure.bool(isBid),\n\t\t\t\t\ttx.object.clock(),\n\t\t\t\t],\n\t\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Get level 2 order book ticks from mid-price for a pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {number} tickFromMid Number of ticks from mid-price\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetLevel2TicksFromMid = (poolKey: string, tickFromMid: number) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_level2_ticks_from_mid`,\n\t\t\targuments: [tx.object(pool.address), tx.pure.u64(tickFromMid), tx.object.clock()],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the vault balances for a pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tvaultBalances = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::vault_balances`,\n\t\t\targuments: [tx.object(pool.address)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the pool ID by asset types\n\t * @param {string} baseType Type of the base asset\n\t * @param {string} quoteType Type of the quote asset\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetPoolIdByAssets = (baseType: string, quoteType: string) => (tx: Transaction) => {\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_pool_id_by_asset`,\n\t\t\targuments: [tx.object(this.#config.REGISTRY_ID)],\n\t\t\ttypeArguments: [baseType, quoteType],\n\t\t});\n\t};\n\n\t/**\n\t * @description Swap exact base amount for quote amount\n\t * @param {SwapParams} params Parameters for the swap\n\t * @returns A function that takes a Transaction object\n\t */\n\tswapExactBaseForQuote = (params: SwapParams) => (tx: Transaction) => {\n\t\ttx.setGasBudgetIfNotSet(GAS_BUDGET);\n\t\ttx.setSenderIfNotSet(this.#config.address);\n\n\t\tif (params.quoteCoin) {\n\t\t\tthrow new Error('quoteCoin is not accepted for swapping base asset');\n\t\t}\n\t\tconst { poolKey, amount: baseAmount, deepAmount, minOut: minQuote } = params;\n\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst deepCoinType = this.#config.getCoin('DEEP').type;\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\tconst baseCoinInput =\n\t\t\tparams.baseCoin ??\n\t\t\tcoinWithBalance({ type: baseCoin.type, balance: Math.round(baseAmount * baseCoin.scalar) });\n\n\t\tconst deepCoin =\n\t\t\tparams.deepCoin ??\n\t\t\tcoinWithBalance({ type: deepCoinType, balance: Math.round(deepAmount * DEEP_SCALAR) });\n\n\t\tconst minQuoteInput = Math.round(minQuote * quoteCoin.scalar);\n\n\t\tconst [baseCoinResult, quoteCoinResult, deepCoinResult] = tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::swap_exact_base_for_quote`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\tbaseCoinInput,\n\t\t\t\tdeepCoin,\n\t\t\t\ttx.pure.u64(minQuoteInput),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\n\t\treturn [baseCoinResult, quoteCoinResult, deepCoinResult] as const;\n\t};\n\n\t/**\n\t * @description Swap exact quote amount for base amount\n\t * @param {SwapParams} params Parameters for the swap\n\t * @returns A function that takes a Transaction object\n\t */\n\tswapExactQuoteForBase = (params: SwapParams) => (tx: Transaction) => {\n\t\ttx.setGasBudgetIfNotSet(GAS_BUDGET);\n\t\ttx.setSenderIfNotSet(this.#config.address);\n\n\t\tif (params.baseCoin) {\n\t\t\tthrow new Error('baseCoin is not accepted for swapping quote asset');\n\t\t}\n\t\tconst { poolKey, amount: quoteAmount, deepAmount, minOut: minBase } = params;\n\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst deepCoinType = this.#config.getCoin('DEEP').type;\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\tconst quoteCoinInput =\n\t\t\tparams.quoteCoin ??\n\t\t\tcoinWithBalance({\n\t\t\t\ttype: quoteCoin.type,\n\t\t\t\tbalance: Math.round(quoteAmount * quoteCoin.scalar),\n\t\t\t});\n\n\t\tconst deepCoin =\n\t\t\tparams.deepCoin ??\n\t\t\tcoinWithBalance({ type: deepCoinType, balance: Math.round(deepAmount * DEEP_SCALAR) });\n\n\t\tconst minBaseInput = Math.round(minBase * baseCoin.scalar);\n\n\t\tconst [baseCoinResult, quoteCoinResult, deepCoinResult] = tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::swap_exact_quote_for_base`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\tquoteCoinInput,\n\t\t\t\tdeepCoin,\n\t\t\t\ttx.pure.u64(minBaseInput),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\n\t\treturn [baseCoinResult, quoteCoinResult, deepCoinResult] as const;\n\t};\n\n\t/**\n\t * @description Swap exact quantity without a balance manager\n\t * @param {SwapParams & {isBaseToCoin: boolean}} params Parameters for the swap\n\t * @returns A function that takes a Transaction object\n\t */\n\tswapExactQuantity = (params: SwapParams & { isBaseToCoin: boolean }) => (tx: Transaction) => {\n\t\ttx.setGasBudgetIfNotSet(GAS_BUDGET);\n\t\ttx.setSenderIfNotSet(this.#config.address);\n\n\t\tconst { poolKey, amount, deepAmount, minOut, baseCoin, quoteCoin, deepCoin, isBaseToCoin } =\n\t\t\tparams;\n\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst deepCoinType = this.#config.getCoin('DEEP').type;\n\t\tconst baseCoinType = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoinType = this.#config.getCoin(pool.quoteCoin);\n\n\t\tconst baseCoinInput = isBaseToCoin\n\t\t\t? (baseCoin ??\n\t\t\t\tcoinWithBalance({\n\t\t\t\t\ttype: baseCoinType.type,\n\t\t\t\t\tbalance: Math.round(amount * baseCoinType.scalar),\n\t\t\t\t}))\n\t\t\t: coinWithBalance({ type: baseCoinType.type, balance: 0 });\n\n\t\tconst quoteCoinInput = isBaseToCoin\n\t\t\t? coinWithBalance({ type: quoteCoinType.type, balance: 0 })\n\t\t\t: (quoteCoin ??\n\t\t\t\tcoinWithBalance({\n\t\t\t\t\ttype: quoteCoinType.type,\n\t\t\t\t\tbalance: Math.round(amount * quoteCoinType.scalar),\n\t\t\t\t}));\n\n\t\tconst deepCoinInput =\n\t\t\tdeepCoin ??\n\t\t\tcoinWithBalance({ type: deepCoinType, balance: Math.round(deepAmount * DEEP_SCALAR) });\n\n\t\tconst minOutInput = Math.round(\n\t\t\tminOut * (isBaseToCoin ? quoteCoinType.scalar : baseCoinType.scalar),\n\t\t);\n\n\t\tconst [baseCoinResult, quoteCoinResult, deepCoinResult] = tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::swap_exact_quantity`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\tbaseCoinInput,\n\t\t\t\tquoteCoinInput,\n\t\t\t\tdeepCoinInput,\n\t\t\t\ttx.pure.u64(minOutInput),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoinType.type, quoteCoinType.type],\n\t\t});\n\n\t\treturn [baseCoinResult, quoteCoinResult, deepCoinResult] as const;\n\t};\n\n\t/**\n\t * @description Swap exact base for quote with a balance manager\n\t * @param {SwapWithManagerParams} params Parameters for the swap\n\t * @returns A function that takes a Transaction object\n\t */\n\tswapExactBaseForQuoteWithManager = (params: SwapWithManagerParams) => (tx: Transaction) => {\n\t\ttx.setGasBudgetIfNotSet(GAS_BUDGET);\n\t\tconst {\n\t\t\tpoolKey,\n\t\t\tbalanceManagerKey,\n\t\t\ttradeCap,\n\t\t\tdepositCap,\n\t\t\twithdrawCap,\n\t\t\tamount: baseAmount,\n\t\t\tminOut: minQuote,\n\t\t\tbaseCoin,\n\t\t} = params;\n\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst balanceManager = this.#config.getBalanceManager(balanceManagerKey);\n\t\tconst baseCoinType = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoinType = this.#config.getCoin(pool.quoteCoin);\n\n\t\tconst baseCoinInput =\n\t\t\tbaseCoin ??\n\t\t\tcoinWithBalance({\n\t\t\t\ttype: baseCoinType.type,\n\t\t\t\tbalance: Math.round(baseAmount * baseCoinType.scalar),\n\t\t\t});\n\t\tconst minQuoteInput = Math.round(minQuote * quoteCoinType.scalar);\n\n\t\tconst [baseCoinResult, quoteCoinResult] = tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::swap_exact_base_for_quote_with_manager`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.object(balanceManager.address),\n\t\t\t\ttx.object(tradeCap),\n\t\t\t\ttx.object(depositCap),\n\t\t\t\ttx.object(withdrawCap),\n\t\t\t\tbaseCoinInput,\n\t\t\t\ttx.pure.u64(minQuoteInput),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoinType.type, quoteCoinType.type],\n\t\t});\n\n\t\treturn [baseCoinResult, quoteCoinResult] as const;\n\t};\n\n\t/**\n\t * @description Swap exact quote for base with a balance manager\n\t * @param {SwapWithManagerParams} params Parameters for the swap\n\t * @returns A function that takes a Transaction object\n\t */\n\tswapExactQuoteForBaseWithManager = (params: SwapWithManagerParams) => (tx: Transaction) => {\n\t\ttx.setGasBudgetIfNotSet(GAS_BUDGET);\n\t\tconst {\n\t\t\tpoolKey,\n\t\t\tbalanceManagerKey,\n\t\t\ttradeCap,\n\t\t\tdepositCap,\n\t\t\twithdrawCap,\n\t\t\tamount: quoteAmount,\n\t\t\tminOut: minBase,\n\t\t\tquoteCoin,\n\t\t} = params;\n\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst balanceManager = this.#config.getBalanceManager(balanceManagerKey);\n\t\tconst baseCoinType = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoinType = this.#config.getCoin(pool.quoteCoin);\n\n\t\tconst quoteCoinInput =\n\t\t\tquoteCoin ??\n\t\t\tcoinWithBalance({\n\t\t\t\ttype: quoteCoinType.type,\n\t\t\t\tbalance: Math.round(quoteAmount * quoteCoinType.scalar),\n\t\t\t});\n\t\tconst minBaseInput = Math.round(minBase * baseCoinType.scalar);\n\n\t\tconst [baseCoinResult, quoteCoinResult] = tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::swap_exact_quote_for_base_with_manager`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.object(balanceManager.address),\n\t\t\t\ttx.object(tradeCap),\n\t\t\t\ttx.object(depositCap),\n\t\t\t\ttx.object(withdrawCap),\n\t\t\t\tquoteCoinInput,\n\t\t\t\ttx.pure.u64(minBaseInput),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoinType.type, quoteCoinType.type],\n\t\t});\n\n\t\treturn [baseCoinResult, quoteCoinResult] as const;\n\t};\n\n\t/**\n\t * @description Swap exact quantity (base or quote) with a balance manager\n\t * @param {SwapWithManagerParams & {isBaseToCoin: boolean}} params Parameters for the swap\n\t * @returns A function that takes a Transaction object\n\t */\n\tswapExactQuantityWithManager =\n\t\t(params: SwapWithManagerParams & { isBaseToCoin: boolean }) => (tx: Transaction) => {\n\t\t\ttx.setGasBudgetIfNotSet(GAS_BUDGET);\n\t\t\tconst {\n\t\t\t\tpoolKey,\n\t\t\t\tbalanceManagerKey,\n\t\t\t\ttradeCap,\n\t\t\t\tdepositCap,\n\t\t\t\twithdrawCap,\n\t\t\t\tamount,\n\t\t\t\tminOut,\n\t\t\t\tbaseCoin,\n\t\t\t\tquoteCoin,\n\t\t\t\tisBaseToCoin,\n\t\t\t} = params;\n\n\t\t\tconst pool = this.#config.getPool(poolKey);\n\t\t\tconst balanceManager = this.#config.getBalanceManager(balanceManagerKey);\n\t\t\tconst baseCoinType = this.#config.getCoin(pool.baseCoin);\n\t\t\tconst quoteCoinType = this.#config.getCoin(pool.quoteCoin);\n\n\t\t\tconst baseCoinInput = isBaseToCoin\n\t\t\t\t? (baseCoin ??\n\t\t\t\t\tcoinWithBalance({\n\t\t\t\t\t\ttype: baseCoinType.type,\n\t\t\t\t\t\tbalance: Math.round(amount * baseCoinType.scalar),\n\t\t\t\t\t}))\n\t\t\t\t: coinWithBalance({ type: baseCoinType.type, balance: 0 });\n\n\t\t\tconst quoteCoinInput = isBaseToCoin\n\t\t\t\t? coinWithBalance({ type: quoteCoinType.type, balance: 0 })\n\t\t\t\t: (quoteCoin ??\n\t\t\t\t\tcoinWithBalance({\n\t\t\t\t\t\ttype: quoteCoinType.type,\n\t\t\t\t\t\tbalance: Math.round(amount * quoteCoinType.scalar),\n\t\t\t\t\t}));\n\n\t\t\tconst minOutInput = Math.round(\n\t\t\t\tminOut * (isBaseToCoin ? quoteCoinType.scalar : baseCoinType.scalar),\n\t\t\t);\n\n\t\t\tconst [baseCoinResult, quoteCoinResult] = tx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::swap_exact_quantity_with_manager`,\n\t\t\t\targuments: [\n\t\t\t\t\ttx.object(pool.address),\n\t\t\t\t\ttx.object(balanceManager.address),\n\t\t\t\t\ttx.object(tradeCap),\n\t\t\t\t\ttx.object(depositCap),\n\t\t\t\t\ttx.object(withdrawCap),\n\t\t\t\t\tbaseCoinInput,\n\t\t\t\t\tquoteCoinInput,\n\t\t\t\t\ttx.pure.u64(minOutInput),\n\t\t\t\t\ttx.object.clock(),\n\t\t\t\t],\n\t\t\t\ttypeArguments: [baseCoinType.type, quoteCoinType.type],\n\t\t\t});\n\n\t\t\treturn [baseCoinResult, quoteCoinResult] as const;\n\t\t};\n\n\t/**\n\t * @description Create a new pool permissionlessly\n\t * @param {CreatePermissionlessPoolParams} params Parameters for creating permissionless pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tcreatePermissionlessPool = (params: CreatePermissionlessPoolParams) => (tx: Transaction) => {\n\t\ttx.setSenderIfNotSet(this.#config.address);\n\t\tconst { baseCoinKey, quoteCoinKey, tickSize, lotSize, minSize, deepCoin } = params;\n\t\tconst baseCoin = this.#config.getCoin(baseCoinKey);\n\t\tconst quoteCoin = this.#config.getCoin(quoteCoinKey);\n\t\tconst deepCoinType = this.#config.getCoin('DEEP').type;\n\n\t\tconst baseScalar = baseCoin.scalar;\n\t\tconst quoteScalar = quoteCoin.scalar;\n\n\t\tconst adjustedTickSize = Math.round((tickSize * FLOAT_SCALAR * quoteScalar) / baseScalar);\n\t\tconst adjustedLotSize = Math.round(lotSize * baseScalar);\n\t\tconst adjustedMinSize = Math.round(minSize * baseScalar);\n\n\t\tconst deepCoinInput =\n\t\t\tdeepCoin ??\n\t\t\tcoinWithBalance({\n\t\t\t\ttype: deepCoinType,\n\t\t\t\tbalance: POOL_CREATION_FEE_DEEP,\n\t\t\t});\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::create_permissionless_pool`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.REGISTRY_ID), // registry_id\n\t\t\t\ttx.pure.u64(adjustedTickSize), // adjusted tick_size\n\t\t\t\ttx.pure.u64(adjustedLotSize), // adjusted lot_size\n\t\t\t\ttx.pure.u64(adjustedMinSize), // adjusted min_size\n\t\t\t\tdeepCoinInput,\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the trade parameters for a given pool, including taker fee, maker fee, and stake required.\n\t * @param {string} poolKey Key of the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tpoolTradeParams = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::pool_trade_params`,\n\t\t\targuments: [tx.object(pool.address)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the book parameters for a given pool, including tick size, lot size, and min size.\n\t * @param {string} poolKey Key of the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tpoolBookParams = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::pool_book_params`,\n\t\t\targuments: [tx.object(pool.address)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the account information for a given pool and balance manager\n\t * @param {string} poolKey Key of the pool\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\taccount = (poolKey: string, managerKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::account`,\n\t\t\targuments: [tx.object(pool.address), tx.object(managerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the locked balance for a given pool and balance manager\n\t * @param {string} poolKey Key of the pool\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tlockedBalance = (poolKey: string, managerKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::locked_balance`,\n\t\t\targuments: [tx.object(pool.address), tx.object(managerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the DEEP price conversion for a pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetPoolDeepPrice = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_order_deep_price`,\n\t\t\targuments: [tx.object(pool.address)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the balance manager IDs for a given owner\n\t * @param {string} owner The owner address to get balance manager IDs for\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetBalanceManagerIds = (owner: string) => (tx: Transaction) => {\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::registry::get_balance_manager_ids`,\n\t\t\targuments: [tx.object(this.#config.REGISTRY_ID), tx.pure.address(owner)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the balances for a referral\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} referral The referral to get the balances for\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetReferralBalances = (poolKey: string, referral: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_referral_balances`,\n\t\t\targuments: [tx.object(pool.address), tx.object(referral)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Check if a pool is a stable pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tstablePool = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::stable_pool`,\n\t\t\targuments: [tx.object(pool.address)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Check if a pool is registered\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tregisteredPool = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::registered_pool`,\n\t\t\targuments: [tx.object(pool.address)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the quote quantity out for a given base quantity using input token as fee\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {number} baseQuantity Base quantity to convert\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetQuoteQuantityOutInputFee = (poolKey: string, baseQuantity: number) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_quote_quantity_out_input_fee`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.pure.u64(baseQuantity * baseCoin.scalar),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the base quantity out for a given quote quantity using input token as fee\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {number} quoteQuantity Quote quantity to convert\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetBaseQuantityOutInputFee = (poolKey: string, quoteQuantity: number) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_base_quantity_out_input_fee`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.pure.u64(quoteQuantity * quoteCoin.scalar),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the quantity out for a given base or quote quantity using input token as fee\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {number} baseQuantity Base quantity to convert\n\t * @param {number} quoteQuantity Quote quantity to convert\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetQuantityOutInputFee =\n\t\t(poolKey: string, baseQuantity: number, quoteQuantity: number) => (tx: Transaction) => {\n\t\t\tconst pool = this.#config.getPool(poolKey);\n\t\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\t\treturn tx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_quantity_out_input_fee`,\n\t\t\t\targuments: [\n\t\t\t\t\ttx.object(pool.address),\n\t\t\t\t\ttx.pure.u64(baseQuantity * baseCoin.scalar),\n\t\t\t\t\ttx.pure.u64(quoteQuantity * quoteCoin.scalar),\n\t\t\t\t\ttx.object.clock(),\n\t\t\t\t],\n\t\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Get the base quantity needed to receive a target quote quantity\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {number} targetQuoteQuantity Target quote quantity\n\t * @param {boolean} payWithDeep Whether to pay fees with DEEP\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetBaseQuantityIn =\n\t\t(poolKey: string, targetQuoteQuantity: number, payWithDeep: boolean) => (tx: Transaction) => {\n\t\t\tconst pool = this.#config.getPool(poolKey);\n\t\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\t\treturn tx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_base_quantity_in`,\n\t\t\t\targuments: [\n\t\t\t\t\ttx.object(pool.address),\n\t\t\t\t\ttx.pure.u64(targetQuoteQuantity * quoteCoin.scalar),\n\t\t\t\t\ttx.pure.bool(payWithDeep),\n\t\t\t\t\ttx.object.clock(),\n\t\t\t\t],\n\t\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Get the quote quantity needed to receive a target base quantity\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {number} targetBaseQuantity Target base quantity\n\t * @param {boolean} payWithDeep Whether to pay fees with DEEP\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetQuoteQuantityIn =\n\t\t(poolKey: string, targetBaseQuantity: number, payWithDeep: boolean) => (tx: Transaction) => {\n\t\t\tconst pool = this.#config.getPool(poolKey);\n\t\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\t\treturn tx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_quote_quantity_in`,\n\t\t\t\targuments: [\n\t\t\t\t\ttx.object(pool.address),\n\t\t\t\t\ttx.pure.u64(targetBaseQuantity * baseCoin.scalar),\n\t\t\t\t\ttx.pure.bool(payWithDeep),\n\t\t\t\t\ttx.object.clock(),\n\t\t\t\t],\n\t\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Get account order details for a balance manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} managerKey Key of the balance manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetAccountOrderDetails = (poolKey: string, managerKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst manager = this.#config.getBalanceManager(managerKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_account_order_details`,\n\t\t\targuments: [tx.object(pool.address), tx.object(manager.address)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the DEEP required for an order\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {number} baseQuantity Base quantity\n\t * @param {number} price Price\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetOrderDeepRequired =\n\t\t(poolKey: string, baseQuantity: number, price: number) => (tx: Transaction) => {\n\t\t\tconst pool = this.#config.getPool(poolKey);\n\t\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\t\tconst inputPrice = Math.round((price * FLOAT_SCALAR * quoteCoin.scalar) / baseCoin.scalar);\n\t\t\tconst inputQuantity = Math.round(baseQuantity * baseCoin.scalar);\n\n\t\t\treturn tx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::get_order_deep_required`,\n\t\t\t\targuments: [tx.object(pool.address), tx.pure.u64(inputQuantity), tx.pure.u64(inputPrice)],\n\t\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Check if account exists for a balance manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} managerKey Key of the balance manager\n\t * @returns A function that takes a Transaction object\n\t */\n\taccountExists = (poolKey: string, managerKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst manager = this.#config.getBalanceManager(managerKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::account_exists`,\n\t\t\targuments: [tx.object(pool.address), tx.object(manager.address)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the next epoch trade parameters for a pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tpoolTradeParamsNext = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::pool_trade_params_next`,\n\t\t\targuments: [tx.object(pool.address)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the quorum for a pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tquorum = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::quorum`,\n\t\t\targuments: [tx.object(pool.address)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the pool ID\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tpoolId = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::id`,\n\t\t\targuments: [tx.object(pool.address)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Check if a limit order can be placed\n\t * @param {CanPlaceLimitOrderParams} params Parameters for checking limit order validity\n\t * @returns A function that takes a Transaction object\n\t */\n\tcanPlaceLimitOrder = (params: CanPlaceLimitOrderParams) => (tx: Transaction) => {\n\t\tconst { poolKey, balanceManagerKey, price, quantity, isBid, payWithDeep, expireTimestamp } =\n\t\t\tparams;\n\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst manager = this.#config.getBalanceManager(balanceManagerKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst inputPrice = Math.round((price * FLOAT_SCALAR * quoteCoin.scalar) / baseCoin.scalar);\n\t\tconst inputQuantity = Math.round(quantity * baseCoin.scalar);\n\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::can_place_limit_order`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.pure.u64(inputPrice),\n\t\t\t\ttx.pure.u64(inputQuantity),\n\t\t\t\ttx.pure.bool(isBid),\n\t\t\t\ttx.pure.bool(payWithDeep),\n\t\t\t\ttx.pure.u64(expireTimestamp),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Check if a market order can be placed\n\t * @param {CanPlaceMarketOrderParams} params Parameters for checking market order validity\n\t * @returns A function that takes a Transaction object\n\t */\n\tcanPlaceMarketOrder = (params: CanPlaceMarketOrderParams) => (tx: Transaction) => {\n\t\tconst { poolKey, balanceManagerKey, quantity, isBid, payWithDeep } = params;\n\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst manager = this.#config.getBalanceManager(balanceManagerKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst inputQuantity = Math.round(quantity * baseCoin.scalar);\n\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::can_place_market_order`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.pure.u64(inputQuantity),\n\t\t\t\ttx.pure.bool(isBid),\n\t\t\t\ttx.pure.bool(payWithDeep),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Check if market order params are valid\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {number} quantity Quantity\n\t * @returns A function that takes a Transaction object\n\t */\n\tcheckMarketOrderParams = (poolKey: string, quantity: number) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst inputQuantity = Math.round(quantity * baseCoin.scalar);\n\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::check_market_order_params`,\n\t\t\targuments: [tx.object(pool.address), tx.pure.u64(inputQuantity)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Check if limit order params are valid\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {number} price Price\n\t * @param {number} quantity Quantity\n\t * @param {number} expireTimestamp Expiration timestamp\n\t * @returns A function that takes a Transaction object\n\t */\n\tcheckLimitOrderParams =\n\t\t(poolKey: string, price: number, quantity: number, expireTimestamp: number) =>\n\t\t(tx: Transaction) => {\n\t\t\tconst pool = this.#config.getPool(poolKey);\n\t\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\t\tconst inputPrice = Math.round((price * FLOAT_SCALAR * quoteCoin.scalar) / baseCoin.scalar);\n\t\t\tconst inputQuantity = Math.round(quantity * baseCoin.scalar);\n\n\t\t\treturn tx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::check_limit_order_params`,\n\t\t\t\targuments: [\n\t\t\t\t\ttx.object(pool.address),\n\t\t\t\t\ttx.pure.u64(inputPrice),\n\t\t\t\t\ttx.pure.u64(inputQuantity),\n\t\t\t\t\ttx.pure.u64(expireTimestamp),\n\t\t\t\t\ttx.object.clock(),\n\t\t\t\t],\n\t\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t\t});\n\t\t};\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAAgC;AAGhC,mBAA+C;AAW/C,oBAMO;AAtBP;AA2BO,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA,EAM7B,YAAY,QAAwB;AALpC;AAcA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAkB,CAAC,WAAkC,CAAC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QAC3C,WAAW,CAAC,GAAG,OAAO,KAAK,OAAO,GAAG,GAAG,KAAK,IAAI,aAAa,CAAC;AAAA,QAC/D,eAAe,CAAC,SAAS,MAAM,UAAU,IAAI;AAAA,MAC9C,CAAC;AAAA,IACF;AAUA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCACC,CAAC,SAAiB,OAAe,UAAkB,oBACnD,CAAC,OAAoB;AACpB,YAAM,OAAO,mBAAK,SAAQ,QAAQ,OAAO;AACzC,YAAM,WAAW,mBAAK,SAAQ,QAAQ,KAAK,QAAQ;AACnD,YAAM,YAAY,mBAAK,SAAQ,QAAQ,KAAK,SAAS;AACrD,YAAM,aAAa,KAAK,MAAO,QAAQ,6BAAe,UAAU,SAAU,SAAS,MAAM;AACzF,YAAM,gBAAgB,KAAK,MAAM,WAAW,SAAS,MAAM;AAE3D,aAAO,GAAG,SAAS;AAAA,QAClB,QAAQ,GAAG,mBAAK,SAAQ,mBAAmB;AAAA,QAC3C,WAAW;AAAA,UACV,GAAG,OAAO,KAAK,OAAO;AAAA,UACtB,GAAG,KAAK,IAAI,UAAU;AAAA,UACtB,GAAG,KAAK,IAAI,aAAa;AAAA,UACzB,GAAG,KAAK,IAAI,eAAe;AAAA,UAC3B,GAAG,OAAO,MAAM;AAAA,QACjB;AAAA,QACA,eAAe,CAAC,SAAS,MAAM,UAAU,IAAI;AAAA,MAC9C,CAAC;AAAA,IACF;AAx7CA,uBAAK,SAAU;AAAA,EAChB;AAw7CD;AA/7CC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -58,6 +58,22 @@ export interface PlaceMarketOrderParams {
|
|
|
58
58
|
selfMatchingOption?: SelfMatchingOptions;
|
|
59
59
|
payWithDeep?: boolean;
|
|
60
60
|
}
|
|
61
|
+
export interface CanPlaceLimitOrderParams {
|
|
62
|
+
poolKey: string;
|
|
63
|
+
balanceManagerKey: string;
|
|
64
|
+
price: number;
|
|
65
|
+
quantity: number;
|
|
66
|
+
isBid: boolean;
|
|
67
|
+
payWithDeep: boolean;
|
|
68
|
+
expireTimestamp: number;
|
|
69
|
+
}
|
|
70
|
+
export interface CanPlaceMarketOrderParams {
|
|
71
|
+
poolKey: string;
|
|
72
|
+
balanceManagerKey: string;
|
|
73
|
+
quantity: number;
|
|
74
|
+
isBid: boolean;
|
|
75
|
+
payWithDeep: boolean;
|
|
76
|
+
}
|
|
61
77
|
export interface PlaceMarginLimitOrderParams {
|
|
62
78
|
poolKey: string;
|
|
63
79
|
marginManagerKey: string;
|
|
@@ -100,6 +116,31 @@ export interface SwapParams {
|
|
|
100
116
|
baseCoin?: TransactionObjectArgument;
|
|
101
117
|
quoteCoin?: TransactionObjectArgument;
|
|
102
118
|
}
|
|
119
|
+
export interface SwapWithManagerParams {
|
|
120
|
+
poolKey: string;
|
|
121
|
+
balanceManagerKey: string;
|
|
122
|
+
tradeCap: string;
|
|
123
|
+
depositCap: string;
|
|
124
|
+
withdrawCap: string;
|
|
125
|
+
amount: number;
|
|
126
|
+
minOut: number;
|
|
127
|
+
baseCoin?: TransactionObjectArgument;
|
|
128
|
+
quoteCoin?: TransactionObjectArgument;
|
|
129
|
+
}
|
|
130
|
+
export interface StakeParams {
|
|
131
|
+
poolKey: string;
|
|
132
|
+
balanceManagerKey: string;
|
|
133
|
+
amount: number;
|
|
134
|
+
}
|
|
135
|
+
export interface VoteParams {
|
|
136
|
+
poolKey: string;
|
|
137
|
+
balanceManagerKey: string;
|
|
138
|
+
proposalId: string;
|
|
139
|
+
}
|
|
140
|
+
export interface FlashLoanParams {
|
|
141
|
+
poolKey: string;
|
|
142
|
+
amount: number;
|
|
143
|
+
}
|
|
103
144
|
export interface CreatePoolAdminParams {
|
|
104
145
|
baseCoinKey: string;
|
|
105
146
|
quoteCoinKey: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/types/index.ts"],
|
|
4
|
-
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { TransactionObjectArgument } from '@mysten/sui/transactions';\n\n// SPDX-License-Identifier: Apache-2.0\nexport interface BalanceManager {\n\taddress: string;\n\ttradeCap?: string;\n\tdepositCap?: string;\n\twithdrawCap?: string;\n}\n\nexport interface MarginManager {\n\taddress: string;\n\tpoolKey: string;\n}\n\nexport interface Coin {\n\taddress: string;\n\ttype: string;\n\tscalar: number;\n\tfeed?: string;\n\tmetadataId?: string;\n\tpriceInfoObjectId?: string;\n}\n\nexport interface Pool {\n\taddress: string;\n\tbaseCoin: string;\n\tquoteCoin: string;\n}\n\nexport interface MarginPool {\n\taddress: string;\n\ttype: string;\n}\n\n// Trading constants\nexport enum OrderType {\n\tNO_RESTRICTION,\n\tIMMEDIATE_OR_CANCEL,\n\tFILL_OR_KILL,\n\tPOST_ONLY,\n}\n\n// Self matching options\nexport enum SelfMatchingOptions {\n\tSELF_MATCHING_ALLOWED,\n\tCANCEL_TAKER,\n\tCANCEL_MAKER,\n}\n\nexport interface PlaceLimitOrderParams {\n\tpoolKey: string;\n\tbalanceManagerKey: string;\n\tclientOrderId: string;\n\tprice: number;\n\tquantity: number;\n\tisBid: boolean;\n\texpiration?: number | bigint;\n\torderType?: OrderType;\n\tselfMatchingOption?: SelfMatchingOptions;\n\tpayWithDeep?: boolean;\n}\n\nexport interface PlaceMarketOrderParams {\n\tpoolKey: string;\n\tbalanceManagerKey: string;\n\tclientOrderId: string;\n\tquantity: number;\n\tisBid: boolean;\n\tselfMatchingOption?: SelfMatchingOptions;\n\tpayWithDeep?: boolean;\n}\n\nexport interface PlaceMarginLimitOrderParams {\n\tpoolKey: string;\n\tmarginManagerKey: string;\n\tclientOrderId: string;\n\tprice: number;\n\tquantity: number;\n\tisBid: boolean;\n\texpiration?: number | bigint;\n\torderType?: OrderType;\n\tselfMatchingOption?: SelfMatchingOptions;\n\tpayWithDeep?: boolean;\n}\n\nexport interface PlaceMarginMarketOrderParams {\n\tpoolKey: string;\n\tmarginManagerKey: string;\n\tclientOrderId: string;\n\tquantity: number;\n\tisBid: boolean;\n\tselfMatchingOption?: SelfMatchingOptions;\n\tpayWithDeep?: boolean;\n}\n\nexport interface ProposalParams {\n\tpoolKey: string;\n\tbalanceManagerKey: string;\n\ttakerFee: number;\n\tmakerFee: number;\n\tstakeRequired: number;\n}\n\nexport interface MarginProposalParams {\n\ttakerFee: number;\n\tmakerFee: number;\n\tstakeRequired: number;\n}\n\nexport interface SwapParams {\n\tpoolKey: string;\n\tamount: number;\n\tdeepAmount: number;\n\tminOut: number;\n\tdeepCoin?: TransactionObjectArgument;\n\tbaseCoin?: TransactionObjectArgument;\n\tquoteCoin?: TransactionObjectArgument;\n}\n\nexport interface CreatePoolAdminParams {\n\tbaseCoinKey: string;\n\tquoteCoinKey: string;\n\ttickSize: number;\n\tlotSize: number;\n\tminSize: number;\n\twhitelisted: boolean;\n\tstablePool: boolean;\n}\n\nexport interface CreatePermissionlessPoolParams {\n\tbaseCoinKey: string;\n\tquoteCoinKey: string;\n\ttickSize: number;\n\tlotSize: number;\n\tminSize: number;\n\tdeepCoin?: TransactionObjectArgument;\n}\n\nexport interface SetEwmaParams {\n\talpha: number;\n\tzScoreThreshold: number;\n\tadditionalTakerFee: number;\n}\n\nexport interface PoolConfigParams {\n\tminWithdrawRiskRatio: number;\n\tminBorrowRiskRatio: number;\n\tliquidationRiskRatio: number;\n\ttargetLiquidationRiskRatio: number;\n\tuserLiquidationReward: number;\n\tpoolLiquidationReward: number;\n}\n\nexport interface MarginPoolConfigParams {\n\tsupplyCap: number;\n\tmaxUtilizationRate: number;\n\treferralSpread: number;\n\tminBorrow: number;\n}\n\nexport interface InterestConfigParams {\n\tbaseRate: number;\n\tbaseSlope: number;\n\toptimalUtilization: number;\n\texcessSlope: number;\n}\n\nexport interface Config {\n\tDEEPBOOK_PACKAGE_ID: string;\n\tREGISTRY_ID: string;\n\tDEEP_TREASURY_ID: string;\n}\n\nexport type Environment = 'mainnet' | 'testnet';\n"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { TransactionObjectArgument } from '@mysten/sui/transactions';\n\n// SPDX-License-Identifier: Apache-2.0\nexport interface BalanceManager {\n\taddress: string;\n\ttradeCap?: string;\n\tdepositCap?: string;\n\twithdrawCap?: string;\n}\n\nexport interface MarginManager {\n\taddress: string;\n\tpoolKey: string;\n}\n\nexport interface Coin {\n\taddress: string;\n\ttype: string;\n\tscalar: number;\n\tfeed?: string;\n\tmetadataId?: string;\n\tpriceInfoObjectId?: string;\n}\n\nexport interface Pool {\n\taddress: string;\n\tbaseCoin: string;\n\tquoteCoin: string;\n}\n\nexport interface MarginPool {\n\taddress: string;\n\ttype: string;\n}\n\n// Trading constants\nexport enum OrderType {\n\tNO_RESTRICTION,\n\tIMMEDIATE_OR_CANCEL,\n\tFILL_OR_KILL,\n\tPOST_ONLY,\n}\n\n// Self matching options\nexport enum SelfMatchingOptions {\n\tSELF_MATCHING_ALLOWED,\n\tCANCEL_TAKER,\n\tCANCEL_MAKER,\n}\n\nexport interface PlaceLimitOrderParams {\n\tpoolKey: string;\n\tbalanceManagerKey: string;\n\tclientOrderId: string;\n\tprice: number;\n\tquantity: number;\n\tisBid: boolean;\n\texpiration?: number | bigint;\n\torderType?: OrderType;\n\tselfMatchingOption?: SelfMatchingOptions;\n\tpayWithDeep?: boolean;\n}\n\nexport interface PlaceMarketOrderParams {\n\tpoolKey: string;\n\tbalanceManagerKey: string;\n\tclientOrderId: string;\n\tquantity: number;\n\tisBid: boolean;\n\tselfMatchingOption?: SelfMatchingOptions;\n\tpayWithDeep?: boolean;\n}\n\nexport interface CanPlaceLimitOrderParams {\n\tpoolKey: string;\n\tbalanceManagerKey: string;\n\tprice: number;\n\tquantity: number;\n\tisBid: boolean;\n\tpayWithDeep: boolean;\n\texpireTimestamp: number;\n}\n\nexport interface CanPlaceMarketOrderParams {\n\tpoolKey: string;\n\tbalanceManagerKey: string;\n\tquantity: number;\n\tisBid: boolean;\n\tpayWithDeep: boolean;\n}\n\nexport interface PlaceMarginLimitOrderParams {\n\tpoolKey: string;\n\tmarginManagerKey: string;\n\tclientOrderId: string;\n\tprice: number;\n\tquantity: number;\n\tisBid: boolean;\n\texpiration?: number | bigint;\n\torderType?: OrderType;\n\tselfMatchingOption?: SelfMatchingOptions;\n\tpayWithDeep?: boolean;\n}\n\nexport interface PlaceMarginMarketOrderParams {\n\tpoolKey: string;\n\tmarginManagerKey: string;\n\tclientOrderId: string;\n\tquantity: number;\n\tisBid: boolean;\n\tselfMatchingOption?: SelfMatchingOptions;\n\tpayWithDeep?: boolean;\n}\n\nexport interface ProposalParams {\n\tpoolKey: string;\n\tbalanceManagerKey: string;\n\ttakerFee: number;\n\tmakerFee: number;\n\tstakeRequired: number;\n}\n\nexport interface MarginProposalParams {\n\ttakerFee: number;\n\tmakerFee: number;\n\tstakeRequired: number;\n}\n\nexport interface SwapParams {\n\tpoolKey: string;\n\tamount: number;\n\tdeepAmount: number;\n\tminOut: number;\n\tdeepCoin?: TransactionObjectArgument;\n\tbaseCoin?: TransactionObjectArgument;\n\tquoteCoin?: TransactionObjectArgument;\n}\n\nexport interface SwapWithManagerParams {\n\tpoolKey: string;\n\tbalanceManagerKey: string;\n\ttradeCap: string;\n\tdepositCap: string;\n\twithdrawCap: string;\n\tamount: number;\n\tminOut: number;\n\tbaseCoin?: TransactionObjectArgument;\n\tquoteCoin?: TransactionObjectArgument;\n}\n\nexport interface StakeParams {\n\tpoolKey: string;\n\tbalanceManagerKey: string;\n\tamount: number;\n}\n\nexport interface VoteParams {\n\tpoolKey: string;\n\tbalanceManagerKey: string;\n\tproposalId: string;\n}\n\nexport interface FlashLoanParams {\n\tpoolKey: string;\n\tamount: number;\n}\n\nexport interface CreatePoolAdminParams {\n\tbaseCoinKey: string;\n\tquoteCoinKey: string;\n\ttickSize: number;\n\tlotSize: number;\n\tminSize: number;\n\twhitelisted: boolean;\n\tstablePool: boolean;\n}\n\nexport interface CreatePermissionlessPoolParams {\n\tbaseCoinKey: string;\n\tquoteCoinKey: string;\n\ttickSize: number;\n\tlotSize: number;\n\tminSize: number;\n\tdeepCoin?: TransactionObjectArgument;\n}\n\nexport interface SetEwmaParams {\n\talpha: number;\n\tzScoreThreshold: number;\n\tadditionalTakerFee: number;\n}\n\nexport interface PoolConfigParams {\n\tminWithdrawRiskRatio: number;\n\tminBorrowRiskRatio: number;\n\tliquidationRiskRatio: number;\n\ttargetLiquidationRiskRatio: number;\n\tuserLiquidationReward: number;\n\tpoolLiquidationReward: number;\n}\n\nexport interface MarginPoolConfigParams {\n\tsupplyCap: number;\n\tmaxUtilizationRate: number;\n\treferralSpread: number;\n\tminBorrow: number;\n}\n\nexport interface InterestConfigParams {\n\tbaseRate: number;\n\tbaseSlope: number;\n\toptimalUtilization: number;\n\texcessSlope: number;\n}\n\nexport interface Config {\n\tDEEPBOOK_PACKAGE_ID: string;\n\tREGISTRY_ID: string;\n\tDEEP_TREASURY_ID: string;\n}\n\nexport type Environment = 'mainnet' | 'testnet';\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuCO,IAAK,YAAL,kBAAKA,eAAL;AACN,EAAAA,sBAAA;AACA,EAAAA,sBAAA;AACA,EAAAA,sBAAA;AACA,EAAAA,sBAAA;AAJW,SAAAA;AAAA,GAAA;AAQL,IAAK,sBAAL,kBAAKC,yBAAL;AACN,EAAAA,0CAAA;AACA,EAAAA,0CAAA;AACA,EAAAA,0CAAA;AAHW,SAAAA;AAAA,GAAA;",
|
|
6
6
|
"names": ["OrderType", "SelfMatchingOptions"]
|
|
7
7
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { BalanceManagerContract } from '../transactions/balanceManager.js';
|
|
2
|
-
import type { BalanceManager, Environment, MarginManager } from '../types/index.js';
|
|
2
|
+
import type { BalanceManager, Environment, MarginManager, Coin, Pool, MarginPool } from '../types/index.js';
|
|
3
3
|
import type { CoinMap, PoolMap, MarginPoolMap } from './constants.js';
|
|
4
4
|
export declare const FLOAT_SCALAR = 1000000000;
|
|
5
|
-
export declare const MAX_TIMESTAMP = 1844674407370955161n;
|
|
6
|
-
export declare const GAS_BUDGET: number;
|
|
7
5
|
export declare const DEEP_SCALAR = 1000000;
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
6
|
+
export declare const MAX_TIMESTAMP = 1844674407370955161n;
|
|
7
|
+
export declare const PRICE_INFO_OBJECT_MAX_AGE_MS = 5000;
|
|
8
|
+
export declare const GAS_BUDGET = 250000000;
|
|
9
|
+
export declare const POOL_CREATION_FEE_DEEP = 500000000;
|
|
10
10
|
export declare class DeepBookConfig {
|
|
11
11
|
#private;
|
|
12
12
|
env: Environment;
|
|
@@ -46,9 +46,9 @@ export declare class DeepBookConfig {
|
|
|
46
46
|
pools?: PoolMap;
|
|
47
47
|
marginPools?: MarginPoolMap;
|
|
48
48
|
});
|
|
49
|
-
getCoin(key: string):
|
|
50
|
-
getPool(key: string):
|
|
51
|
-
getMarginPool(key: string):
|
|
49
|
+
getCoin(key: string): Coin;
|
|
50
|
+
getPool(key: string): Pool;
|
|
51
|
+
getMarginPool(key: string): MarginPool;
|
|
52
52
|
/**
|
|
53
53
|
* @description Get the balance manager by key
|
|
54
54
|
* @param managerKey Key of the balance manager
|
package/dist/cjs/utils/config.js
CHANGED
|
@@ -30,20 +30,21 @@ __export(config_exports, {
|
|
|
30
30
|
FLOAT_SCALAR: () => FLOAT_SCALAR,
|
|
31
31
|
GAS_BUDGET: () => GAS_BUDGET,
|
|
32
32
|
MAX_TIMESTAMP: () => MAX_TIMESTAMP,
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
POOL_CREATION_FEE_DEEP: () => POOL_CREATION_FEE_DEEP,
|
|
34
|
+
PRICE_INFO_OBJECT_MAX_AGE_MS: () => PRICE_INFO_OBJECT_MAX_AGE_MS
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(config_exports);
|
|
37
37
|
var import_utils = require("@mysten/sui/utils");
|
|
38
38
|
var import_balanceManager = require("../transactions/balanceManager.js");
|
|
39
|
+
var import_errors = require("./errors.js");
|
|
39
40
|
var import_constants = require("./constants.js");
|
|
40
41
|
var _coins, _pools, _marginPools;
|
|
41
42
|
const FLOAT_SCALAR = 1e9;
|
|
42
|
-
const MAX_TIMESTAMP = 1844674407370955161n;
|
|
43
|
-
const GAS_BUDGET = 0.5 * 5e8;
|
|
44
43
|
const DEEP_SCALAR = 1e6;
|
|
45
|
-
const
|
|
46
|
-
const
|
|
44
|
+
const MAX_TIMESTAMP = 1844674407370955161n;
|
|
45
|
+
const PRICE_INFO_OBJECT_MAX_AGE_MS = 5e3;
|
|
46
|
+
const GAS_BUDGET = 25e7;
|
|
47
|
+
const POOL_CREATION_FEE_DEEP = 5e8;
|
|
47
48
|
class DeepBookConfig {
|
|
48
49
|
constructor({
|
|
49
50
|
env,
|
|
@@ -94,21 +95,21 @@ class DeepBookConfig {
|
|
|
94
95
|
getCoin(key) {
|
|
95
96
|
const coin = __privateGet(this, _coins)[key];
|
|
96
97
|
if (!coin) {
|
|
97
|
-
throw new
|
|
98
|
+
throw new import_errors.ResourceNotFoundError("Coin", key);
|
|
98
99
|
}
|
|
99
100
|
return coin;
|
|
100
101
|
}
|
|
101
102
|
getPool(key) {
|
|
102
103
|
const pool = __privateGet(this, _pools)[key];
|
|
103
104
|
if (!pool) {
|
|
104
|
-
throw new
|
|
105
|
+
throw new import_errors.ResourceNotFoundError("Pool", key);
|
|
105
106
|
}
|
|
106
107
|
return pool;
|
|
107
108
|
}
|
|
108
109
|
getMarginPool(key) {
|
|
109
110
|
const pool = __privateGet(this, _marginPools)[key];
|
|
110
111
|
if (!pool) {
|
|
111
|
-
throw new
|
|
112
|
+
throw new import_errors.ResourceNotFoundError("Margin pool", key);
|
|
112
113
|
}
|
|
113
114
|
return pool;
|
|
114
115
|
}
|
|
@@ -119,7 +120,7 @@ class DeepBookConfig {
|
|
|
119
120
|
*/
|
|
120
121
|
getBalanceManager(managerKey) {
|
|
121
122
|
if (!Object.hasOwn(this.balanceManagers, managerKey)) {
|
|
122
|
-
throw new Error(
|
|
123
|
+
throw new Error(import_errors.ErrorMessages.BALANCE_MANAGER_NOT_FOUND(managerKey));
|
|
123
124
|
}
|
|
124
125
|
return this.balanceManagers[managerKey];
|
|
125
126
|
}
|
|
@@ -130,7 +131,7 @@ class DeepBookConfig {
|
|
|
130
131
|
*/
|
|
131
132
|
getMarginManager(managerKey) {
|
|
132
133
|
if (!Object.hasOwn(this.marginManagers, managerKey)) {
|
|
133
|
-
throw new Error(
|
|
134
|
+
throw new Error(import_errors.ErrorMessages.MARGIN_MANAGER_NOT_FOUND(managerKey));
|
|
134
135
|
}
|
|
135
136
|
return this.marginManagers[managerKey];
|
|
136
137
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/utils/config.ts"],
|
|
4
|
-
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport { normalizeSuiAddress } from '@mysten/sui/utils';\n\nimport { BalanceManagerContract } from '../transactions/balanceManager.js';\nimport type {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAoC;AAEpC,4BAAuC;
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport { normalizeSuiAddress } from '@mysten/sui/utils';\n\nimport { BalanceManagerContract } from '../transactions/balanceManager.js';\nimport type {\n\tBalanceManager,\n\tEnvironment,\n\tMarginManager,\n\tCoin,\n\tPool,\n\tMarginPool,\n} from '../types/index.js';\nimport type { CoinMap, PoolMap, MarginPoolMap } from './constants.js';\nimport { ResourceNotFoundError, ErrorMessages } from './errors.js';\nimport {\n\tmainnetCoins,\n\tmainnetPackageIds,\n\tmainnetPools,\n\ttestnetCoins,\n\ttestnetPackageIds,\n\ttestnetPools,\n\tmainnetMarginPools,\n\ttestnetMarginPools,\n\tmainnetPythConfigs,\n\ttestnetPythConfigs,\n} from './constants.js';\n\n// Constants for numerical precision and scaling\nexport const FLOAT_SCALAR = 1_000_000_000; // 10^9 - Used for floating point representation\nexport const DEEP_SCALAR = 1_000_000; // 10^6 - DEEP token decimal places\n\n// Time-related constants\nexport const MAX_TIMESTAMP = 1_844_674_407_370_955_161n; // Maximum Unix timestamp (approximately year 2554)\nexport const PRICE_INFO_OBJECT_MAX_AGE_MS = 5_000; // 5 seconds in milliseconds\n\n// Transaction and fee constants\nexport const GAS_BUDGET = 250_000_000; // 0.25 SUI (0.5 * 500M MIST)\nexport const POOL_CREATION_FEE_DEEP = 500_000_000; // 500 DEEP tokens (500 * 10^6)\n\nexport class DeepBookConfig {\n\t#coins: CoinMap;\n\t#pools: PoolMap;\n\t#marginPools: MarginPoolMap;\n\tenv: Environment;\n\tbalanceManagers: { [key: string]: BalanceManager };\n\tmarginManagers: { [key: string]: MarginManager };\n\taddress: string;\n\tpyth: {\n\t\tpythStateId: string;\n\t\twormholeStateId: string;\n\t};\n\n\tDEEPBOOK_PACKAGE_ID: string;\n\tREGISTRY_ID: string;\n\tDEEP_TREASURY_ID: string;\n\tMARGIN_PACKAGE_ID: string;\n\tMARGIN_REGISTRY_ID: string;\n\tadminCap?: string;\n\tmarginAdminCap?: string;\n\tmarginMaintainerCap?: string;\n\n\tbalanceManager: BalanceManagerContract;\n\n\tconstructor({\n\t\tenv,\n\t\taddress,\n\t\tadminCap,\n\t\tmarginAdminCap,\n\t\tmarginMaintainerCap,\n\t\tbalanceManagers,\n\t\tmarginManagers,\n\t\tcoins,\n\t\tpools,\n\t\tmarginPools,\n\t}: {\n\t\tenv: Environment;\n\t\taddress: string;\n\t\tadminCap?: string;\n\t\tmarginAdminCap?: string;\n\t\tmarginMaintainerCap?: string;\n\t\tbalanceManagers?: { [key: string]: BalanceManager };\n\t\tmarginManagers?: { [key: string]: MarginManager };\n\t\tcoins?: CoinMap;\n\t\tpools?: PoolMap;\n\t\tmarginPools?: MarginPoolMap;\n\t}) {\n\t\tthis.env = env;\n\t\tthis.address = normalizeSuiAddress(address);\n\t\tthis.adminCap = adminCap;\n\t\tthis.marginAdminCap = marginAdminCap;\n\t\tthis.marginMaintainerCap = marginMaintainerCap;\n\t\tthis.balanceManagers = balanceManagers || {};\n\t\tthis.marginManagers = marginManagers || {};\n\n\t\tif (env === 'mainnet') {\n\t\t\tthis.#coins = coins || mainnetCoins;\n\t\t\tthis.#pools = pools || mainnetPools;\n\t\t\tthis.#marginPools = marginPools || mainnetMarginPools;\n\t\t\tthis.DEEPBOOK_PACKAGE_ID = mainnetPackageIds.DEEPBOOK_PACKAGE_ID;\n\t\t\tthis.REGISTRY_ID = mainnetPackageIds.REGISTRY_ID;\n\t\t\tthis.DEEP_TREASURY_ID = mainnetPackageIds.DEEP_TREASURY_ID;\n\t\t\tthis.MARGIN_PACKAGE_ID = mainnetPackageIds.MARGIN_PACKAGE_ID;\n\t\t\tthis.MARGIN_REGISTRY_ID = mainnetPackageIds.MARGIN_REGISTRY_ID;\n\t\t\tthis.pyth = mainnetPythConfigs;\n\t\t} else {\n\t\t\tthis.#coins = coins || testnetCoins;\n\t\t\tthis.#pools = pools || testnetPools;\n\t\t\tthis.#marginPools = marginPools || testnetMarginPools;\n\t\t\tthis.DEEPBOOK_PACKAGE_ID = testnetPackageIds.DEEPBOOK_PACKAGE_ID;\n\t\t\tthis.REGISTRY_ID = testnetPackageIds.REGISTRY_ID;\n\t\t\tthis.DEEP_TREASURY_ID = testnetPackageIds.DEEP_TREASURY_ID;\n\t\t\tthis.MARGIN_PACKAGE_ID = testnetPackageIds.MARGIN_PACKAGE_ID;\n\t\t\tthis.MARGIN_REGISTRY_ID = testnetPackageIds.MARGIN_REGISTRY_ID;\n\t\t\tthis.pyth = testnetPythConfigs;\n\t\t}\n\n\t\tthis.balanceManager = new BalanceManagerContract(this);\n\t}\n\n\t// Getters\n\tgetCoin(key: string): Coin {\n\t\tconst coin = this.#coins[key];\n\t\tif (!coin) {\n\t\t\tthrow new ResourceNotFoundError('Coin', key);\n\t\t}\n\n\t\treturn coin;\n\t}\n\n\tgetPool(key: string): Pool {\n\t\tconst pool = this.#pools[key];\n\t\tif (!pool) {\n\t\t\tthrow new ResourceNotFoundError('Pool', key);\n\t\t}\n\n\t\treturn pool;\n\t}\n\n\tgetMarginPool(key: string): MarginPool {\n\t\tconst pool = this.#marginPools[key];\n\t\tif (!pool) {\n\t\t\tthrow new ResourceNotFoundError('Margin pool', key);\n\t\t}\n\n\t\treturn pool;\n\t}\n\n\t/**\n\t * @description Get the balance manager by key\n\t * @param managerKey Key of the balance manager\n\t * @returns The BalanceManager object\n\t */\n\tgetBalanceManager(managerKey: string): BalanceManager {\n\t\tif (!Object.hasOwn(this.balanceManagers, managerKey)) {\n\t\t\tthrow new Error(ErrorMessages.BALANCE_MANAGER_NOT_FOUND(managerKey));\n\t\t}\n\n\t\treturn this.balanceManagers[managerKey];\n\t}\n\n\t/**\n\t * @description Get the margin manager by key\n\t * @param managerKey Key of the margin manager\n\t * @returns The MarginManager object\n\t */\n\tgetMarginManager(managerKey: string): MarginManager {\n\t\tif (!Object.hasOwn(this.marginManagers, managerKey)) {\n\t\t\tthrow new Error(ErrorMessages.MARGIN_MANAGER_NOT_FOUND(managerKey));\n\t\t}\n\n\t\treturn this.marginManagers[managerKey];\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAoC;AAEpC,4BAAuC;AAUvC,oBAAqD;AACrD,uBAWO;AA1BP;AA6BO,MAAM,eAAe;AACrB,MAAM,cAAc;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AC1B,UAAM,OAAO,mBAAK,QAAO,GAAG;AAC5B,QAAI,CAAC,MAAM;AACV,YAAM,IAAI,oCAAsB,QAAQ,GAAG;AAAA,IAC5C;AAEA,WAAO;AAAA,EACR;AAAA,EAEA,cAAc,KAAyB;AACtC,UAAM,OAAO,mBAAK,cAAa,GAAG;AAClC,QAAI,CAAC,MAAM;AACV,YAAM,IAAI,oCAAsB,eAAe,GAAG;AAAA,IACnD;AAEA,WAAO;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,kBAAkB,YAAoC;AACrD,QAAI,CAAC,OAAO,OAAO,KAAK,iBAAiB,UAAU,GAAG;AACrD,YAAM,IAAI,MAAM,4BAAc,0BAA0B,UAAU,CAAC;AAAA,IACpE;AAEA,WAAO,KAAK,gBAAgB,UAAU;AAAA,EACvC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,iBAAiB,YAAmC;AACnD,QAAI,CAAC,OAAO,OAAO,KAAK,gBAAgB,UAAU,GAAG;AACpD,YAAM,IAAI,MAAM,4BAAc,yBAAyB,UAAU,CAAC;AAAA,IACnE;AAEA,WAAO,KAAK,eAAe,UAAU;AAAA,EACtC;AACD;AApIC;AACA;AACA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -36,6 +36,10 @@ export declare const testnetMarginPools: {
|
|
|
36
36
|
address: string;
|
|
37
37
|
type: string;
|
|
38
38
|
};
|
|
39
|
+
DEEP: {
|
|
40
|
+
address: string;
|
|
41
|
+
type: string;
|
|
42
|
+
};
|
|
39
43
|
};
|
|
40
44
|
export declare const mainnetMarginPools: {
|
|
41
45
|
SUI: {
|
|
@@ -46,6 +50,10 @@ export declare const mainnetMarginPools: {
|
|
|
46
50
|
address: string;
|
|
47
51
|
type: string;
|
|
48
52
|
};
|
|
53
|
+
DEEP: {
|
|
54
|
+
address: string;
|
|
55
|
+
type: string;
|
|
56
|
+
};
|
|
49
57
|
};
|
|
50
58
|
export declare const testnetPythConfigs: {
|
|
51
59
|
pythStateId: string;
|