@mysten/deepbook-v3 1.2.2 → 1.3.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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # @mysten/deepbook-v3
2
2
 
3
+ ## 1.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 993aa1f: Add `cancelLiveOrder` and `cancelLiveOrders` transaction builders that skip order ids not
8
+ currently in the balance manager's open orders (already filled, cancelled, expired-and-swept, or
9
+ not owned by this BM) instead of aborting. Also updates mainnet `DEEPBOOK_PACKAGE_ID` to
10
+ `0xf48222c4e057fa468baf136bff8e12504209d43850c5778f76159292a96f621e`.
11
+
3
12
  ## 1.2.2
4
13
 
5
14
  ### Patch Changes
@@ -50,6 +50,28 @@ declare class DeepBookContract {
50
50
  * @returns A function that takes a Transaction object
51
51
  */
52
52
  cancelOrders: (poolKey: string, balanceManagerKey: string, orderIds: string[]) => (tx: Transaction) => void;
53
+ /**
54
+ * @description Cancel an existing order, no-op if the order is not currently in the
55
+ * balance manager's open orders (e.g. already filled, cancelled, expired-and-swept,
56
+ * or not owned by this balance manager). Unlike `cancelOrder`, this will not abort
57
+ * on unknown order ids.
58
+ * @param {string} poolKey The key to identify the pool
59
+ * @param {string} balanceManagerKey The key to identify the BalanceManager
60
+ * @param {string} orderId Order ID to cancel
61
+ * @returns A function that takes a Transaction object
62
+ */
63
+ cancelLiveOrder: (poolKey: string, balanceManagerKey: string, orderId: string) => (tx: Transaction) => void;
64
+ /**
65
+ * @description Cancel multiple orders, skipping any order_id that is not currently in
66
+ * the balance manager's open orders (e.g. already filled, cancelled, expired-and-swept,
67
+ * or not owned by this balance manager). Duplicate ids in the input vector are handled
68
+ * gracefully. Unlike `cancelOrders`, this will not abort on unknown order ids.
69
+ * @param {string} poolKey The key to identify the pool
70
+ * @param {string} balanceManagerKey The key to identify the BalanceManager
71
+ * @param {string[]} orderIds Array of order IDs to cancel
72
+ * @returns A function that takes a Transaction object
73
+ */
74
+ cancelLiveOrders: (poolKey: string, balanceManagerKey: string, orderIds: string[]) => (tx: Transaction) => void;
53
75
  /**
54
76
  * @description Cancel all open orders for a balance manager
55
77
  * @param {string} poolKey The key to identify the pool
@@ -1 +1 @@
1
- {"version":3,"file":"deepbook.d.mts","names":[],"sources":["../../src/transactions/deepbook.ts"],"mappings":";;;;;;;;;cA4Ba,gBAAA;EAAA;;;;cAMA,MAAA,EAAQ,cAAA;EA0DQ;;;;;EAjD5B,eAAA,GAAmB,MAAA,EAAQ,qBAAA,MAA2B,EAAA,EAAI,WAAA;EA+MoB;;;;;EA9J9E,gBAAA,GAAoB,MAAA,EAAQ,sBAAA,MAA4B,EAAA,EAAI,WAAA;EA+RK;;;;;;;;EAnPjE,WAAA,GACE,OAAA,UAAiB,iBAAA,UAA2B,OAAA,UAAiB,WAAA,cAC7D,EAAA,EAAI,WAAA;EAmZyE;;;;;;;EAtX/E,WAAA,GACE,OAAA,UAAiB,iBAAA,UAA2B,OAAA,cAAqB,EAAA,EAAI,WAAA;EAsgBlB;;;;;;;EA1erD,YAAA,GACE,OAAA,UAAiB,iBAAA,UAA2B,QAAA,gBAAwB,EAAA,EAAI,WAAA;EAkrBC;;;;;;EAvpB3E,eAAA,GAAmB,OAAA,UAAiB,iBAAA,cAA+B,EAAA,EAAI,WAAA;EAo1Bf;;;;;;EA1zBxD,sBAAA,GAA0B,OAAA,UAAiB,iBAAA,cAA+B,EAAA,EAAI,WAAA;EA+4BE;;;;;;EA33BhF,oCAAA,GACE,OAAA,UAAiB,iBAAA,cAA+B,EAAA,EAAI,WAAA;EAs8BK;;;;;;EAn7B3D,+BAAA,GACE,OAAA,UAAiB,gBAAA,cAA8B,EAAA,EAAI,WAAA;EA+/BpC;;;;;;EA7+BjB,iBAAA,GAAqB,aAAA,UAAuB,gBAAA,cAA8B,EAAA,EAAI,WAAA;EAgkC9B;;;;;;EAniChD,YAAA,GAAgB,OAAA,UAAiB,iBAAA,cA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E,mBAAA,GAAuB,MAAA,EAAQ,yBAAA,MAA+B,EAAA,EAAI,WAAA,KAAW,0BAAA,CAAA,iBAAA;;;;;;;EA6B7E,sBAAA,GAA0B,OAAA,UAAiB,QAAA,uBAA+B,EAAA,EAAI,WAAA,KAAW,0BAAA,CAAA,iBAAA;;;;;;;;;EAqBzF,qBAAA,GACE,OAAA,UAAiB,KAAA,mBAAwB,QAAA,mBAA2B,eAAA,cACpE,EAAA,EAAI,WAAA,KAAW,0BAAA,CAAA,iBAAA;AAAA"}
@@ -125,6 +125,44 @@ var DeepBookContract = class {
125
125
  typeArguments: [baseCoin.type, quoteCoin.type]
126
126
  });
127
127
  };
128
+ this.cancelLiveOrder = (poolKey, balanceManagerKey, orderId) => (tx) => {
129
+ tx.setGasBudgetIfNotSet(GAS_BUDGET);
130
+ const pool = this.#config.getPool(poolKey);
131
+ const balanceManager = this.#config.getBalanceManager(balanceManagerKey);
132
+ const baseCoin = this.#config.getCoin(pool.baseCoin);
133
+ const quoteCoin = this.#config.getCoin(pool.quoteCoin);
134
+ const tradeProof = tx.add(this.#config.balanceManager.generateProof(balanceManagerKey));
135
+ tx.moveCall({
136
+ target: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::cancel_live_order`,
137
+ arguments: [
138
+ tx.object(pool.address),
139
+ tx.object(balanceManager.address),
140
+ tradeProof,
141
+ tx.pure.u128(orderId),
142
+ tx.object.clock()
143
+ ],
144
+ typeArguments: [baseCoin.type, quoteCoin.type]
145
+ });
146
+ };
147
+ this.cancelLiveOrders = (poolKey, balanceManagerKey, orderIds) => (tx) => {
148
+ tx.setGasBudgetIfNotSet(GAS_BUDGET);
149
+ const pool = this.#config.getPool(poolKey);
150
+ const balanceManager = this.#config.getBalanceManager(balanceManagerKey);
151
+ const baseCoin = this.#config.getCoin(pool.baseCoin);
152
+ const quoteCoin = this.#config.getCoin(pool.quoteCoin);
153
+ const tradeProof = tx.add(this.#config.balanceManager.generateProof(balanceManagerKey));
154
+ tx.moveCall({
155
+ target: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::cancel_live_orders`,
156
+ arguments: [
157
+ tx.object(pool.address),
158
+ tx.object(balanceManager.address),
159
+ tradeProof,
160
+ tx.pure.vector("u128", orderIds),
161
+ tx.object.clock()
162
+ ],
163
+ typeArguments: [baseCoin.type, quoteCoin.type]
164
+ });
165
+ };
128
166
  this.cancelAllOrders = (poolKey, balanceManagerKey) => (tx) => {
129
167
  tx.setGasBudgetIfNotSet(GAS_BUDGET);
130
168
  const pool = this.#config.getPool(poolKey);
@@ -1 +1 @@
1
- {"version":3,"file":"deepbook.mjs","names":["#config"],"sources":["../../src/transactions/deepbook.ts"],"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';\nimport { convertQuantity, convertPrice, convertRate } from '../utils/conversion.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 = convertPrice(price, FLOAT_SCALAR, quoteCoin.scalar, baseCoin.scalar);\n\t\tconst inputQuantity = convertQuantity(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 = convertQuantity(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 = convertQuantity(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 Withdraw settled amounts permissionlessly for a balance manager by ID\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} balanceManagerId The object ID of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawSettledAmountsManagerID =\n\t\t(poolKey: string, balanceManagerId: string) => (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::withdraw_settled_amounts_permissionless`,\n\t\t\t\targuments: [tx.object(pool.address), tx.object(balanceManagerId)],\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 = convertRate(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 (DeepBookPoolReferral)\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} referral The referral (DeepBookPoolReferral) to update\n\t * @param {number} multiplier The multiplier for the referral\n\t * @returns A function that takes a Transaction object\n\t */\n\tupdatePoolReferralMultiplier =\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 = convertRate(multiplier, FLOAT_SCALAR);\n\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::update_pool_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 (DeepBookPoolReferral)\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} referral The referral (DeepBookPoolReferral) to claim the rewards for\n\t * @returns A function that takes a Transaction object\n\t */\n\tclaimPoolReferralRewards = (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_pool_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 | bigint) => (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(convertQuantity(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 | bigint) => (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(convertQuantity(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 | bigint, quoteQuantity: number | bigint) =>\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 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(convertQuantity(baseQuantity, baseCoin.scalar)),\n\t\t\t\t\ttx.pure.u64(convertQuantity(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 | bigint, priceHigh: number | bigint, isBid: boolean) =>\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\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(convertPrice(priceLow, FLOAT_SCALAR, quoteCoin.scalar, baseCoin.scalar)),\n\t\t\t\t\ttx.pure.u64(convertPrice(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({\n\t\t\t\ttype: baseCoin.type,\n\t\t\t\tbalance: convertQuantity(baseAmount, baseCoin.scalar),\n\t\t\t});\n\n\t\tconst deepCoin =\n\t\t\tparams.deepCoin ??\n\t\t\tcoinWithBalance({ type: deepCoinType, balance: convertQuantity(deepAmount, DEEP_SCALAR) });\n\n\t\tconst minQuoteInput = convertQuantity(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: convertQuantity(quoteAmount, quoteCoin.scalar),\n\t\t\t});\n\n\t\tconst deepCoin =\n\t\t\tparams.deepCoin ??\n\t\t\tcoinWithBalance({ type: deepCoinType, balance: convertQuantity(deepAmount, DEEP_SCALAR) });\n\n\t\tconst minBaseInput = convertQuantity(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: convertQuantity(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: convertQuantity(amount, quoteCoinType.scalar),\n\t\t\t\t}));\n\n\t\tconst deepCoinInput =\n\t\t\tdeepCoin ??\n\t\t\tcoinWithBalance({ type: deepCoinType, balance: convertQuantity(deepAmount, DEEP_SCALAR) });\n\n\t\tconst minOutInput = convertQuantity(\n\t\t\tminOut,\n\t\t\tisBaseToCoin ? 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: convertQuantity(baseAmount, baseCoinType.scalar),\n\t\t\t});\n\t\tconst minQuoteInput = convertQuantity(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: convertQuantity(quoteAmount, quoteCoinType.scalar),\n\t\t\t});\n\t\tconst minBaseInput = convertQuantity(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: convertQuantity(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: convertQuantity(amount, quoteCoinType.scalar),\n\t\t\t\t\t}));\n\n\t\t\tconst minOutInput = convertQuantity(\n\t\t\t\tminOut,\n\t\t\t\tisBaseToCoin ? 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 = convertPrice(tickSize, FLOAT_SCALAR, quoteScalar, baseScalar);\n\t\tconst adjustedLotSize = convertQuantity(lotSize, baseScalar);\n\t\tconst adjustedMinSize = convertQuantity(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 (DeepBookPoolReferral)\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} referral The referral (DeepBookPoolReferral) to get the balances for\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetPoolReferralBalances = (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_pool_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 Get the multiplier for a referral (DeepBookPoolReferral)\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} referral The referral (DeepBookPoolReferral) to get the multiplier for\n\t * @returns A function that takes a Transaction object\n\t */\n\tpoolReferralMultiplier = (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::pool_referral_multiplier`,\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 =\n\t\t(poolKey: string, baseQuantity: number | bigint) => (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_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(convertQuantity(baseQuantity, baseCoin.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 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 =\n\t\t(poolKey: string, quoteQuantity: number | bigint) => (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_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(convertQuantity(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 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 | bigint, quoteQuantity: number | bigint) =>\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\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(convertQuantity(baseQuantity, baseCoin.scalar)),\n\t\t\t\t\ttx.pure.u64(convertQuantity(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 | bigint, payWithDeep: boolean) =>\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\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(convertQuantity(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 | bigint, payWithDeep: boolean) =>\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\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(convertQuantity(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 | bigint, price: number | bigint) =>\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 = convertPrice(price, FLOAT_SCALAR, quoteCoin.scalar, baseCoin.scalar);\n\t\t\tconst inputQuantity = convertQuantity(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 = convertPrice(price, FLOAT_SCALAR, quoteCoin.scalar, baseCoin.scalar);\n\t\tconst inputQuantity = convertQuantity(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 = convertQuantity(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 | bigint) => (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 = convertQuantity(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 | bigint, quantity: number | bigint, 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 = convertPrice(price, FLOAT_SCALAR, quoteCoin.scalar, baseCoin.scalar);\n\t\t\tconst inputQuantity = convertQuantity(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"],"mappings":";;;;;;;;;AA4BA,IAAa,mBAAb,MAA8B;CAC7B;;;;CAKA,YAAY,QAAwB;0BASjB,YAAmC,OAAoB;GACzE,MAAM,EACL,SACA,mBACA,eACA,OACA,UACA,OACA,aAAa,eACb,YAAY,UAAU,gBACtB,qBAAqB,oBAAoB,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UAAU,KAAK;IAC9C,CAAC;;AA1+CH,QAAKA,SAAU"}
1
+ {"version":3,"file":"deepbook.mjs","names":["#config"],"sources":["../../src/transactions/deepbook.ts"],"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';\nimport { convertQuantity, convertPrice, convertRate } from '../utils/conversion.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 = convertPrice(price, FLOAT_SCALAR, quoteCoin.scalar, baseCoin.scalar);\n\t\tconst inputQuantity = convertQuantity(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 = convertQuantity(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 = convertQuantity(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 an existing order, no-op if the order is not currently in the\n\t * balance manager's open orders (e.g. already filled, cancelled, expired-and-swept,\n\t * or not owned by this balance manager). Unlike `cancelOrder`, this will not abort\n\t * on unknown order ids.\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\tcancelLiveOrder =\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_live_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, skipping any order_id that is not currently in\n\t * the balance manager's open orders (e.g. already filled, cancelled, expired-and-swept,\n\t * or not owned by this balance manager). Duplicate ids in the input vector are handled\n\t * gracefully. Unlike `cancelOrders`, this will not abort on unknown order ids.\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\tcancelLiveOrders =\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_live_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 Withdraw settled amounts permissionlessly for a balance manager by ID\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} balanceManagerId The object ID of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawSettledAmountsManagerID =\n\t\t(poolKey: string, balanceManagerId: string) => (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::withdraw_settled_amounts_permissionless`,\n\t\t\t\targuments: [tx.object(pool.address), tx.object(balanceManagerId)],\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 = convertRate(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 (DeepBookPoolReferral)\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} referral The referral (DeepBookPoolReferral) to update\n\t * @param {number} multiplier The multiplier for the referral\n\t * @returns A function that takes a Transaction object\n\t */\n\tupdatePoolReferralMultiplier =\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 = convertRate(multiplier, FLOAT_SCALAR);\n\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::update_pool_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 (DeepBookPoolReferral)\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} referral The referral (DeepBookPoolReferral) to claim the rewards for\n\t * @returns A function that takes a Transaction object\n\t */\n\tclaimPoolReferralRewards = (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_pool_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 | bigint) => (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(convertQuantity(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 | bigint) => (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(convertQuantity(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 | bigint, quoteQuantity: number | bigint) =>\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 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(convertQuantity(baseQuantity, baseCoin.scalar)),\n\t\t\t\t\ttx.pure.u64(convertQuantity(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 | bigint, priceHigh: number | bigint, isBid: boolean) =>\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\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(convertPrice(priceLow, FLOAT_SCALAR, quoteCoin.scalar, baseCoin.scalar)),\n\t\t\t\t\ttx.pure.u64(convertPrice(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({\n\t\t\t\ttype: baseCoin.type,\n\t\t\t\tbalance: convertQuantity(baseAmount, baseCoin.scalar),\n\t\t\t});\n\n\t\tconst deepCoin =\n\t\t\tparams.deepCoin ??\n\t\t\tcoinWithBalance({ type: deepCoinType, balance: convertQuantity(deepAmount, DEEP_SCALAR) });\n\n\t\tconst minQuoteInput = convertQuantity(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: convertQuantity(quoteAmount, quoteCoin.scalar),\n\t\t\t});\n\n\t\tconst deepCoin =\n\t\t\tparams.deepCoin ??\n\t\t\tcoinWithBalance({ type: deepCoinType, balance: convertQuantity(deepAmount, DEEP_SCALAR) });\n\n\t\tconst minBaseInput = convertQuantity(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: convertQuantity(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: convertQuantity(amount, quoteCoinType.scalar),\n\t\t\t\t}));\n\n\t\tconst deepCoinInput =\n\t\t\tdeepCoin ??\n\t\t\tcoinWithBalance({ type: deepCoinType, balance: convertQuantity(deepAmount, DEEP_SCALAR) });\n\n\t\tconst minOutInput = convertQuantity(\n\t\t\tminOut,\n\t\t\tisBaseToCoin ? 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: convertQuantity(baseAmount, baseCoinType.scalar),\n\t\t\t});\n\t\tconst minQuoteInput = convertQuantity(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: convertQuantity(quoteAmount, quoteCoinType.scalar),\n\t\t\t});\n\t\tconst minBaseInput = convertQuantity(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: convertQuantity(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: convertQuantity(amount, quoteCoinType.scalar),\n\t\t\t\t\t}));\n\n\t\t\tconst minOutInput = convertQuantity(\n\t\t\t\tminOut,\n\t\t\t\tisBaseToCoin ? 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 = convertPrice(tickSize, FLOAT_SCALAR, quoteScalar, baseScalar);\n\t\tconst adjustedLotSize = convertQuantity(lotSize, baseScalar);\n\t\tconst adjustedMinSize = convertQuantity(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 (DeepBookPoolReferral)\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} referral The referral (DeepBookPoolReferral) to get the balances for\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetPoolReferralBalances = (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_pool_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 Get the multiplier for a referral (DeepBookPoolReferral)\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} referral The referral (DeepBookPoolReferral) to get the multiplier for\n\t * @returns A function that takes a Transaction object\n\t */\n\tpoolReferralMultiplier = (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::pool_referral_multiplier`,\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 =\n\t\t(poolKey: string, baseQuantity: number | bigint) => (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_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(convertQuantity(baseQuantity, baseCoin.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 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 =\n\t\t(poolKey: string, quoteQuantity: number | bigint) => (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_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(convertQuantity(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 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 | bigint, quoteQuantity: number | bigint) =>\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\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(convertQuantity(baseQuantity, baseCoin.scalar)),\n\t\t\t\t\ttx.pure.u64(convertQuantity(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 | bigint, payWithDeep: boolean) =>\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\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(convertQuantity(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 | bigint, payWithDeep: boolean) =>\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\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(convertQuantity(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 | bigint, price: number | bigint) =>\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 = convertPrice(price, FLOAT_SCALAR, quoteCoin.scalar, baseCoin.scalar);\n\t\t\tconst inputQuantity = convertQuantity(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 = convertPrice(price, FLOAT_SCALAR, quoteCoin.scalar, baseCoin.scalar);\n\t\tconst inputQuantity = convertQuantity(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 = convertQuantity(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 | bigint) => (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 = convertQuantity(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 | bigint, quantity: number | bigint, 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 = convertPrice(price, FLOAT_SCALAR, quoteCoin.scalar, baseCoin.scalar);\n\t\t\tconst inputQuantity = convertQuantity(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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,OAAO;AAEhE,UAAO,GAAG,SAAS;IAClB,QAAQ,GAAG,MAAKA,OAAQ,oBAAoB;IAC5C,WAAW;KACV,GAAG,OAAO,KAAK,QAAQ;KACvB,GAAG,KAAK,IAAI,WAAW;KACvB,GAAG,KAAK,IAAI,cAAc;KAC1B,GAAG,KAAK,IAAI,gBAAgB;KAC5B,GAAG,OAAO,OAAO;KACjB;IACD,eAAe,CAAC,SAAS,MAAM,UAAU,KAAK;IAC9C,CAAC;;AA1iDH,QAAKA,SAAU"}
@@ -1,5 +1,5 @@
1
1
  import { DeepBookConfig } from "../utils/config.mjs";
2
- import * as _mysten_sui_transactions105 from "@mysten/sui/transactions";
2
+ import * as _mysten_sui_transactions91 from "@mysten/sui/transactions";
3
3
  import { Transaction } from "@mysten/sui/transactions";
4
4
 
5
5
  //#region src/transactions/marginLiquidations.d.ts
@@ -35,7 +35,7 @@ declare class MarginLiquidationsContract {
35
35
  * @param {number} amount The amount to withdraw
36
36
  * @returns A function that takes a Transaction object and returns the withdrawn coin
37
37
  */
38
- withdraw: (vaultId: string, liquidationAdminCap: string, coinKey: string, amount: number) => (tx: Transaction) => _mysten_sui_transactions105.TransactionResult;
38
+ withdraw: (vaultId: string, liquidationAdminCap: string, coinKey: string, amount: number) => (tx: Transaction) => _mysten_sui_transactions91.TransactionResult;
39
39
  /**
40
40
  * @description Liquidate a margin manager by repaying base debt
41
41
  * @param {string} vaultId The liquidation vault object ID
@@ -60,7 +60,7 @@ declare class MarginLiquidationsContract {
60
60
  * @param {string} coinKey The key to identify the coin type
61
61
  * @returns A function that takes a Transaction object
62
62
  */
63
- balance: (vaultId: string, coinKey: string) => (tx: Transaction) => _mysten_sui_transactions105.TransactionResult;
63
+ balance: (vaultId: string, coinKey: string) => (tx: Transaction) => _mysten_sui_transactions91.TransactionResult;
64
64
  }
65
65
  //#endregion
66
66
  export { MarginLiquidationsContract };
@@ -1 +1 @@
1
- {"version":3,"file":"marginLiquidations.d.mts","names":[],"sources":["../../src/transactions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A,EAAI,WAAA;EADa;;;;;;;;EAuCnB,cAAA,GACE,OAAA,UAAiB,cAAA,UAAwB,OAAA,UAAiB,WAAA,eAC1D,EAAA,EAAI,WAAA;EADsD;;;;;;EAuC5D,OAAA,GAAW,OAAA,UAAiB,OAAA,cAAqB,EAAA,EAAI,WAAA,KAAW,0BAAA,CAAA,iBAAA;AAAA"}
@@ -1,5 +1,5 @@
1
1
  import { DeepBookConfig } from "../utils/config.mjs";
2
- import * as _mysten_sui_transactions91 from "@mysten/sui/transactions";
2
+ import * as _mysten_sui_transactions93 from "@mysten/sui/transactions";
3
3
  import { Transaction } from "@mysten/sui/transactions";
4
4
 
5
5
  //#region src/transactions/marginRegistry.d.ts
@@ -17,83 +17,83 @@ declare class MarginRegistryContract {
17
17
  * @param {string} poolKey The key to identify the pool
18
18
  * @returns A function that takes a Transaction object
19
19
  */
20
- poolEnabled: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions91.TransactionResult;
20
+ poolEnabled: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions93.TransactionResult;
21
21
  /**
22
22
  * @description Get the margin pool ID for a given asset
23
23
  * @param {string} coinKey The key to identify the coin
24
24
  * @returns A function that takes a Transaction object
25
25
  */
26
- getMarginPoolId: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions91.TransactionResult;
26
+ getMarginPoolId: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions93.TransactionResult;
27
27
  /**
28
28
  * @description Get the margin pool IDs (base and quote) for a deepbook pool
29
29
  * @param {string} poolKey The key to identify the pool
30
30
  * @returns A function that takes a Transaction object
31
31
  */
32
- getDeepbookPoolMarginPoolIds: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions91.TransactionResult;
32
+ getDeepbookPoolMarginPoolIds: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions93.TransactionResult;
33
33
  /**
34
34
  * @description Get the margin manager IDs for a given owner
35
35
  * @param {string} owner The owner address
36
36
  * @returns A function that takes a Transaction object
37
37
  */
38
- getMarginManagerIds: (owner: string) => (tx: Transaction) => _mysten_sui_transactions91.TransactionResult;
38
+ getMarginManagerIds: (owner: string) => (tx: Transaction) => _mysten_sui_transactions93.TransactionResult;
39
39
  /**
40
40
  * @description Get the base margin pool ID for a deepbook pool
41
41
  * @param {string} poolKey The key to identify the pool
42
42
  * @returns A function that takes a Transaction object
43
43
  */
44
- baseMarginPoolId: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions91.TransactionResult;
44
+ baseMarginPoolId: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions93.TransactionResult;
45
45
  /**
46
46
  * @description Get the quote margin pool ID for a deepbook pool
47
47
  * @param {string} poolKey The key to identify the pool
48
48
  * @returns A function that takes a Transaction object
49
49
  */
50
- quoteMarginPoolId: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions91.TransactionResult;
50
+ quoteMarginPoolId: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions93.TransactionResult;
51
51
  /**
52
52
  * @description Get the minimum withdraw risk ratio for a deepbook pool
53
53
  * @param {string} poolKey The key to identify the pool
54
54
  * @returns A function that takes a Transaction object
55
55
  */
56
- minWithdrawRiskRatio: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions91.TransactionResult;
56
+ minWithdrawRiskRatio: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions93.TransactionResult;
57
57
  /**
58
58
  * @description Get the minimum borrow risk ratio for a deepbook pool
59
59
  * @param {string} poolKey The key to identify the pool
60
60
  * @returns A function that takes a Transaction object
61
61
  */
62
- minBorrowRiskRatio: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions91.TransactionResult;
62
+ minBorrowRiskRatio: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions93.TransactionResult;
63
63
  /**
64
64
  * @description Get the liquidation risk ratio for a deepbook pool
65
65
  * @param {string} poolKey The key to identify the pool
66
66
  * @returns A function that takes a Transaction object
67
67
  */
68
- liquidationRiskRatio: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions91.TransactionResult;
68
+ liquidationRiskRatio: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions93.TransactionResult;
69
69
  /**
70
70
  * @description Get the target liquidation risk ratio for a deepbook pool
71
71
  * @param {string} poolKey The key to identify the pool
72
72
  * @returns A function that takes a Transaction object
73
73
  */
74
- targetLiquidationRiskRatio: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions91.TransactionResult;
74
+ targetLiquidationRiskRatio: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions93.TransactionResult;
75
75
  /**
76
76
  * @description Get the user liquidation reward for a deepbook pool
77
77
  * @param {string} poolKey The key to identify the pool
78
78
  * @returns A function that takes a Transaction object
79
79
  */
80
- userLiquidationReward: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions91.TransactionResult;
80
+ userLiquidationReward: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions93.TransactionResult;
81
81
  /**
82
82
  * @description Get the pool liquidation reward for a deepbook pool
83
83
  * @param {string} poolKey The key to identify the pool
84
84
  * @returns A function that takes a Transaction object
85
85
  */
86
- poolLiquidationReward: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions91.TransactionResult;
86
+ poolLiquidationReward: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions93.TransactionResult;
87
87
  /**
88
88
  * @description Get all allowed maintainer cap IDs
89
89
  * @returns A function that takes a Transaction object
90
90
  */
91
- allowedMaintainers: () => (tx: Transaction) => _mysten_sui_transactions91.TransactionResult;
91
+ allowedMaintainers: () => (tx: Transaction) => _mysten_sui_transactions93.TransactionResult;
92
92
  /**
93
93
  * @description Get all allowed pause cap IDs
94
94
  * @returns A function that takes a Transaction object
95
95
  */
96
- allowedPauseCaps: () => (tx: Transaction) => _mysten_sui_transactions91.TransactionResult;
96
+ allowedPauseCaps: () => (tx: Transaction) => _mysten_sui_transactions93.TransactionResult;
97
97
  }
98
98
  //#endregion
99
99
  export { MarginRegistryContract };
@@ -8,7 +8,7 @@ const testnetPackageIds = {
8
8
  LIQUIDATION_PACKAGE_ID: "0x8d69c3ef3ef580e5bf87b933ce28de19a5d0323588d1a44b9c60b4001741aa24"
9
9
  };
10
10
  const mainnetPackageIds = {
11
- DEEPBOOK_PACKAGE_ID: "0x337f4f4f6567fcd778d5454f27c16c70e2f274cc6377ea6249ddf491482ef497",
11
+ DEEPBOOK_PACKAGE_ID: "0xf48222c4e057fa468baf136bff8e12504209d43850c5778f76159292a96f621e",
12
12
  REGISTRY_ID: "0xaf16199a2dff736e9f07a845f23c5da6df6f756eddb631aed9d24a93efc4549d",
13
13
  DEEP_TREASURY_ID: "0x032abf8948dda67a271bcc18e776dbbcfb0d58c8d288a700ff0d5521e57a1ffe",
14
14
  MARGIN_PACKAGE_ID: "0xfbd322126f1452fd4c89aedbaeb9fd0c44df9b5cedbe70d76bf80dc086031377",
@@ -1 +1 @@
1
- {"version":3,"file":"constants.mjs","names":[],"sources":["../../src/utils/constants.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Coin, Pool, MarginPool } from '../types/index.js';\n\nexport type CoinMap = Record<string, Coin>;\nexport type PoolMap = Record<string, Pool>;\nexport type MarginPoolMap = Record<string, MarginPool>;\nexport interface DeepbookPackageIds {\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\tLIQUIDATION_PACKAGE_ID?: string;\n}\n\nexport const testnetPackageIds = {\n\tDEEPBOOK_PACKAGE_ID: '0x22be4cade64bf2d02412c7e8d0e8beea2f78828b948118d46735315409371a3c',\n\tREGISTRY_ID: '0x7c256edbda983a2cd6f946655f4bf3f00a41043993781f8674a7046e8c0e11d1',\n\tDEEP_TREASURY_ID: '0x69fffdae0075f8f71f4fa793549c11079266910e8905169845af1f5d00e09dcb',\n\tMARGIN_PACKAGE_ID: '0xd6a42f4df4db73d68cbeb52be66698d2fe6a9464f45ad113ca52b0c6ebd918b6',\n\tMARGIN_REGISTRY_ID: '0x48d7640dfae2c6e9ceeada197a7a1643984b5a24c55a0c6c023dac77e0339f75',\n\tLIQUIDATION_PACKAGE_ID: '0x8d69c3ef3ef580e5bf87b933ce28de19a5d0323588d1a44b9c60b4001741aa24',\n} satisfies DeepbookPackageIds;\n\nexport const mainnetPackageIds = {\n\tDEEPBOOK_PACKAGE_ID: '0x337f4f4f6567fcd778d5454f27c16c70e2f274cc6377ea6249ddf491482ef497',\n\tREGISTRY_ID: '0xaf16199a2dff736e9f07a845f23c5da6df6f756eddb631aed9d24a93efc4549d',\n\tDEEP_TREASURY_ID: '0x032abf8948dda67a271bcc18e776dbbcfb0d58c8d288a700ff0d5521e57a1ffe',\n\tMARGIN_PACKAGE_ID: '0xfbd322126f1452fd4c89aedbaeb9fd0c44df9b5cedbe70d76bf80dc086031377',\n\tMARGIN_REGISTRY_ID: '0x0e40998b359a9ccbab22a98ed21bd4346abf19158bc7980c8291908086b3a742',\n\tLIQUIDATION_PACKAGE_ID: '0x55718c06706bee34c9f3c39f662f10be354a4dcc719699ad72091dc343b641b8',\n} satisfies DeepbookPackageIds;\n\nexport const testnetCoins: CoinMap = {\n\tDEEP: {\n\t\taddress: `0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8`,\n\t\ttype: `0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8::deep::DEEP`,\n\t\tscalar: 1000000,\n\t\tfeed: '0x99137a18354efa7fb6840889d059fdb04c46a6ce21be97ab60d9ad93e91ac758', // DEEP uses HFT feed on testnet\n\t\tcurrencyId: '0xbf1b77e244f649c736a44898585cc8ac939fbb0bbdf1d8d2a183978cc312e613',\n\t\tpriceInfoObjectId: '0x3d52fffa2cd9e54b39bb36d282bdda560b15b8b4fdf4766a3c58499ef172bafc',\n\t},\n\tSUI: {\n\t\taddress: `0x0000000000000000000000000000000000000000000000000000000000000002`,\n\t\ttype: `0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI`,\n\t\tscalar: 1000000000,\n\t\tfeed: '0x50c67b3fd225db8912a424dd4baed60ffdde625ed2feaaf283724f9608fea266',\n\t\tcurrencyId: '0xf256d3fb6a50eaa748d94335b34f2982fbc3b63ceec78cafaa29ebc9ebaf2bbc',\n\t\tpriceInfoObjectId: '0x1ebb295c789cc42b3b2a1606482cd1c7124076a0f5676718501fda8c7fd075a0',\n\t},\n\tDBUSDC: {\n\t\taddress: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7`,\n\t\ttype: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDC::DBUSDC`,\n\t\tscalar: 1000000,\n\t\tfeed: '0x41f3625971ca2ed2263e78573fe5ce23e13d2558ed3f2e47ab0f84fb9e7ae722',\n\t\tcurrencyId: '0x509db0f9283c9ee4fdc5b99028a439d3639f49e9709e3d7a6de14b3bfdb0c784',\n\t\tpriceInfoObjectId: '0x9c4dd4008297ffa5e480684b8100ec21cc934405ed9a25d4e4d7b6259aad9c81',\n\t},\n\tDBTC: {\n\t\taddress: `0x6502dae813dbe5e42643c119a6450a518481f03063febc7e20238e43b6ea9e86`,\n\t\ttype: `0x6502dae813dbe5e42643c119a6450a518481f03063febc7e20238e43b6ea9e86::dbtc::DBTC`,\n\t\tscalar: 100000000,\n\t\tfeed: '0xf9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b',\n\t\tcurrencyId: '0x3ef2afa2126704bf721b9c8495d94288f6bd090fc454fe3e1613eb765a8a348f',\n\t\tpriceInfoObjectId: '0x72431a238277695d3f31e4425225a4462674ee6cceeea9d66447b210755fffba',\n\t},\n\tDBUSDT: {\n\t\taddress: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7`,\n\t\ttype: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDT::DBUSDT`,\n\t\tscalar: 1000000,\n\t},\n\tWAL: {\n\t\taddress: `0x9ef7676a9f81937a52ae4b2af8d511a28a0b080477c0c2db40b0ab8882240d76`,\n\t\ttype: `0x9ef7676a9f81937a52ae4b2af8d511a28a0b080477c0c2db40b0ab8882240d76::wal::WAL`,\n\t\tscalar: 1000000000,\n\t},\n};\n\nexport const mainnetCoins: CoinMap = {\n\tDEEP: {\n\t\taddress: `0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270`,\n\t\ttype: `0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP`,\n\t\tscalar: 1000000,\n\t\tfeed: '0x29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff',\n\t\tcurrencyId: '0x3f2afb7c5f245870a8b8a3808e6dd7042446a0e7504e9d2795372da053858cd9',\n\t\tpriceInfoObjectId: '0x8c7f3a322b94cc69db2a2ac575cbd94bf5766113324c3a3eceac91e3e88a51ed',\n\t},\n\tSUI: {\n\t\taddress: `0x0000000000000000000000000000000000000000000000000000000000000002`,\n\t\ttype: `0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI`,\n\t\tscalar: 1000000000,\n\t\tfeed: '0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',\n\t\tcurrencyId: '0xf256d3fb6a50eaa748d94335b34f2982fbc3b63ceec78cafaa29ebc9ebaf2bbc',\n\t\tpriceInfoObjectId: '0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37',\n\t},\n\tUSDC: {\n\t\taddress: `0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7`,\n\t\ttype: `0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC`,\n\t\tscalar: 1000000,\n\t\tfeed: '0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a',\n\t\tcurrencyId: '0x75cfbbf8c962d542e99a1d15731e6069f60a00db895407785b15d14f606f2b4a',\n\t\tpriceInfoObjectId: '0x5dec622733a204ca27f5a90d8c2fad453cc6665186fd5dff13a83d0b6c9027ab',\n\t},\n\tWAL: {\n\t\taddress: `0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59`,\n\t\ttype: `0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL`,\n\t\tscalar: 1000000000,\n\t\tfeed: '0xeba0732395fae9dec4bae12e52760b35fc1c5671e2da8b449c9af4efe5d54341',\n\t\tcurrencyId: '0xb6a0c0bacb1c87c3be4dff20c22ef1012125b5724b5b0ff424f852a2651b23fa',\n\t\tpriceInfoObjectId: '0xeb7e669f74d976c0b99b6ef9801e3a77716a95f1a15754e0f1399ce3fb60973d',\n\t},\n\tSUIUSDE: {\n\t\taddress: `0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402`,\n\t\ttype: `0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402::sui_usde::SUI_USDE`,\n\t\tscalar: 1000000,\n\t\tfeed: '0x8cead549d0e770dea8fdf5e018a85d59585265cf8bff16ba83962fc7996dbb7f',\n\t\tcurrencyId: '0x44f0959110bd9e5e91af0483364c42075ac19f173b28f708989f419ef3560576',\n\t\tpriceInfoObjectId: '0x9b2028bfc829127d2e5ead1691dc3002de9e9b8d8076b4915e5ecc7d9b99d63f',\n\t},\n\tXBTC: {\n\t\taddress: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50`,\n\t\ttype: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50::xbtc::XBTC`,\n\t\tscalar: 100000000,\n\t\tfeed: '0xae8f269ed9c4bed616c99a98cf6dfe562bd3202e7f91821a471ff854713851b4',\n\t\tcurrencyId: '0x907bb173bffab7c57bbd3350a633aa32c8770937b496d7d88874087b59200bcc',\n\t\tpriceInfoObjectId: '0xa4b9db1866ee6e2a156e8c36fc66be0f68f232388ebb578c949c2c6beb50128b',\n\t},\n\tUSDSUI: {\n\t\taddress: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1`,\n\t\ttype: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1::usdsui::USDSUI`,\n\t\tscalar: 1000000,\n\t\tfeed: '0xd510fcdb3a63f35d3bb118d5db3afc5815a3f13bc55d48abb893b63f0315902a',\n\t\tcurrencyId: '0x535e826a2acddab687c81cb6c6166553b479f61a9023800ec0020baba8d94731',\n\t\tpriceInfoObjectId: '0x68644a3ab7a1aab113a4a68b6115a5b51eba4cb6aaac2d99b734be2e5e748425',\n\t},\n\tWUSDC: {\n\t\taddress: `0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf`,\n\t\ttype: `0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN`,\n\t\tscalar: 1000000,\n\t},\n\tWETH: {\n\t\taddress: `0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5`,\n\t\ttype: `0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN`,\n\t\tscalar: 100000000,\n\t},\n\tBETH: {\n\t\taddress: `0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29`,\n\t\ttype: `0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29::eth::ETH`,\n\t\tscalar: 100000000,\n\t},\n\tWBTC: {\n\t\taddress: `0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881`,\n\t\ttype: `0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881::coin::COIN`,\n\t\tscalar: 100000000,\n\t},\n\tWUSDT: {\n\t\taddress: `0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c`,\n\t\ttype: `0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN`,\n\t\tscalar: 1000000,\n\t},\n\tNS: {\n\t\taddress: `0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178`,\n\t\ttype: `0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178::ns::NS`,\n\t\tscalar: 1000000,\n\t},\n\tTYPUS: {\n\t\taddress: `0xf82dc05634970553615eef6112a1ac4fb7bf10272bf6cbe0f80ef44a6c489385`,\n\t\ttype: `0xf82dc05634970553615eef6112a1ac4fb7bf10272bf6cbe0f80ef44a6c489385::typus::TYPUS`,\n\t\tscalar: 1000000000,\n\t},\n\tAUSD: {\n\t\taddress: `0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2`,\n\t\ttype: `0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2::ausd::AUSD`,\n\t\tscalar: 1000000,\n\t},\n\tDRF: {\n\t\taddress: `0x294de7579d55c110a00a7c4946e09a1b5cbeca2592fbb83fd7bfacba3cfeaf0e`,\n\t\ttype: `0x294de7579d55c110a00a7c4946e09a1b5cbeca2592fbb83fd7bfacba3cfeaf0e::drf::DRF`,\n\t\tscalar: 1000000,\n\t},\n\tSEND: {\n\t\taddress: `0xb45fcfcc2cc07ce0702cc2d229621e046c906ef14d9b25e8e4d25f6e8763fef7`,\n\t\ttype: `0xb45fcfcc2cc07ce0702cc2d229621e046c906ef14d9b25e8e4d25f6e8763fef7::send::SEND`,\n\t\tscalar: 1000000,\n\t},\n\tIKA: {\n\t\taddress: `0x7262fb2f7a3a14c888c438a3cd9b912469a58cf60f367352c46584262e8299aa`,\n\t\ttype: `0x7262fb2f7a3a14c888c438a3cd9b912469a58cf60f367352c46584262e8299aa::ika::IKA`,\n\t\tscalar: 1000000000,\n\t},\n\tALKIMI: {\n\t\taddress: `0x1a8f4bc33f8ef7fbc851f156857aa65d397a6a6fd27a7ac2ca717b51f2fd9489`,\n\t\ttype: `0x1a8f4bc33f8ef7fbc851f156857aa65d397a6a6fd27a7ac2ca717b51f2fd9489::alkimi::ALKIMI`,\n\t\tscalar: 1000000000,\n\t},\n\tLZWBTC: {\n\t\taddress: `0x0041f9f9344cac094454cd574e333c4fdb132d7bcc9379bcd4aab485b2a63942`,\n\t\ttype: `0x0041f9f9344cac094454cd574e333c4fdb132d7bcc9379bcd4aab485b2a63942::wbtc::WBTC`,\n\t\tscalar: 100000000,\n\t},\n\tUSDT: {\n\t\taddress: `0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068`,\n\t\ttype: `0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068::usdt::USDT`,\n\t\tscalar: 1000000,\n\t},\n};\n\nexport const testnetPools: PoolMap = {\n\tDEEP_SUI: {\n\t\taddress: `0x48c95963e9eac37a316b7ae04a0deb761bcdcc2b67912374d6036e7f0e9bae9f`,\n\t\tbaseCoin: 'DEEP',\n\t\tquoteCoin: 'SUI',\n\t},\n\tSUI_DBUSDC: {\n\t\taddress: `0x1c19362ca52b8ffd7a33cee805a67d40f31e6ba303753fd3a4cfdfacea7163a5`,\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n\tDEEP_DBUSDC: {\n\t\taddress: `0xe86b991f8632217505fd859445f9803967ac84a9d4a1219065bf191fcb74b622`,\n\t\tbaseCoin: 'DEEP',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n\tDBUSDT_DBUSDC: {\n\t\taddress: `0x83970bb02e3636efdff8c141ab06af5e3c9a22e2f74d7f02a9c3430d0d10c1ca`,\n\t\tbaseCoin: 'DBUSDT',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n\tWAL_DBUSDC: {\n\t\taddress: `0xeb524b6aea0ec4b494878582e0b78924208339d360b62aec4a8ecd4031520dbb`,\n\t\tbaseCoin: 'WAL',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n\tWAL_SUI: {\n\t\taddress: `0x8c1c1b186c4fddab1ebd53e0895a36c1d1b3b9a77cd34e607bef49a38af0150a`,\n\t\tbaseCoin: 'WAL',\n\t\tquoteCoin: 'SUI',\n\t},\n\tDBTC_DBUSDC: {\n\t\taddress: `0x0dce0aa771074eb83d1f4a29d48be8248d4d2190976a5241f66b43ec18fa34de`,\n\t\tbaseCoin: 'DBTC',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n};\n\nexport const mainnetPools: PoolMap = {\n\tDEEP_SUI: {\n\t\taddress: `0xb663828d6217467c8a1838a03793da896cbe745b150ebd57d82f814ca579fc22`,\n\t\tbaseCoin: 'DEEP',\n\t\tquoteCoin: 'SUI',\n\t},\n\tSUI_USDC: {\n\t\taddress: `0xe05dafb5133bcffb8d59f4e12465dc0e9faeaa05e3e342a08fe135800e3e4407`,\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'USDC',\n\t},\n\tDEEP_USDC: {\n\t\taddress: `0xf948981b806057580f91622417534f491da5f61aeaf33d0ed8e69fd5691c95ce`,\n\t\tbaseCoin: 'DEEP',\n\t\tquoteCoin: 'USDC',\n\t},\n\tWUSDT_USDC: {\n\t\taddress: `0x4e2ca3988246e1d50b9bf209abb9c1cbfec65bd95afdacc620a36c67bdb8452f`,\n\t\tbaseCoin: 'WUSDT',\n\t\tquoteCoin: 'USDC',\n\t},\n\tWUSDC_USDC: {\n\t\taddress: `0xa0b9ebefb38c963fd115f52d71fa64501b79d1adcb5270563f92ce0442376545`,\n\t\tbaseCoin: 'WUSDC',\n\t\tquoteCoin: 'USDC',\n\t},\n\tBETH_USDC: {\n\t\taddress: `0x1109352b9112717bd2a7c3eb9a416fff1ba6951760f5bdd5424cf5e4e5b3e65c`,\n\t\tbaseCoin: 'BETH',\n\t\tquoteCoin: 'USDC',\n\t},\n\tNS_USDC: {\n\t\taddress: `0x0c0fdd4008740d81a8a7d4281322aee71a1b62c449eb5b142656753d89ebc060`,\n\t\tbaseCoin: 'NS',\n\t\tquoteCoin: 'USDC',\n\t},\n\tNS_SUI: {\n\t\taddress: `0x27c4fdb3b846aa3ae4a65ef5127a309aa3c1f466671471a806d8912a18b253e8`,\n\t\tbaseCoin: 'NS',\n\t\tquoteCoin: 'SUI',\n\t},\n\tTYPUS_SUI: {\n\t\taddress: `0xe8e56f377ab5a261449b92ac42c8ddaacd5671e9fec2179d7933dd1a91200eec`,\n\t\tbaseCoin: 'TYPUS',\n\t\tquoteCoin: 'SUI',\n\t},\n\tSUI_AUSD: {\n\t\taddress: `0x183df694ebc852a5f90a959f0f563b82ac9691e42357e9a9fe961d71a1b809c8`,\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'AUSD',\n\t},\n\tAUSD_USDC: {\n\t\taddress: `0x5661fc7f88fbeb8cb881150a810758cf13700bb4e1f31274a244581b37c303c3`,\n\t\tbaseCoin: 'AUSD',\n\t\tquoteCoin: 'USDC',\n\t},\n\tDRF_SUI: {\n\t\taddress: `0x126865a0197d6ab44bfd15fd052da6db92fd2eb831ff9663451bbfa1219e2af2`,\n\t\tbaseCoin: 'DRF',\n\t\tquoteCoin: 'SUI',\n\t},\n\tSEND_USDC: {\n\t\taddress: `0x1fe7b99c28ded39774f37327b509d58e2be7fff94899c06d22b407496a6fa990`,\n\t\tbaseCoin: 'SEND',\n\t\tquoteCoin: 'USDC',\n\t},\n\tWAL_USDC: {\n\t\taddress: `0x56a1c985c1f1123181d6b881714793689321ba24301b3585eec427436eb1c76d`,\n\t\tbaseCoin: 'WAL',\n\t\tquoteCoin: 'USDC',\n\t},\n\tWAL_SUI: {\n\t\taddress: `0x81f5339934c83ea19dd6bcc75c52e83509629a5f71d3257428c2ce47cc94d08b`,\n\t\tbaseCoin: 'WAL',\n\t\tquoteCoin: 'SUI',\n\t},\n\tXBTC_USDC: {\n\t\taddress: `0x20b9a3ec7a02d4f344aa1ebc5774b7b0ccafa9a5d76230662fdc0300bb215307`,\n\t\tbaseCoin: 'XBTC',\n\t\tquoteCoin: 'USDC',\n\t},\n\tIKA_USDC: {\n\t\taddress: `0xfa732993af2b60d04d7049511f801e79426b2b6a5103e22769c0cead982b0f47`,\n\t\tbaseCoin: 'IKA',\n\t\tquoteCoin: 'USDC',\n\t},\n\tALKIMI_SUI: {\n\t\taddress: `0x84752993c6dc6fce70e25ddeb4daddb6592d6b9b0912a0a91c07cfff5a721d89`,\n\t\tbaseCoin: 'ALKIMI',\n\t\tquoteCoin: 'SUI',\n\t},\n\tLZWBTC_USDC: {\n\t\taddress: `0xf5142aafa24866107df628bf92d0358c7da6acc46c2f10951690fd2b8570f117`,\n\t\tbaseCoin: 'LZWBTC',\n\t\tquoteCoin: 'USDC',\n\t},\n\tUSDT_USDC: {\n\t\taddress: '0xfc28a2fb22579c16d672a1152039cbf671e5f4b9f103feddff4ea06ef3c2bc25',\n\t\tbaseCoin: 'USDT',\n\t\tquoteCoin: 'USDC',\n\t},\n\tSUIUSDE_USDC: {\n\t\taddress: '0x0fac1cebf35bde899cd9ecdd4371e0e33f44ba83b8a2902d69186646afa3a94b',\n\t\tbaseCoin: 'SUIUSDE',\n\t\tquoteCoin: 'USDC',\n\t},\n\tSUI_SUIUSDE: {\n\t\taddress: '0x034f3a42e7348de2084406db7a725f9d9d132a56c68324713e6e623601fb4fd7',\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'SUIUSDE',\n\t},\n\tSUI_USDSUI: {\n\t\taddress: '0x826eeacb2799726334aa580396338891205a41cf9344655e526aae6ddd5dc03f',\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'USDSUI',\n\t},\n\tUSDSUI_USDC: {\n\t\taddress: '0xa374264d43e6baa5aa8b35ff18ff24fdba7443b4bcb884cb4c2f568d32cdac36',\n\t\tbaseCoin: 'USDSUI',\n\t\tquoteCoin: 'USDC',\n\t},\n};\n\nexport const testnetMarginPools = {\n\tSUI: {\n\t\taddress: '0xcdbbe6a72e639b647296788e2e4b1cac5cea4246028ba388ba1332ff9a382eea',\n\t\ttype: '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI',\n\t},\n\tDBUSDC: {\n\t\taddress: '0xf08568da93834e1ee04f09902ac7b1e78d3fdf113ab4d2106c7265e95318b14d',\n\t\ttype: '0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDC::DBUSDC',\n\t},\n\tDEEP: {\n\t\taddress: '0x610640613f21d9e688d6f8103d17df22315c32e0c80590ce64951a1991378b55',\n\t\ttype: '0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8::deep::DEEP',\n\t},\n\tDBTC: {\n\t\taddress: '0xf3440b4aafcc8b12fc4b242e9590c52873b8238a0d0e52fbf9dae61d2970796a',\n\t\ttype: '0x6502dae813dbe5e42643c119a6450a518481f03063febc7e20238e43b6ea9e86::dbtc::DBTC',\n\t},\n};\n\nexport const mainnetMarginPools = {\n\tSUI: {\n\t\taddress: '0x53041c6f86c4782aabbfc1d4fe234a6d37160310c7ee740c915f0a01b7127344',\n\t\ttype: '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI',\n\t},\n\tUSDC: {\n\t\taddress: '0xba473d9ae278f10af75c50a8fa341e9c6a1c087dc91a3f23e8048baf67d0754f',\n\t\ttype: '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC',\n\t},\n\tDEEP: {\n\t\taddress: '0x1d723c5cd113296868b55208f2ab5a905184950dd59c48eb7345607d6b5e6af7',\n\t\ttype: '0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP',\n\t},\n\tWAL: {\n\t\taddress: '0x38decd3dbb62bd4723144349bf57bc403b393aee86a51596846a824a1e0c2c01',\n\t\ttype: '0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL',\n\t},\n\tSUIUSDE: {\n\t\taddress: '0xbb990ca04a7743e6c0a25a7fb16f60fc6f6d8bf213624ff03a63f1bb04c3a12f',\n\t\ttype: '0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402::sui_usde::SUI_USDE',\n\t},\n\tXBTC: {\n\t\taddress: '0x14dfbf54400e0b97e892349310d392bef6d187c2b6709d9b246b8f41c9a13de4',\n\t\ttype: '0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50::xbtc::XBTC',\n\t},\n\tUSDSUI: {\n\t\taddress: '0x78a0ddd02745d9b500fb7e9aae2ff8b665d974f00fd1f6060d59f4a8e891402c',\n\t\ttype: '0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1::usdsui::USDSUI',\n\t},\n};\n\nexport const testnetPythConfigs = {\n\tpythStateId: '0x243759059f4c3111179da5878c12f68d612c21a8d54d85edc86164bb18be1c7c',\n\twormholeStateId: '0x31358d198147da50db32eda2562951d53973a0c0ad5ed738e9b17d88b213d790',\n};\n\nexport const mainnetPythConfigs = {\n\tpythStateId: '0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8',\n\twormholeStateId: '0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c',\n};\n"],"mappings":";AAiBA,MAAa,oBAAoB;CAChC,qBAAqB;CACrB,aAAa;CACb,kBAAkB;CAClB,mBAAmB;CACnB,oBAAoB;CACpB,wBAAwB;CACxB;AAED,MAAa,oBAAoB;CAChC,qBAAqB;CACrB,aAAa;CACb,kBAAkB;CAClB,mBAAmB;CACnB,oBAAoB;CACpB,wBAAwB;CACxB;AAED,MAAa,eAAwB;CACpC,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,KAA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ACR;CACD,IAAI;EACH,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,OAAO;EACN,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD;AAED,MAAa,eAAwB;CACpC,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,eAAe;EACd,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,SAAS;EACR,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD;AAED,MAAa,eAAwB;CACpC,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,SAAS;EACR,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,QAAQ;EACP,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,SAAS;EACR,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,SAAS;EACR,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,cAAc;EACb,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD;AAED,MAAa,qBAAqB;CACjC,KAAK;EACJ,SAAS;EACT,MAAM;EACN;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD;AAED,MAAa,qBAAqB;CACjC,KAAK;EACJ,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN;CACD,SAAS;EACR,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN;CACD;AAED,MAAa,qBAAqB;CACjC,aAAa;CACb,iBAAiB;CACjB;AAED,MAAa,qBAAqB;CACjC,aAAa;CACb,iBAAiB;CACjB"}
1
+ {"version":3,"file":"constants.mjs","names":[],"sources":["../../src/utils/constants.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Coin, Pool, MarginPool } from '../types/index.js';\n\nexport type CoinMap = Record<string, Coin>;\nexport type PoolMap = Record<string, Pool>;\nexport type MarginPoolMap = Record<string, MarginPool>;\nexport interface DeepbookPackageIds {\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\tLIQUIDATION_PACKAGE_ID?: string;\n}\n\nexport const testnetPackageIds = {\n\tDEEPBOOK_PACKAGE_ID: '0x22be4cade64bf2d02412c7e8d0e8beea2f78828b948118d46735315409371a3c',\n\tREGISTRY_ID: '0x7c256edbda983a2cd6f946655f4bf3f00a41043993781f8674a7046e8c0e11d1',\n\tDEEP_TREASURY_ID: '0x69fffdae0075f8f71f4fa793549c11079266910e8905169845af1f5d00e09dcb',\n\tMARGIN_PACKAGE_ID: '0xd6a42f4df4db73d68cbeb52be66698d2fe6a9464f45ad113ca52b0c6ebd918b6',\n\tMARGIN_REGISTRY_ID: '0x48d7640dfae2c6e9ceeada197a7a1643984b5a24c55a0c6c023dac77e0339f75',\n\tLIQUIDATION_PACKAGE_ID: '0x8d69c3ef3ef580e5bf87b933ce28de19a5d0323588d1a44b9c60b4001741aa24',\n} satisfies DeepbookPackageIds;\n\nexport const mainnetPackageIds = {\n\tDEEPBOOK_PACKAGE_ID: '0xf48222c4e057fa468baf136bff8e12504209d43850c5778f76159292a96f621e',\n\tREGISTRY_ID: '0xaf16199a2dff736e9f07a845f23c5da6df6f756eddb631aed9d24a93efc4549d',\n\tDEEP_TREASURY_ID: '0x032abf8948dda67a271bcc18e776dbbcfb0d58c8d288a700ff0d5521e57a1ffe',\n\tMARGIN_PACKAGE_ID: '0xfbd322126f1452fd4c89aedbaeb9fd0c44df9b5cedbe70d76bf80dc086031377',\n\tMARGIN_REGISTRY_ID: '0x0e40998b359a9ccbab22a98ed21bd4346abf19158bc7980c8291908086b3a742',\n\tLIQUIDATION_PACKAGE_ID: '0x55718c06706bee34c9f3c39f662f10be354a4dcc719699ad72091dc343b641b8',\n} satisfies DeepbookPackageIds;\n\nexport const testnetCoins: CoinMap = {\n\tDEEP: {\n\t\taddress: `0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8`,\n\t\ttype: `0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8::deep::DEEP`,\n\t\tscalar: 1000000,\n\t\tfeed: '0x99137a18354efa7fb6840889d059fdb04c46a6ce21be97ab60d9ad93e91ac758', // DEEP uses HFT feed on testnet\n\t\tcurrencyId: '0xbf1b77e244f649c736a44898585cc8ac939fbb0bbdf1d8d2a183978cc312e613',\n\t\tpriceInfoObjectId: '0x3d52fffa2cd9e54b39bb36d282bdda560b15b8b4fdf4766a3c58499ef172bafc',\n\t},\n\tSUI: {\n\t\taddress: `0x0000000000000000000000000000000000000000000000000000000000000002`,\n\t\ttype: `0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI`,\n\t\tscalar: 1000000000,\n\t\tfeed: '0x50c67b3fd225db8912a424dd4baed60ffdde625ed2feaaf283724f9608fea266',\n\t\tcurrencyId: '0xf256d3fb6a50eaa748d94335b34f2982fbc3b63ceec78cafaa29ebc9ebaf2bbc',\n\t\tpriceInfoObjectId: '0x1ebb295c789cc42b3b2a1606482cd1c7124076a0f5676718501fda8c7fd075a0',\n\t},\n\tDBUSDC: {\n\t\taddress: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7`,\n\t\ttype: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDC::DBUSDC`,\n\t\tscalar: 1000000,\n\t\tfeed: '0x41f3625971ca2ed2263e78573fe5ce23e13d2558ed3f2e47ab0f84fb9e7ae722',\n\t\tcurrencyId: '0x509db0f9283c9ee4fdc5b99028a439d3639f49e9709e3d7a6de14b3bfdb0c784',\n\t\tpriceInfoObjectId: '0x9c4dd4008297ffa5e480684b8100ec21cc934405ed9a25d4e4d7b6259aad9c81',\n\t},\n\tDBTC: {\n\t\taddress: `0x6502dae813dbe5e42643c119a6450a518481f03063febc7e20238e43b6ea9e86`,\n\t\ttype: `0x6502dae813dbe5e42643c119a6450a518481f03063febc7e20238e43b6ea9e86::dbtc::DBTC`,\n\t\tscalar: 100000000,\n\t\tfeed: '0xf9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b',\n\t\tcurrencyId: '0x3ef2afa2126704bf721b9c8495d94288f6bd090fc454fe3e1613eb765a8a348f',\n\t\tpriceInfoObjectId: '0x72431a238277695d3f31e4425225a4462674ee6cceeea9d66447b210755fffba',\n\t},\n\tDBUSDT: {\n\t\taddress: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7`,\n\t\ttype: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDT::DBUSDT`,\n\t\tscalar: 1000000,\n\t},\n\tWAL: {\n\t\taddress: `0x9ef7676a9f81937a52ae4b2af8d511a28a0b080477c0c2db40b0ab8882240d76`,\n\t\ttype: `0x9ef7676a9f81937a52ae4b2af8d511a28a0b080477c0c2db40b0ab8882240d76::wal::WAL`,\n\t\tscalar: 1000000000,\n\t},\n};\n\nexport const mainnetCoins: CoinMap = {\n\tDEEP: {\n\t\taddress: `0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270`,\n\t\ttype: `0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP`,\n\t\tscalar: 1000000,\n\t\tfeed: '0x29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff',\n\t\tcurrencyId: '0x3f2afb7c5f245870a8b8a3808e6dd7042446a0e7504e9d2795372da053858cd9',\n\t\tpriceInfoObjectId: '0x8c7f3a322b94cc69db2a2ac575cbd94bf5766113324c3a3eceac91e3e88a51ed',\n\t},\n\tSUI: {\n\t\taddress: `0x0000000000000000000000000000000000000000000000000000000000000002`,\n\t\ttype: `0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI`,\n\t\tscalar: 1000000000,\n\t\tfeed: '0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',\n\t\tcurrencyId: '0xf256d3fb6a50eaa748d94335b34f2982fbc3b63ceec78cafaa29ebc9ebaf2bbc',\n\t\tpriceInfoObjectId: '0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37',\n\t},\n\tUSDC: {\n\t\taddress: `0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7`,\n\t\ttype: `0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC`,\n\t\tscalar: 1000000,\n\t\tfeed: '0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a',\n\t\tcurrencyId: '0x75cfbbf8c962d542e99a1d15731e6069f60a00db895407785b15d14f606f2b4a',\n\t\tpriceInfoObjectId: '0x5dec622733a204ca27f5a90d8c2fad453cc6665186fd5dff13a83d0b6c9027ab',\n\t},\n\tWAL: {\n\t\taddress: `0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59`,\n\t\ttype: `0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL`,\n\t\tscalar: 1000000000,\n\t\tfeed: '0xeba0732395fae9dec4bae12e52760b35fc1c5671e2da8b449c9af4efe5d54341',\n\t\tcurrencyId: '0xb6a0c0bacb1c87c3be4dff20c22ef1012125b5724b5b0ff424f852a2651b23fa',\n\t\tpriceInfoObjectId: '0xeb7e669f74d976c0b99b6ef9801e3a77716a95f1a15754e0f1399ce3fb60973d',\n\t},\n\tSUIUSDE: {\n\t\taddress: `0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402`,\n\t\ttype: `0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402::sui_usde::SUI_USDE`,\n\t\tscalar: 1000000,\n\t\tfeed: '0x8cead549d0e770dea8fdf5e018a85d59585265cf8bff16ba83962fc7996dbb7f',\n\t\tcurrencyId: '0x44f0959110bd9e5e91af0483364c42075ac19f173b28f708989f419ef3560576',\n\t\tpriceInfoObjectId: '0x9b2028bfc829127d2e5ead1691dc3002de9e9b8d8076b4915e5ecc7d9b99d63f',\n\t},\n\tXBTC: {\n\t\taddress: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50`,\n\t\ttype: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50::xbtc::XBTC`,\n\t\tscalar: 100000000,\n\t\tfeed: '0xae8f269ed9c4bed616c99a98cf6dfe562bd3202e7f91821a471ff854713851b4',\n\t\tcurrencyId: '0x907bb173bffab7c57bbd3350a633aa32c8770937b496d7d88874087b59200bcc',\n\t\tpriceInfoObjectId: '0xa4b9db1866ee6e2a156e8c36fc66be0f68f232388ebb578c949c2c6beb50128b',\n\t},\n\tUSDSUI: {\n\t\taddress: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1`,\n\t\ttype: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1::usdsui::USDSUI`,\n\t\tscalar: 1000000,\n\t\tfeed: '0xd510fcdb3a63f35d3bb118d5db3afc5815a3f13bc55d48abb893b63f0315902a',\n\t\tcurrencyId: '0x535e826a2acddab687c81cb6c6166553b479f61a9023800ec0020baba8d94731',\n\t\tpriceInfoObjectId: '0x68644a3ab7a1aab113a4a68b6115a5b51eba4cb6aaac2d99b734be2e5e748425',\n\t},\n\tWUSDC: {\n\t\taddress: `0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf`,\n\t\ttype: `0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN`,\n\t\tscalar: 1000000,\n\t},\n\tWETH: {\n\t\taddress: `0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5`,\n\t\ttype: `0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN`,\n\t\tscalar: 100000000,\n\t},\n\tBETH: {\n\t\taddress: `0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29`,\n\t\ttype: `0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29::eth::ETH`,\n\t\tscalar: 100000000,\n\t},\n\tWBTC: {\n\t\taddress: `0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881`,\n\t\ttype: `0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881::coin::COIN`,\n\t\tscalar: 100000000,\n\t},\n\tWUSDT: {\n\t\taddress: `0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c`,\n\t\ttype: `0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN`,\n\t\tscalar: 1000000,\n\t},\n\tNS: {\n\t\taddress: `0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178`,\n\t\ttype: `0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178::ns::NS`,\n\t\tscalar: 1000000,\n\t},\n\tTYPUS: {\n\t\taddress: `0xf82dc05634970553615eef6112a1ac4fb7bf10272bf6cbe0f80ef44a6c489385`,\n\t\ttype: `0xf82dc05634970553615eef6112a1ac4fb7bf10272bf6cbe0f80ef44a6c489385::typus::TYPUS`,\n\t\tscalar: 1000000000,\n\t},\n\tAUSD: {\n\t\taddress: `0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2`,\n\t\ttype: `0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2::ausd::AUSD`,\n\t\tscalar: 1000000,\n\t},\n\tDRF: {\n\t\taddress: `0x294de7579d55c110a00a7c4946e09a1b5cbeca2592fbb83fd7bfacba3cfeaf0e`,\n\t\ttype: `0x294de7579d55c110a00a7c4946e09a1b5cbeca2592fbb83fd7bfacba3cfeaf0e::drf::DRF`,\n\t\tscalar: 1000000,\n\t},\n\tSEND: {\n\t\taddress: `0xb45fcfcc2cc07ce0702cc2d229621e046c906ef14d9b25e8e4d25f6e8763fef7`,\n\t\ttype: `0xb45fcfcc2cc07ce0702cc2d229621e046c906ef14d9b25e8e4d25f6e8763fef7::send::SEND`,\n\t\tscalar: 1000000,\n\t},\n\tIKA: {\n\t\taddress: `0x7262fb2f7a3a14c888c438a3cd9b912469a58cf60f367352c46584262e8299aa`,\n\t\ttype: `0x7262fb2f7a3a14c888c438a3cd9b912469a58cf60f367352c46584262e8299aa::ika::IKA`,\n\t\tscalar: 1000000000,\n\t},\n\tALKIMI: {\n\t\taddress: `0x1a8f4bc33f8ef7fbc851f156857aa65d397a6a6fd27a7ac2ca717b51f2fd9489`,\n\t\ttype: `0x1a8f4bc33f8ef7fbc851f156857aa65d397a6a6fd27a7ac2ca717b51f2fd9489::alkimi::ALKIMI`,\n\t\tscalar: 1000000000,\n\t},\n\tLZWBTC: {\n\t\taddress: `0x0041f9f9344cac094454cd574e333c4fdb132d7bcc9379bcd4aab485b2a63942`,\n\t\ttype: `0x0041f9f9344cac094454cd574e333c4fdb132d7bcc9379bcd4aab485b2a63942::wbtc::WBTC`,\n\t\tscalar: 100000000,\n\t},\n\tUSDT: {\n\t\taddress: `0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068`,\n\t\ttype: `0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068::usdt::USDT`,\n\t\tscalar: 1000000,\n\t},\n};\n\nexport const testnetPools: PoolMap = {\n\tDEEP_SUI: {\n\t\taddress: `0x48c95963e9eac37a316b7ae04a0deb761bcdcc2b67912374d6036e7f0e9bae9f`,\n\t\tbaseCoin: 'DEEP',\n\t\tquoteCoin: 'SUI',\n\t},\n\tSUI_DBUSDC: {\n\t\taddress: `0x1c19362ca52b8ffd7a33cee805a67d40f31e6ba303753fd3a4cfdfacea7163a5`,\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n\tDEEP_DBUSDC: {\n\t\taddress: `0xe86b991f8632217505fd859445f9803967ac84a9d4a1219065bf191fcb74b622`,\n\t\tbaseCoin: 'DEEP',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n\tDBUSDT_DBUSDC: {\n\t\taddress: `0x83970bb02e3636efdff8c141ab06af5e3c9a22e2f74d7f02a9c3430d0d10c1ca`,\n\t\tbaseCoin: 'DBUSDT',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n\tWAL_DBUSDC: {\n\t\taddress: `0xeb524b6aea0ec4b494878582e0b78924208339d360b62aec4a8ecd4031520dbb`,\n\t\tbaseCoin: 'WAL',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n\tWAL_SUI: {\n\t\taddress: `0x8c1c1b186c4fddab1ebd53e0895a36c1d1b3b9a77cd34e607bef49a38af0150a`,\n\t\tbaseCoin: 'WAL',\n\t\tquoteCoin: 'SUI',\n\t},\n\tDBTC_DBUSDC: {\n\t\taddress: `0x0dce0aa771074eb83d1f4a29d48be8248d4d2190976a5241f66b43ec18fa34de`,\n\t\tbaseCoin: 'DBTC',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n};\n\nexport const mainnetPools: PoolMap = {\n\tDEEP_SUI: {\n\t\taddress: `0xb663828d6217467c8a1838a03793da896cbe745b150ebd57d82f814ca579fc22`,\n\t\tbaseCoin: 'DEEP',\n\t\tquoteCoin: 'SUI',\n\t},\n\tSUI_USDC: {\n\t\taddress: `0xe05dafb5133bcffb8d59f4e12465dc0e9faeaa05e3e342a08fe135800e3e4407`,\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'USDC',\n\t},\n\tDEEP_USDC: {\n\t\taddress: `0xf948981b806057580f91622417534f491da5f61aeaf33d0ed8e69fd5691c95ce`,\n\t\tbaseCoin: 'DEEP',\n\t\tquoteCoin: 'USDC',\n\t},\n\tWUSDT_USDC: {\n\t\taddress: `0x4e2ca3988246e1d50b9bf209abb9c1cbfec65bd95afdacc620a36c67bdb8452f`,\n\t\tbaseCoin: 'WUSDT',\n\t\tquoteCoin: 'USDC',\n\t},\n\tWUSDC_USDC: {\n\t\taddress: `0xa0b9ebefb38c963fd115f52d71fa64501b79d1adcb5270563f92ce0442376545`,\n\t\tbaseCoin: 'WUSDC',\n\t\tquoteCoin: 'USDC',\n\t},\n\tBETH_USDC: {\n\t\taddress: `0x1109352b9112717bd2a7c3eb9a416fff1ba6951760f5bdd5424cf5e4e5b3e65c`,\n\t\tbaseCoin: 'BETH',\n\t\tquoteCoin: 'USDC',\n\t},\n\tNS_USDC: {\n\t\taddress: `0x0c0fdd4008740d81a8a7d4281322aee71a1b62c449eb5b142656753d89ebc060`,\n\t\tbaseCoin: 'NS',\n\t\tquoteCoin: 'USDC',\n\t},\n\tNS_SUI: {\n\t\taddress: `0x27c4fdb3b846aa3ae4a65ef5127a309aa3c1f466671471a806d8912a18b253e8`,\n\t\tbaseCoin: 'NS',\n\t\tquoteCoin: 'SUI',\n\t},\n\tTYPUS_SUI: {\n\t\taddress: `0xe8e56f377ab5a261449b92ac42c8ddaacd5671e9fec2179d7933dd1a91200eec`,\n\t\tbaseCoin: 'TYPUS',\n\t\tquoteCoin: 'SUI',\n\t},\n\tSUI_AUSD: {\n\t\taddress: `0x183df694ebc852a5f90a959f0f563b82ac9691e42357e9a9fe961d71a1b809c8`,\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'AUSD',\n\t},\n\tAUSD_USDC: {\n\t\taddress: `0x5661fc7f88fbeb8cb881150a810758cf13700bb4e1f31274a244581b37c303c3`,\n\t\tbaseCoin: 'AUSD',\n\t\tquoteCoin: 'USDC',\n\t},\n\tDRF_SUI: {\n\t\taddress: `0x126865a0197d6ab44bfd15fd052da6db92fd2eb831ff9663451bbfa1219e2af2`,\n\t\tbaseCoin: 'DRF',\n\t\tquoteCoin: 'SUI',\n\t},\n\tSEND_USDC: {\n\t\taddress: `0x1fe7b99c28ded39774f37327b509d58e2be7fff94899c06d22b407496a6fa990`,\n\t\tbaseCoin: 'SEND',\n\t\tquoteCoin: 'USDC',\n\t},\n\tWAL_USDC: {\n\t\taddress: `0x56a1c985c1f1123181d6b881714793689321ba24301b3585eec427436eb1c76d`,\n\t\tbaseCoin: 'WAL',\n\t\tquoteCoin: 'USDC',\n\t},\n\tWAL_SUI: {\n\t\taddress: `0x81f5339934c83ea19dd6bcc75c52e83509629a5f71d3257428c2ce47cc94d08b`,\n\t\tbaseCoin: 'WAL',\n\t\tquoteCoin: 'SUI',\n\t},\n\tXBTC_USDC: {\n\t\taddress: `0x20b9a3ec7a02d4f344aa1ebc5774b7b0ccafa9a5d76230662fdc0300bb215307`,\n\t\tbaseCoin: 'XBTC',\n\t\tquoteCoin: 'USDC',\n\t},\n\tIKA_USDC: {\n\t\taddress: `0xfa732993af2b60d04d7049511f801e79426b2b6a5103e22769c0cead982b0f47`,\n\t\tbaseCoin: 'IKA',\n\t\tquoteCoin: 'USDC',\n\t},\n\tALKIMI_SUI: {\n\t\taddress: `0x84752993c6dc6fce70e25ddeb4daddb6592d6b9b0912a0a91c07cfff5a721d89`,\n\t\tbaseCoin: 'ALKIMI',\n\t\tquoteCoin: 'SUI',\n\t},\n\tLZWBTC_USDC: {\n\t\taddress: `0xf5142aafa24866107df628bf92d0358c7da6acc46c2f10951690fd2b8570f117`,\n\t\tbaseCoin: 'LZWBTC',\n\t\tquoteCoin: 'USDC',\n\t},\n\tUSDT_USDC: {\n\t\taddress: '0xfc28a2fb22579c16d672a1152039cbf671e5f4b9f103feddff4ea06ef3c2bc25',\n\t\tbaseCoin: 'USDT',\n\t\tquoteCoin: 'USDC',\n\t},\n\tSUIUSDE_USDC: {\n\t\taddress: '0x0fac1cebf35bde899cd9ecdd4371e0e33f44ba83b8a2902d69186646afa3a94b',\n\t\tbaseCoin: 'SUIUSDE',\n\t\tquoteCoin: 'USDC',\n\t},\n\tSUI_SUIUSDE: {\n\t\taddress: '0x034f3a42e7348de2084406db7a725f9d9d132a56c68324713e6e623601fb4fd7',\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'SUIUSDE',\n\t},\n\tSUI_USDSUI: {\n\t\taddress: '0x826eeacb2799726334aa580396338891205a41cf9344655e526aae6ddd5dc03f',\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'USDSUI',\n\t},\n\tUSDSUI_USDC: {\n\t\taddress: '0xa374264d43e6baa5aa8b35ff18ff24fdba7443b4bcb884cb4c2f568d32cdac36',\n\t\tbaseCoin: 'USDSUI',\n\t\tquoteCoin: 'USDC',\n\t},\n};\n\nexport const testnetMarginPools = {\n\tSUI: {\n\t\taddress: '0xcdbbe6a72e639b647296788e2e4b1cac5cea4246028ba388ba1332ff9a382eea',\n\t\ttype: '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI',\n\t},\n\tDBUSDC: {\n\t\taddress: '0xf08568da93834e1ee04f09902ac7b1e78d3fdf113ab4d2106c7265e95318b14d',\n\t\ttype: '0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDC::DBUSDC',\n\t},\n\tDEEP: {\n\t\taddress: '0x610640613f21d9e688d6f8103d17df22315c32e0c80590ce64951a1991378b55',\n\t\ttype: '0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8::deep::DEEP',\n\t},\n\tDBTC: {\n\t\taddress: '0xf3440b4aafcc8b12fc4b242e9590c52873b8238a0d0e52fbf9dae61d2970796a',\n\t\ttype: '0x6502dae813dbe5e42643c119a6450a518481f03063febc7e20238e43b6ea9e86::dbtc::DBTC',\n\t},\n};\n\nexport const mainnetMarginPools = {\n\tSUI: {\n\t\taddress: '0x53041c6f86c4782aabbfc1d4fe234a6d37160310c7ee740c915f0a01b7127344',\n\t\ttype: '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI',\n\t},\n\tUSDC: {\n\t\taddress: '0xba473d9ae278f10af75c50a8fa341e9c6a1c087dc91a3f23e8048baf67d0754f',\n\t\ttype: '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC',\n\t},\n\tDEEP: {\n\t\taddress: '0x1d723c5cd113296868b55208f2ab5a905184950dd59c48eb7345607d6b5e6af7',\n\t\ttype: '0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP',\n\t},\n\tWAL: {\n\t\taddress: '0x38decd3dbb62bd4723144349bf57bc403b393aee86a51596846a824a1e0c2c01',\n\t\ttype: '0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL',\n\t},\n\tSUIUSDE: {\n\t\taddress: '0xbb990ca04a7743e6c0a25a7fb16f60fc6f6d8bf213624ff03a63f1bb04c3a12f',\n\t\ttype: '0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402::sui_usde::SUI_USDE',\n\t},\n\tXBTC: {\n\t\taddress: '0x14dfbf54400e0b97e892349310d392bef6d187c2b6709d9b246b8f41c9a13de4',\n\t\ttype: '0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50::xbtc::XBTC',\n\t},\n\tUSDSUI: {\n\t\taddress: '0x78a0ddd02745d9b500fb7e9aae2ff8b665d974f00fd1f6060d59f4a8e891402c',\n\t\ttype: '0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1::usdsui::USDSUI',\n\t},\n};\n\nexport const testnetPythConfigs = {\n\tpythStateId: '0x243759059f4c3111179da5878c12f68d612c21a8d54d85edc86164bb18be1c7c',\n\twormholeStateId: '0x31358d198147da50db32eda2562951d53973a0c0ad5ed738e9b17d88b213d790',\n};\n\nexport const mainnetPythConfigs = {\n\tpythStateId: '0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8',\n\twormholeStateId: '0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c',\n};\n"],"mappings":";AAiBA,MAAa,oBAAoB;CAChC,qBAAqB;CACrB,aAAa;CACb,kBAAkB;CAClB,mBAAmB;CACnB,oBAAoB;CACpB,wBAAwB;CACxB;AAED,MAAa,oBAAoB;CAChC,qBAAqB;CACrB,aAAa;CACb,kBAAkB;CAClB,mBAAmB;CACnB,oBAAoB;CACpB,wBAAwB;CACxB;AAED,MAAa,eAAwB;CACpC,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD;AAED,MAAa,eAAwB;CACpC,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YA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AAQ;EACR;CACD;AAED,MAAa,eAAwB;CACpC,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,eAAe;EACd,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,SAAS;EACR,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD;AAED,MAAa,eAAwB;CACpC,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,SAAS;EACR,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,QAAQ;EACP,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,SAAS;EACR,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,SAAS;EACR,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,cAAc;EACb,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD;AAED,MAAa,qBAAqB;CACjC,KAAK;EACJ,SAAS;EACT,MAAM;EACN;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD;AAED,MAAa,qBAAqB;CACjC,KAAK;EACJ,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN;CACD,SAAS;EACR,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN;CACD;AAED,MAAa,qBAAqB;CACjC,aAAa;CACb,iBAAiB;CACjB;AAED,MAAa,qBAAqB;CACjC,aAAa;CACb,iBAAiB;CACjB"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@mysten/deepbook-v3",
3
3
  "author": "Mysten Labs <build@mystenlabs.com>",
4
4
  "description": "Sui Deepbook SDK",
5
- "version": "1.2.2",
5
+ "version": "1.3.0",
6
6
  "license": "Apache-2.0",
7
7
  "type": "module",
8
8
  "main": "./dist/index.mjs",
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@noble/hashes": "^2.0.1",
34
- "axios": "^1.13.5",
34
+ "axios": "^1.15.0",
35
35
  "axios-retry": "^4.5.0",
36
36
  "@mysten/bcs": "^2.0.3"
37
37
  },
@@ -46,7 +46,7 @@
46
46
  "vite": "^8.0.5",
47
47
  "vitest": "^4.0.17",
48
48
  "wait-on": "^9.0.3",
49
- "@mysten/codegen": "^0.8.4",
49
+ "@mysten/codegen": "^0.8.5",
50
50
  "@mysten/sui": "^2.15.0"
51
51
  },
52
52
  "peerDependencies": {
@@ -216,6 +216,70 @@ export class DeepBookContract {
216
216
  });
217
217
  };
218
218
 
219
+ /**
220
+ * @description Cancel an existing order, no-op if the order is not currently in the
221
+ * balance manager's open orders (e.g. already filled, cancelled, expired-and-swept,
222
+ * or not owned by this balance manager). Unlike `cancelOrder`, this will not abort
223
+ * on unknown order ids.
224
+ * @param {string} poolKey The key to identify the pool
225
+ * @param {string} balanceManagerKey The key to identify the BalanceManager
226
+ * @param {string} orderId Order ID to cancel
227
+ * @returns A function that takes a Transaction object
228
+ */
229
+ cancelLiveOrder =
230
+ (poolKey: string, balanceManagerKey: string, orderId: string) => (tx: Transaction) => {
231
+ tx.setGasBudgetIfNotSet(GAS_BUDGET);
232
+ const pool = this.#config.getPool(poolKey);
233
+ const balanceManager = this.#config.getBalanceManager(balanceManagerKey);
234
+ const baseCoin = this.#config.getCoin(pool.baseCoin);
235
+ const quoteCoin = this.#config.getCoin(pool.quoteCoin);
236
+ const tradeProof = tx.add(this.#config.balanceManager.generateProof(balanceManagerKey));
237
+
238
+ tx.moveCall({
239
+ target: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::cancel_live_order`,
240
+ arguments: [
241
+ tx.object(pool.address),
242
+ tx.object(balanceManager.address),
243
+ tradeProof,
244
+ tx.pure.u128(orderId),
245
+ tx.object.clock(),
246
+ ],
247
+ typeArguments: [baseCoin.type, quoteCoin.type],
248
+ });
249
+ };
250
+
251
+ /**
252
+ * @description Cancel multiple orders, skipping any order_id that is not currently in
253
+ * the balance manager's open orders (e.g. already filled, cancelled, expired-and-swept,
254
+ * or not owned by this balance manager). Duplicate ids in the input vector are handled
255
+ * gracefully. Unlike `cancelOrders`, this will not abort on unknown order ids.
256
+ * @param {string} poolKey The key to identify the pool
257
+ * @param {string} balanceManagerKey The key to identify the BalanceManager
258
+ * @param {string[]} orderIds Array of order IDs to cancel
259
+ * @returns A function that takes a Transaction object
260
+ */
261
+ cancelLiveOrders =
262
+ (poolKey: string, balanceManagerKey: string, orderIds: string[]) => (tx: Transaction) => {
263
+ tx.setGasBudgetIfNotSet(GAS_BUDGET);
264
+ const pool = this.#config.getPool(poolKey);
265
+ const balanceManager = this.#config.getBalanceManager(balanceManagerKey);
266
+ const baseCoin = this.#config.getCoin(pool.baseCoin);
267
+ const quoteCoin = this.#config.getCoin(pool.quoteCoin);
268
+ const tradeProof = tx.add(this.#config.balanceManager.generateProof(balanceManagerKey));
269
+
270
+ tx.moveCall({
271
+ target: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::cancel_live_orders`,
272
+ arguments: [
273
+ tx.object(pool.address),
274
+ tx.object(balanceManager.address),
275
+ tradeProof,
276
+ tx.pure.vector('u128', orderIds),
277
+ tx.object.clock(),
278
+ ],
279
+ typeArguments: [baseCoin.type, quoteCoin.type],
280
+ });
281
+ };
282
+
219
283
  /**
220
284
  * @description Cancel all open orders for a balance manager
221
285
  * @param {string} poolKey The key to identify the pool
@@ -25,7 +25,7 @@ export const testnetPackageIds = {
25
25
  } satisfies DeepbookPackageIds;
26
26
 
27
27
  export const mainnetPackageIds = {
28
- DEEPBOOK_PACKAGE_ID: '0x337f4f4f6567fcd778d5454f27c16c70e2f274cc6377ea6249ddf491482ef497',
28
+ DEEPBOOK_PACKAGE_ID: '0xf48222c4e057fa468baf136bff8e12504209d43850c5778f76159292a96f621e',
29
29
  REGISTRY_ID: '0xaf16199a2dff736e9f07a845f23c5da6df6f756eddb631aed9d24a93efc4549d',
30
30
  DEEP_TREASURY_ID: '0x032abf8948dda67a271bcc18e776dbbcfb0d58c8d288a700ff0d5521e57a1ffe',
31
31
  MARGIN_PACKAGE_ID: '0xfbd322126f1452fd4c89aedbaeb9fd0c44df9b5cedbe70d76bf80dc086031377',