@mysten/deepbook-v3 1.0.5 → 1.0.7
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 +15 -0
- package/dist/transactions/marginLiquidations.d.mts +3 -3
- package/dist/transactions/marginLiquidations.d.mts.map +1 -1
- package/dist/transactions/marginRegistry.d.mts +15 -15
- package/dist/transactions/poolProxy.d.mts +6 -0
- package/dist/transactions/poolProxy.d.mts.map +1 -1
- package/dist/transactions/poolProxy.mjs +18 -0
- package/dist/transactions/poolProxy.mjs.map +1 -1
- package/dist/utils/constants.mjs +1 -1
- package/dist/utils/constants.mjs.map +1 -1
- package/package.json +7 -6
- package/src/transactions/poolProxy.ts +28 -0
- package/src/utils/constants.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @mysten/deepbook-v3
|
|
2
2
|
|
|
3
|
+
## 1.0.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 99d1e00: Add default export condition
|
|
8
|
+
- Updated dependencies [99d1e00]
|
|
9
|
+
- @mysten/bcs@2.0.2
|
|
10
|
+
- @mysten/sui@2.3.2
|
|
11
|
+
|
|
12
|
+
## 1.0.6
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- ad9a3a4: Price added function
|
|
17
|
+
|
|
3
18
|
## 1.0.5
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _mysten_sui_transactions106 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) =>
|
|
38
|
+
withdraw: (vaultId: string, liquidationAdminCap: string, coinKey: string, amount: number) => (tx: Transaction) => _mysten_sui_transactions106.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) =>
|
|
63
|
+
balance: (vaultId: string, coinKey: string) => (tx: Transaction) => _mysten_sui_transactions106.TransactionResult;
|
|
64
64
|
}
|
|
65
65
|
//#endregion
|
|
66
66
|
export { MarginLiquidationsContract };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marginLiquidations.d.mts","names":[],"sources":["../../src/transactions/marginLiquidations.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAUa,cAAA,0BAAA,CAA0B;EAMlB,CAAA,OAAA;EAS2C;;;EAwC9C,WAAA,CAAA,MAAA,EAjDG,cAiDH;EAuBX;;;;;gEA/DyD;;;;;;;;;mGAiBzD;;;;;;;;;oGAuBA,gBAAW,
|
|
1
|
+
{"version":3,"file":"marginLiquidations.d.mts","names":[],"sources":["../../src/transactions/marginLiquidations.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAUa,cAAA,0BAAA,CAA0B;EAMlB,CAAA,OAAA;EAS2C;;;EAwC9C,WAAA,CAAA,MAAA,EAjDG,cAiDH;EAuBX;;;;;gEA/DyD;;;;;;;;;mGAiBzD;;;;;;;;;oGAuBA,gBAAW,2BAAA,CAAA;;;;;;;;;0GAuBX;;;;;;;;;2GAwCA;;;;;;;sDAsC+C,gBAAW,2BAAA,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _mysten_sui_transactions92 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) =>
|
|
20
|
+
poolEnabled: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions92.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) =>
|
|
26
|
+
getMarginPoolId: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions92.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) =>
|
|
32
|
+
getDeepbookPoolMarginPoolIds: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions92.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) =>
|
|
38
|
+
getMarginManagerIds: (owner: string) => (tx: Transaction) => _mysten_sui_transactions92.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) =>
|
|
44
|
+
baseMarginPoolId: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions92.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) =>
|
|
50
|
+
quoteMarginPoolId: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions92.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) =>
|
|
56
|
+
minWithdrawRiskRatio: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions92.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) =>
|
|
62
|
+
minBorrowRiskRatio: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions92.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) =>
|
|
68
|
+
liquidationRiskRatio: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions92.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) =>
|
|
74
|
+
targetLiquidationRiskRatio: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions92.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) =>
|
|
80
|
+
userLiquidationReward: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions92.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) =>
|
|
86
|
+
poolLiquidationReward: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions92.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) =>
|
|
91
|
+
allowedMaintainers: () => (tx: Transaction) => _mysten_sui_transactions92.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) =>
|
|
96
|
+
allowedPauseCaps: () => (tx: Transaction) => _mysten_sui_transactions92.TransactionResult;
|
|
97
97
|
}
|
|
98
98
|
//#endregion
|
|
99
99
|
export { MarginRegistryContract };
|
|
@@ -111,6 +111,12 @@ declare class PoolProxyContract {
|
|
|
111
111
|
* @returns A function that takes a Transaction object
|
|
112
112
|
*/
|
|
113
113
|
withdrawMarginSettledAmounts: (poolKey: string, marginManagerId: string) => (tx: Transaction) => void;
|
|
114
|
+
/**
|
|
115
|
+
* @description Update the current price for a pool using Pyth oracle
|
|
116
|
+
* @param {string} poolKey The key to identify the pool
|
|
117
|
+
* @returns A function that takes a Transaction object
|
|
118
|
+
*/
|
|
119
|
+
updateCurrentPrice: (poolKey: string) => (tx: Transaction) => void;
|
|
114
120
|
}
|
|
115
121
|
//#endregion
|
|
116
122
|
export { PoolProxyContract };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"poolProxy.d.mts","names":[],"sources":["../../src/transactions/poolProxy.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAgBa,cAAA,iBAAA,CAAiB;EAMT,CAAA,OAAA;EASO;;;EA4CC,WAAA,CAAA,MAAA,EArDR,cAqDQ;EAAsC;;;;;EAsF5B,eAAA,EAAA,CAAA,MAAA,EAlIX,2BAkIW,EAAA,GAAA,CAAA,EAAA,EAlI0B,WAkI1B,EAAA,GAlIqC,0BAAA,CAAA,iBAkIrC;EAAsC;;;;;EAuHvB,gBAAA,EAAA,CAAA,MAAA,EA7MzB,4BA6MyB,EAAA,GAAA,CAAA,EAAA,EA7Ma,WA6Mb,EAAA,GA7MwB,0BAAA,CAAA,iBA6MxB;EAsBO;;;;;EAkGE,yBAAA,EAAA,CAAA,MAAA,EAhSzB,2BAgSyB,EAAA,GAAA,CAAA,EAAA,EAhSY,WAgSZ,EAAA,GAhSuB,0BAAA,CAAA,iBAgSvB;EAsBb;;;;;uCArQX,sCAAsC,gBAAW,0BAAA,CAAA;;;;;;;;wFA6Cb;;;;;;;mEA2BR;;;;;;;uEAwBI;;;;;;sDAuBjB;;;;;;6DAsBO;;;;;;;iEAsBI;;;;;;8CAwBnB;;;;;;;qDAuBT,8BAA8B;;;;;;;+DA6BJ;;;;;;kDAsBb;;;;;;;mFAuBG"}
|
|
1
|
+
{"version":3,"file":"poolProxy.d.mts","names":[],"sources":["../../src/transactions/poolProxy.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAgBa,cAAA,iBAAA,CAAiB;EAMT,CAAA,OAAA;EASO;;;EA4CC,WAAA,CAAA,MAAA,EArDR,cAqDQ;EAAsC;;;;;EAsF5B,eAAA,EAAA,CAAA,MAAA,EAlIX,2BAkIW,EAAA,GAAA,CAAA,EAAA,EAlI0B,WAkI1B,EAAA,GAlIqC,0BAAA,CAAA,iBAkIrC;EAAsC;;;;;EAuHvB,gBAAA,EAAA,CAAA,MAAA,EA7MzB,4BA6MyB,EAAA,GAAA,CAAA,EAAA,EA7Ma,WA6Mb,EAAA,GA7MwB,0BAAA,CAAA,iBA6MxB;EAsBO;;;;;EAkGE,yBAAA,EAAA,CAAA,MAAA,EAhSzB,2BAgSyB,EAAA,GAAA,CAAA,EAAA,EAhSY,WAgSZ,EAAA,GAhSuB,0BAAA,CAAA,iBAgSvB;EAsBb;;;;;uCArQX,sCAAsC,gBAAW,0BAAA,CAAA;;;;;;;;wFA6Cb;;;;;;;mEA2BR;;;;;;;uEAwBI;;;;;;sDAuBjB;;;;;;6DAsBO;;;;;;;iEAsBI;;;;;;8CAwBnB;;;;;;;qDAuBT,8BAA8B;;;;;;;+DA6BJ;;;;;;kDAsBb;;;;;;;mFAuBG;;;;;;gDAoBL"}
|
|
@@ -309,6 +309,24 @@ var PoolProxyContract = class {
|
|
|
309
309
|
typeArguments: [baseCoin.type, quoteCoin.type]
|
|
310
310
|
});
|
|
311
311
|
};
|
|
312
|
+
this.updateCurrentPrice = (poolKey) => (tx) => {
|
|
313
|
+
const pool = this.#config.getPool(poolKey);
|
|
314
|
+
const baseCoin = this.#config.getCoin(pool.baseCoin);
|
|
315
|
+
const quoteCoin = this.#config.getCoin(pool.quoteCoin);
|
|
316
|
+
if (!baseCoin.priceInfoObjectId) throw new Error(`Missing priceInfoObjectId for ${pool.baseCoin}`);
|
|
317
|
+
if (!quoteCoin.priceInfoObjectId) throw new Error(`Missing priceInfoObjectId for ${pool.quoteCoin}`);
|
|
318
|
+
tx.moveCall({
|
|
319
|
+
target: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::update_current_price`,
|
|
320
|
+
arguments: [
|
|
321
|
+
tx.object(this.#config.MARGIN_REGISTRY_ID),
|
|
322
|
+
tx.object(pool.address),
|
|
323
|
+
tx.object(baseCoin.priceInfoObjectId),
|
|
324
|
+
tx.object(quoteCoin.priceInfoObjectId),
|
|
325
|
+
tx.object.clock()
|
|
326
|
+
],
|
|
327
|
+
typeArguments: [baseCoin.type, quoteCoin.type]
|
|
328
|
+
});
|
|
329
|
+
};
|
|
312
330
|
this.#config = config;
|
|
313
331
|
}
|
|
314
332
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"poolProxy.mjs","names":["#config"],"sources":["../../src/transactions/poolProxy.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport type { Transaction } from '@mysten/sui/transactions';\nimport type {\n\tPlaceMarginLimitOrderParams,\n\tPlaceMarginMarketOrderParams,\n\tMarginProposalParams,\n} from '../types/index.js';\n\nimport type { DeepBookConfig } from '../utils/config.js';\nimport { OrderType, SelfMatchingOptions } from '../types/index.js';\nimport { MAX_TIMESTAMP, FLOAT_SCALAR } from '../utils/config.js';\n\n/**\n * PoolProxyContract class for managing PoolProxy operations.\n */\nexport class PoolProxyContract {\n\t#config: DeepBookConfig;\n\n\t/**\n\t * @param {DeepBookConfig} config Configuration for PoolProxyContract\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 {PlaceMarginLimitOrderParams} params Parameters for placing a limit order\n\t * @returns A function that takes a Transaction object\n\t */\n\tplaceLimitOrder = (params: PlaceMarginLimitOrderParams) => (tx: Transaction) => {\n\t\tconst {\n\t\t\tpoolKey,\n\t\t\tmarginManagerKey,\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\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst inputPrice = Math.round((price * FLOAT_SCALAR * quoteCoin.scalar) / baseCoin.scalar);\n\t\tconst inputQuantity = Math.round(quantity * baseCoin.scalar);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::place_limit_order`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(pool.address),\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 {PlaceMarginMarketOrderParams} params Parameters for placing a market order\n\t * @returns A function that takes a Transaction object\n\t */\n\tplaceMarketOrder = (params: PlaceMarginMarketOrderParams) => (tx: Transaction) => {\n\t\tconst {\n\t\t\tpoolKey,\n\t\t\tmarginManagerKey,\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\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst inputQuantity = Math.round(quantity * baseCoin.scalar);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::place_market_order`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(pool.address),\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 Place a reduce only limit order\n\t * @param {PlaceMarginLimitOrderParams} params Parameters for placing a reduce only limit order\n\t * @returns A function that takes a Transaction object\n\t */\n\tplaceReduceOnlyLimitOrder = (params: PlaceMarginLimitOrderParams) => (tx: Transaction) => {\n\t\tconst {\n\t\t\tpoolKey,\n\t\t\tmarginManagerKey,\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\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst inputPrice = Math.round((price * FLOAT_SCALAR * quoteCoin.scalar) / baseCoin.scalar);\n\t\tconst inputQuantity = Math.round(quantity * baseCoin.scalar);\n\t\tconst marginPool = isBid\n\t\t\t? this.#config.getMarginPool(pool.baseCoin)\n\t\t\t: this.#config.getMarginPool(pool.quoteCoin);\n\t\tconst debtType = isBid ? baseCoin.type : quoteCoin.type;\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::place_reduce_only_limit_order`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.object(marginPool.address),\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, debtType],\n\t\t});\n\t};\n\n\t/**\n\t * @description Place a reduce only market order\n\t * @param {PlaceMarginMarketOrderParams} params Parameters for placing a reduce only market order\n\t * @returns A function that takes a Transaction object\n\t */\n\tplaceReduceOnlyMarketOrder = (params: PlaceMarginMarketOrderParams) => (tx: Transaction) => {\n\t\tconst {\n\t\t\tpoolKey,\n\t\t\tmarginManagerKey,\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\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst inputQuantity = Math.round(quantity * baseCoin.scalar);\n\t\tconst marginPool = isBid\n\t\t\t? this.#config.getMarginPool(pool.baseCoin)\n\t\t\t: this.#config.getMarginPool(pool.quoteCoin);\n\t\tconst debtType = isBid ? baseCoin.type : quoteCoin.type;\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::place_reduce_only_market_order`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.object(marginPool.address),\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, debtType],\n\t\t});\n\t};\n\n\t/**\n\t * @description Modify an existing order\n\t * @param {string} marginManagerKey The key to identify the MarginManager\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(marginManagerKey: string, orderId: string, newQuantity: number) => (tx: Transaction) => {\n\t\t\tconst marginManager = this.#config.getMarginManager(marginManagerKey);\n\t\t\tconst pool = this.#config.getPool(marginManager.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 inputQuantity = Math.round(newQuantity * baseCoin.scalar);\n\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::modify_order`,\n\t\t\t\targuments: [\n\t\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\t\ttx.object(marginManager.address),\n\t\t\t\t\ttx.object(pool.address),\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} marginManagerKey The key to identify the MarginManager\n\t * @param {string} orderId Order ID to cancel\n\t * @returns A function that takes a Transaction object\n\t */\n\tcancelOrder = (marginManagerKey: string, orderId: string) => (tx: Transaction) => {\n\t\tconst marginManager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst pool = this.#config.getPool(marginManager.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.MARGIN_PACKAGE_ID}::pool_proxy::cancel_order`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(marginManager.address),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.pure.u128(orderId),\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 Cancel multiple existing orders\n\t * @param {string} marginManagerKey The key to identify the MarginManager\n\t * @param {string[]} orderIds Order IDs to cancel\n\t * @returns A function that takes a Transaction object\n\t */\n\tcancelOrders = (marginManagerKey: string, orderIds: string[]) => (tx: Transaction) => {\n\t\tconst marginManager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst pool = this.#config.getPool(marginManager.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.MARGIN_PACKAGE_ID}::pool_proxy::cancel_orders`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(marginManager.address),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.pure.vector('u128', orderIds),\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 Cancel all existing orders\n\t * @param {string} marginManagerKey The key to identify the MarginManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tcancelAllOrders = (marginManagerKey: string) => (tx: Transaction) => {\n\t\tconst marginManager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst pool = this.#config.getPool(marginManager.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.MARGIN_PACKAGE_ID}::pool_proxy::cancel_all_orders`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(marginManager.address),\n\t\t\t\ttx.object(pool.address),\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\n\t * @param {string} marginManagerKey The key to identify the MarginManager\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawSettledAmounts = (marginManagerKey: string) => (tx: Transaction) => {\n\t\tconst marginManager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst pool = this.#config.getPool(marginManager.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.MARGIN_PACKAGE_ID}::pool_proxy::withdraw_settled_amounts`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(marginManager.address),\n\t\t\t\ttx.object(pool.address),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Stake in the pool\n\t * @param {string} marginManagerKey The key to identify the MarginManager\n\t * @param {number} stakeAmount The amount to stake\n\t * @returns A function that takes a Transaction object\n\t */\n\tstake = (marginManagerKey: string, stakeAmount: number) => (tx: Transaction) => {\n\t\tconst marginManager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst pool = this.#config.getPool(marginManager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst deepCoin = this.#config.getCoin('DEEP');\n\t\tconst stakeInput = Math.round(stakeAmount * deepCoin.scalar);\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::stake`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(marginManager.address),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.pure.u64(stakeInput),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Unstake from the pool\n\t * @param {string} marginManagerKey The key to identify the MarginManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tunstake = (marginManagerKey: string) => (tx: Transaction) => {\n\t\tconst marginManager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst pool = this.#config.getPool(marginManager.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.MARGIN_PACKAGE_ID}::pool_proxy::unstake`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(marginManager.address),\n\t\t\t\ttx.object(pool.address),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Submit a proposal\n\t * @param {string} marginManagerKey The key to identify the MarginManager\n\t * @param {MarginProposalParams} params Parameters for the proposal\n\t * @returns A function that takes a Transaction object\n\t */\n\tsubmitProposal =\n\t\t(marginManagerKey: string, params: MarginProposalParams) => (tx: Transaction) => {\n\t\t\tconst { takerFee, makerFee, stakeRequired } = params;\n\t\t\tconst marginManager = this.#config.getMarginManager(marginManagerKey);\n\t\t\tconst pool = this.#config.getPool(marginManager.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 stakeInput = Math.round(stakeRequired * FLOAT_SCALAR);\n\t\t\tconst takerFeeInput = Math.round(takerFee * FLOAT_SCALAR);\n\t\t\tconst makerFeeInput = Math.round(makerFee * FLOAT_SCALAR);\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::submit_proposal`,\n\t\t\t\targuments: [\n\t\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\t\ttx.object(marginManager.address),\n\t\t\t\t\ttx.object(pool.address),\n\t\t\t\t\ttx.pure.u64(takerFeeInput),\n\t\t\t\t\ttx.pure.u64(makerFeeInput),\n\t\t\t\t\ttx.pure.u64(stakeInput),\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 Vote on a proposal\n\t * @param {string} marginManagerKey The key to identify the MarginManager\n\t * @param {string} proposalId The ID of the proposal to vote on\n\t * @returns A function that takes a Transaction object\n\t */\n\tvote = (marginManagerKey: string, proposalId: string) => (tx: Transaction) => {\n\t\tconst marginManager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst pool = this.#config.getPool(marginManager.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.MARGIN_PACKAGE_ID}::pool_proxy::vote`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(marginManager.address),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.pure.id(proposalId),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Claim a rebate from a pool\n\t * @param {string} marginManagerKey The key to identify the MarginManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tclaimRebate = (marginManagerKey: string) => (tx: Transaction) => {\n\t\tconst marginManager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst pool = this.#config.getPool(marginManager.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.MARGIN_PACKAGE_ID}::pool_proxy::claim_rebate`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(marginManager.address),\n\t\t\t\ttx.object(pool.address),\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 permissionlessly for a margin manager by ID\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The object ID of the MarginManager\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawMarginSettledAmounts =\n\t\t(poolKey: string, marginManagerId: 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\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::withdraw_settled_amounts_permissionless`,\n\t\t\t\targuments: [\n\t\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\t\ttx.object(marginManagerId),\n\t\t\t\t\ttx.object(pool.address),\n\t\t\t\t],\n\t\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t\t});\n\t\t};\n}\n"],"mappings":";;;;;;;AAgBA,IAAa,oBAAb,MAA+B;CAC9B;;;;CAKA,YAAY,QAAwB;0BASjB,YAAyC,OAAoB;GAC/E,MAAM,EACL,SACA,kBACA,eACA,OACA,UACA,OACA,aAAa,eACb,YAAY,UAAU,gBACtB,qBAAqB,oBAAoB,uBACzC,cAAc,SACX;GACJ,MAAM,OAAO,MAAKA,OAAQ,QAAQ,QAAQ;GAC1C,MAAM,UAAU,MAAKA,OAAQ,iBAAiB,iBAAiB;GAC/D,MAAM,WAAW,MAAKA,OAAQ,QAAQ,KAAK,SAAS;GACpD,MAAM,YAAY,MAAKA,OAAQ,QAAQ,KAAK,UAAU;GACtD,MAAM,aAAa,KAAK,MAAO,QAAQ,eAAe,UAAU,SAAU,SAAS,OAAO;GAC1F,MAAM,gBAAgB,KAAK,MAAM,WAAW,SAAS,OAAO;AAC5D,UAAO,GAAG,SAAS;IAClB,QAAQ,GAAG,MAAKA,OAAQ,kBAAkB;IAC1C,WAAW;KACV,GAAG,OAAO,MAAKA,OAAQ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AAG,OAAO,cAAc,QAAQ;KAChC,GAAG,OAAO,KAAK,QAAQ;KACvB;IACD,eAAe,CAAC,SAAS,MAAM,UAAU,KAAK;IAC9C,CAAC;;uCAUD,SAAiB,qBAA6B,OAAoB;GAClE,MAAM,OAAO,MAAKA,OAAQ,QAAQ,QAAQ;GAC1C,MAAM,WAAW,MAAKA,OAAQ,QAAQ,KAAK,SAAS;GACpD,MAAM,YAAY,MAAKA,OAAQ,QAAQ,KAAK,UAAU;AACtD,MAAG,SAAS;IACX,QAAQ,GAAG,MAAKA,OAAQ,kBAAkB;IAC1C,WAAW;KACV,GAAG,OAAO,MAAKA,OAAQ,mBAAmB;KAC1C,GAAG,OAAO,gBAAgB;KAC1B,GAAG,OAAO,KAAK,QAAQ;KACvB;IACD,eAAe,CAAC,SAAS,MAAM,UAAU,KAAK;IAC9C,CAAC;;AAlbH,QAAKA,SAAU"}
|
|
1
|
+
{"version":3,"file":"poolProxy.mjs","names":["#config"],"sources":["../../src/transactions/poolProxy.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport type { Transaction } from '@mysten/sui/transactions';\nimport type {\n\tPlaceMarginLimitOrderParams,\n\tPlaceMarginMarketOrderParams,\n\tMarginProposalParams,\n} from '../types/index.js';\n\nimport type { DeepBookConfig } from '../utils/config.js';\nimport { OrderType, SelfMatchingOptions } from '../types/index.js';\nimport { MAX_TIMESTAMP, FLOAT_SCALAR } from '../utils/config.js';\n\n/**\n * PoolProxyContract class for managing PoolProxy operations.\n */\nexport class PoolProxyContract {\n\t#config: DeepBookConfig;\n\n\t/**\n\t * @param {DeepBookConfig} config Configuration for PoolProxyContract\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 {PlaceMarginLimitOrderParams} params Parameters for placing a limit order\n\t * @returns A function that takes a Transaction object\n\t */\n\tplaceLimitOrder = (params: PlaceMarginLimitOrderParams) => (tx: Transaction) => {\n\t\tconst {\n\t\t\tpoolKey,\n\t\t\tmarginManagerKey,\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\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst inputPrice = Math.round((price * FLOAT_SCALAR * quoteCoin.scalar) / baseCoin.scalar);\n\t\tconst inputQuantity = Math.round(quantity * baseCoin.scalar);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::place_limit_order`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(pool.address),\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 {PlaceMarginMarketOrderParams} params Parameters for placing a market order\n\t * @returns A function that takes a Transaction object\n\t */\n\tplaceMarketOrder = (params: PlaceMarginMarketOrderParams) => (tx: Transaction) => {\n\t\tconst {\n\t\t\tpoolKey,\n\t\t\tmarginManagerKey,\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\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst inputQuantity = Math.round(quantity * baseCoin.scalar);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::place_market_order`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(pool.address),\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 Place a reduce only limit order\n\t * @param {PlaceMarginLimitOrderParams} params Parameters for placing a reduce only limit order\n\t * @returns A function that takes a Transaction object\n\t */\n\tplaceReduceOnlyLimitOrder = (params: PlaceMarginLimitOrderParams) => (tx: Transaction) => {\n\t\tconst {\n\t\t\tpoolKey,\n\t\t\tmarginManagerKey,\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\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst inputPrice = Math.round((price * FLOAT_SCALAR * quoteCoin.scalar) / baseCoin.scalar);\n\t\tconst inputQuantity = Math.round(quantity * baseCoin.scalar);\n\t\tconst marginPool = isBid\n\t\t\t? this.#config.getMarginPool(pool.baseCoin)\n\t\t\t: this.#config.getMarginPool(pool.quoteCoin);\n\t\tconst debtType = isBid ? baseCoin.type : quoteCoin.type;\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::place_reduce_only_limit_order`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.object(marginPool.address),\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, debtType],\n\t\t});\n\t};\n\n\t/**\n\t * @description Place a reduce only market order\n\t * @param {PlaceMarginMarketOrderParams} params Parameters for placing a reduce only market order\n\t * @returns A function that takes a Transaction object\n\t */\n\tplaceReduceOnlyMarketOrder = (params: PlaceMarginMarketOrderParams) => (tx: Transaction) => {\n\t\tconst {\n\t\t\tpoolKey,\n\t\t\tmarginManagerKey,\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\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst inputQuantity = Math.round(quantity * baseCoin.scalar);\n\t\tconst marginPool = isBid\n\t\t\t? this.#config.getMarginPool(pool.baseCoin)\n\t\t\t: this.#config.getMarginPool(pool.quoteCoin);\n\t\tconst debtType = isBid ? baseCoin.type : quoteCoin.type;\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::place_reduce_only_market_order`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.object(marginPool.address),\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, debtType],\n\t\t});\n\t};\n\n\t/**\n\t * @description Modify an existing order\n\t * @param {string} marginManagerKey The key to identify the MarginManager\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(marginManagerKey: string, orderId: string, newQuantity: number) => (tx: Transaction) => {\n\t\t\tconst marginManager = this.#config.getMarginManager(marginManagerKey);\n\t\t\tconst pool = this.#config.getPool(marginManager.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 inputQuantity = Math.round(newQuantity * baseCoin.scalar);\n\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::modify_order`,\n\t\t\t\targuments: [\n\t\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\t\ttx.object(marginManager.address),\n\t\t\t\t\ttx.object(pool.address),\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} marginManagerKey The key to identify the MarginManager\n\t * @param {string} orderId Order ID to cancel\n\t * @returns A function that takes a Transaction object\n\t */\n\tcancelOrder = (marginManagerKey: string, orderId: string) => (tx: Transaction) => {\n\t\tconst marginManager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst pool = this.#config.getPool(marginManager.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.MARGIN_PACKAGE_ID}::pool_proxy::cancel_order`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(marginManager.address),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.pure.u128(orderId),\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 Cancel multiple existing orders\n\t * @param {string} marginManagerKey The key to identify the MarginManager\n\t * @param {string[]} orderIds Order IDs to cancel\n\t * @returns A function that takes a Transaction object\n\t */\n\tcancelOrders = (marginManagerKey: string, orderIds: string[]) => (tx: Transaction) => {\n\t\tconst marginManager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst pool = this.#config.getPool(marginManager.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.MARGIN_PACKAGE_ID}::pool_proxy::cancel_orders`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(marginManager.address),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.pure.vector('u128', orderIds),\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 Cancel all existing orders\n\t * @param {string} marginManagerKey The key to identify the MarginManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tcancelAllOrders = (marginManagerKey: string) => (tx: Transaction) => {\n\t\tconst marginManager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst pool = this.#config.getPool(marginManager.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.MARGIN_PACKAGE_ID}::pool_proxy::cancel_all_orders`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(marginManager.address),\n\t\t\t\ttx.object(pool.address),\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\n\t * @param {string} marginManagerKey The key to identify the MarginManager\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawSettledAmounts = (marginManagerKey: string) => (tx: Transaction) => {\n\t\tconst marginManager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst pool = this.#config.getPool(marginManager.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.MARGIN_PACKAGE_ID}::pool_proxy::withdraw_settled_amounts`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(marginManager.address),\n\t\t\t\ttx.object(pool.address),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Stake in the pool\n\t * @param {string} marginManagerKey The key to identify the MarginManager\n\t * @param {number} stakeAmount The amount to stake\n\t * @returns A function that takes a Transaction object\n\t */\n\tstake = (marginManagerKey: string, stakeAmount: number) => (tx: Transaction) => {\n\t\tconst marginManager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst pool = this.#config.getPool(marginManager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst deepCoin = this.#config.getCoin('DEEP');\n\t\tconst stakeInput = Math.round(stakeAmount * deepCoin.scalar);\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::stake`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(marginManager.address),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.pure.u64(stakeInput),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Unstake from the pool\n\t * @param {string} marginManagerKey The key to identify the MarginManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tunstake = (marginManagerKey: string) => (tx: Transaction) => {\n\t\tconst marginManager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst pool = this.#config.getPool(marginManager.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.MARGIN_PACKAGE_ID}::pool_proxy::unstake`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(marginManager.address),\n\t\t\t\ttx.object(pool.address),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Submit a proposal\n\t * @param {string} marginManagerKey The key to identify the MarginManager\n\t * @param {MarginProposalParams} params Parameters for the proposal\n\t * @returns A function that takes a Transaction object\n\t */\n\tsubmitProposal =\n\t\t(marginManagerKey: string, params: MarginProposalParams) => (tx: Transaction) => {\n\t\t\tconst { takerFee, makerFee, stakeRequired } = params;\n\t\t\tconst marginManager = this.#config.getMarginManager(marginManagerKey);\n\t\t\tconst pool = this.#config.getPool(marginManager.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 stakeInput = Math.round(stakeRequired * FLOAT_SCALAR);\n\t\t\tconst takerFeeInput = Math.round(takerFee * FLOAT_SCALAR);\n\t\t\tconst makerFeeInput = Math.round(makerFee * FLOAT_SCALAR);\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::submit_proposal`,\n\t\t\t\targuments: [\n\t\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\t\ttx.object(marginManager.address),\n\t\t\t\t\ttx.object(pool.address),\n\t\t\t\t\ttx.pure.u64(takerFeeInput),\n\t\t\t\t\ttx.pure.u64(makerFeeInput),\n\t\t\t\t\ttx.pure.u64(stakeInput),\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 Vote on a proposal\n\t * @param {string} marginManagerKey The key to identify the MarginManager\n\t * @param {string} proposalId The ID of the proposal to vote on\n\t * @returns A function that takes a Transaction object\n\t */\n\tvote = (marginManagerKey: string, proposalId: string) => (tx: Transaction) => {\n\t\tconst marginManager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst pool = this.#config.getPool(marginManager.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.MARGIN_PACKAGE_ID}::pool_proxy::vote`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(marginManager.address),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.pure.id(proposalId),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Claim a rebate from a pool\n\t * @param {string} marginManagerKey The key to identify the MarginManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tclaimRebate = (marginManagerKey: string) => (tx: Transaction) => {\n\t\tconst marginManager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst pool = this.#config.getPool(marginManager.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.MARGIN_PACKAGE_ID}::pool_proxy::claim_rebate`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(marginManager.address),\n\t\t\t\ttx.object(pool.address),\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 permissionlessly for a margin manager by ID\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The object ID of the MarginManager\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawMarginSettledAmounts =\n\t\t(poolKey: string, marginManagerId: 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\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::withdraw_settled_amounts_permissionless`,\n\t\t\t\targuments: [\n\t\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\t\ttx.object(marginManagerId),\n\t\t\t\t\ttx.object(pool.address),\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 Update the current price for a pool using Pyth oracle\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tupdateCurrentPrice = (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\tif (!baseCoin.priceInfoObjectId) {\n\t\t\tthrow new Error(`Missing priceInfoObjectId for ${pool.baseCoin}`);\n\t\t}\n\t\tif (!quoteCoin.priceInfoObjectId) {\n\t\t\tthrow new Error(`Missing priceInfoObjectId for ${pool.quoteCoin}`);\n\t\t}\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::update_current_price`,\n\t\t\targuments: [\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.object(baseCoin.priceInfoObjectId),\n\t\t\t\ttx.object(quoteCoin.priceInfoObjectId),\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"],"mappings":";;;;;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C1C,MAAM,WAAW,MAAKA,OAAQ,QAAQ,KAAK,SAAS;GACpD,MAAM,YAAY,MAAKA,OAAQ,QAAQ,KAAK,UAAU;AACtD,OAAI,CAAC,SAAS,kBACb,OAAM,IAAI,MAAM,iCAAiC,KAAK,WAAW;AAElE,OAAI,CAAC,UAAU,kBACd,OAAM,IAAI,MAAM,iCAAiC,KAAK,YAAY;AAEnE,MAAG,SAAS;IACX,QAAQ,GAAG,MAAKA,OAAQ,kBAAkB;IAC1C,WAAW;KACV,GAAG,OAAO,MAAKA,OAAQ,mBAAmB;KAC1C,GAAG,OAAO,KAAK,QAAQ;KACvB,GAAG,OAAO,SAAS,kBAAkB;KACrC,GAAG,OAAO,UAAU,kBAAkB;KACtC,GAAG,OAAO,OAAO;KACjB;IACD,eAAe,CAAC,SAAS,MAAM,UAAU,KAAK;IAC9C,CAAC;;AA9cF,QAAKA,SAAU"}
|
package/dist/utils/constants.mjs
CHANGED
|
@@ -11,7 +11,7 @@ const mainnetPackageIds = {
|
|
|
11
11
|
DEEPBOOK_PACKAGE_ID: "0x337f4f4f6567fcd778d5454f27c16c70e2f274cc6377ea6249ddf491482ef497",
|
|
12
12
|
REGISTRY_ID: "0xaf16199a2dff736e9f07a845f23c5da6df6f756eddb631aed9d24a93efc4549d",
|
|
13
13
|
DEEP_TREASURY_ID: "0x032abf8948dda67a271bcc18e776dbbcfb0d58c8d288a700ff0d5521e57a1ffe",
|
|
14
|
-
MARGIN_PACKAGE_ID: "
|
|
14
|
+
MARGIN_PACKAGE_ID: "0xcb4fc91921494ebe6979e201fdb2d67388ffdf6a1b1eb4952526259074de8d0b",
|
|
15
15
|
MARGIN_REGISTRY_ID: "0x0e40998b359a9ccbab22a98ed21bd4346abf19158bc7980c8291908086b3a742",
|
|
16
16
|
LIQUIDATION_PACKAGE_ID: "0x73c593882cdb557703e903603f20bd373261fe6ba6e1a40515f4b62f10553e6a"
|
|
17
17
|
};
|
|
@@ -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: '0x97d9473771b01f77b0940c589484184b49f6444627ec121314fae6a6d36fb86b',\n\tMARGIN_REGISTRY_ID: '0x0e40998b359a9ccbab22a98ed21bd4346abf19158bc7980c8291908086b3a742',\n\tLIQUIDATION_PACKAGE_ID: '0x73c593882cdb557703e903603f20bd373261fe6ba6e1a40515f4b62f10553e6a',\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\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\tXBTC: {\n\t\taddress: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50`,\n\t\ttype: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50::xbtc::XBTC`,\n\t\tscalar: 100000000,\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\tUSDE: {\n\t\taddress: `0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402`,\n\t\ttype: `0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402::sui_usde::SUI_USDE`,\n\t\tscalar: 1000000,\n\t},\n\t// This coin is experimental\n\tWGIGA: {\n\t\taddress: `0xec32640add6d02a1d5f0425d72705eb76d9de7edfd4f34e0dba68e62ecceb05b`,\n\t\ttype: `0xec32640add6d02a1d5f0425d72705eb76d9de7edfd4f34e0dba68e62ecceb05b::coin::COIN`,\n\t\tscalar: 100000,\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\tUSDE_USDC: {\n\t\taddress: '0x0fac1cebf35bde899cd9ecdd4371e0e33f44ba83b8a2902d69186646afa3a94b',\n\t\tbaseCoin: 'USDE',\n\t\tquoteCoin: 'USDC',\n\t},\n\tSUI_USDE: {\n\t\taddress: '0x034f3a42e7348de2084406db7a725f9d9d132a56c68324713e6e623601fb4fd7',\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'USDE',\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};\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,YAAY;EACZ,mBAAmB;EACnB;CACD,KAAK;EACJ,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,KAAK;EACJ,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,OAAO;EACN,SA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S;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,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,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;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: '0x337f4f4f6567fcd778d5454f27c16c70e2f274cc6377ea6249ddf491482ef497',\n\tREGISTRY_ID: '0xaf16199a2dff736e9f07a845f23c5da6df6f756eddb631aed9d24a93efc4549d',\n\tDEEP_TREASURY_ID: '0x032abf8948dda67a271bcc18e776dbbcfb0d58c8d288a700ff0d5521e57a1ffe',\n\tMARGIN_PACKAGE_ID: '0xcb4fc91921494ebe6979e201fdb2d67388ffdf6a1b1eb4952526259074de8d0b',\n\tMARGIN_REGISTRY_ID: '0x0e40998b359a9ccbab22a98ed21bd4346abf19158bc7980c8291908086b3a742',\n\tLIQUIDATION_PACKAGE_ID: '0x73c593882cdb557703e903603f20bd373261fe6ba6e1a40515f4b62f10553e6a',\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\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\tXBTC: {\n\t\taddress: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50`,\n\t\ttype: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50::xbtc::XBTC`,\n\t\tscalar: 100000000,\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\tUSDE: {\n\t\taddress: `0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402`,\n\t\ttype: `0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402::sui_usde::SUI_USDE`,\n\t\tscalar: 1000000,\n\t},\n\t// This coin is experimental\n\tWGIGA: {\n\t\taddress: `0xec32640add6d02a1d5f0425d72705eb76d9de7edfd4f34e0dba68e62ecceb05b`,\n\t\ttype: `0xec32640add6d02a1d5f0425d72705eb76d9de7edfd4f34e0dba68e62ecceb05b::coin::COIN`,\n\t\tscalar: 100000,\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\tUSDE_USDC: {\n\t\taddress: '0x0fac1cebf35bde899cd9ecdd4371e0e33f44ba83b8a2902d69186646afa3a94b',\n\t\tbaseCoin: 'USDE',\n\t\tquoteCoin: 'USDC',\n\t},\n\tSUI_USDE: {\n\t\taddress: '0x034f3a42e7348de2084406db7a725f9d9d132a56c68324713e6e623601fb4fd7',\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'USDE',\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};\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,YAAY;EACZ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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,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,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;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.0.
|
|
5
|
+
"version": "1.0.7",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./dist/index.mjs",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
12
|
"types": "./dist/index.d.mts",
|
|
13
|
-
"import": "./dist/index.mjs"
|
|
13
|
+
"import": "./dist/index.mjs",
|
|
14
|
+
"default": "./dist/index.mjs"
|
|
14
15
|
}
|
|
15
16
|
},
|
|
16
17
|
"files": [
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
"@noble/hashes": "^2.0.1",
|
|
33
34
|
"axios": "^1.13.5",
|
|
34
35
|
"axios-retry": "^4.5.0",
|
|
35
|
-
"@mysten/bcs": "^2.0.
|
|
36
|
+
"@mysten/bcs": "^2.0.2"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"@iarna/toml": "^2.2.5",
|
|
@@ -45,11 +46,11 @@
|
|
|
45
46
|
"vite": "^7.3.1",
|
|
46
47
|
"vitest": "^4.0.17",
|
|
47
48
|
"wait-on": "^9.0.3",
|
|
48
|
-
"@mysten/codegen": "^0.8.
|
|
49
|
-
"@mysten/sui": "^2.3.
|
|
49
|
+
"@mysten/codegen": "^0.8.1",
|
|
50
|
+
"@mysten/sui": "^2.3.2"
|
|
50
51
|
},
|
|
51
52
|
"peerDependencies": {
|
|
52
|
-
"@mysten/sui": "^2.3.
|
|
53
|
+
"@mysten/sui": "^2.3.2"
|
|
53
54
|
},
|
|
54
55
|
"scripts": {
|
|
55
56
|
"clean": "rm -rf tsconfig.tsbuildinfo ./dist",
|
|
@@ -457,4 +457,32 @@ export class PoolProxyContract {
|
|
|
457
457
|
typeArguments: [baseCoin.type, quoteCoin.type],
|
|
458
458
|
});
|
|
459
459
|
};
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* @description Update the current price for a pool using Pyth oracle
|
|
463
|
+
* @param {string} poolKey The key to identify the pool
|
|
464
|
+
* @returns A function that takes a Transaction object
|
|
465
|
+
*/
|
|
466
|
+
updateCurrentPrice = (poolKey: string) => (tx: Transaction) => {
|
|
467
|
+
const pool = this.#config.getPool(poolKey);
|
|
468
|
+
const baseCoin = this.#config.getCoin(pool.baseCoin);
|
|
469
|
+
const quoteCoin = this.#config.getCoin(pool.quoteCoin);
|
|
470
|
+
if (!baseCoin.priceInfoObjectId) {
|
|
471
|
+
throw new Error(`Missing priceInfoObjectId for ${pool.baseCoin}`);
|
|
472
|
+
}
|
|
473
|
+
if (!quoteCoin.priceInfoObjectId) {
|
|
474
|
+
throw new Error(`Missing priceInfoObjectId for ${pool.quoteCoin}`);
|
|
475
|
+
}
|
|
476
|
+
tx.moveCall({
|
|
477
|
+
target: `${this.#config.MARGIN_PACKAGE_ID}::pool_proxy::update_current_price`,
|
|
478
|
+
arguments: [
|
|
479
|
+
tx.object(this.#config.MARGIN_REGISTRY_ID),
|
|
480
|
+
tx.object(pool.address),
|
|
481
|
+
tx.object(baseCoin.priceInfoObjectId),
|
|
482
|
+
tx.object(quoteCoin.priceInfoObjectId),
|
|
483
|
+
tx.object.clock(),
|
|
484
|
+
],
|
|
485
|
+
typeArguments: [baseCoin.type, quoteCoin.type],
|
|
486
|
+
});
|
|
487
|
+
};
|
|
460
488
|
}
|
package/src/utils/constants.ts
CHANGED
|
@@ -28,7 +28,7 @@ export const mainnetPackageIds = {
|
|
|
28
28
|
DEEPBOOK_PACKAGE_ID: '0x337f4f4f6567fcd778d5454f27c16c70e2f274cc6377ea6249ddf491482ef497',
|
|
29
29
|
REGISTRY_ID: '0xaf16199a2dff736e9f07a845f23c5da6df6f756eddb631aed9d24a93efc4549d',
|
|
30
30
|
DEEP_TREASURY_ID: '0x032abf8948dda67a271bcc18e776dbbcfb0d58c8d288a700ff0d5521e57a1ffe',
|
|
31
|
-
MARGIN_PACKAGE_ID: '
|
|
31
|
+
MARGIN_PACKAGE_ID: '0xcb4fc91921494ebe6979e201fdb2d67388ffdf6a1b1eb4952526259074de8d0b',
|
|
32
32
|
MARGIN_REGISTRY_ID: '0x0e40998b359a9ccbab22a98ed21bd4346abf19158bc7980c8291908086b3a742',
|
|
33
33
|
LIQUIDATION_PACKAGE_ID: '0x73c593882cdb557703e903603f20bd373261fe6ba6e1a40515f4b62f10553e6a',
|
|
34
34
|
} satisfies DeepbookPackageIds;
|