@magmaprotocol/magma-clmm-sdk 0.4.0 → 0.4.2
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/dist/index.js +12 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -983,7 +983,11 @@ var ClmmPoolUtil = class {
|
|
|
983
983
|
coinB = new decimal_default(0);
|
|
984
984
|
} else if (curSqrtPrice.lt(upperSqrtPrice)) {
|
|
985
985
|
coinA = MathUtil.toX64_Decimal(liq).mul(upperPriceStr.sub(curSqrtPriceStr)).div(curSqrtPriceStr.mul(upperPriceStr));
|
|
986
|
-
|
|
986
|
+
const a = curSqrtPriceStr.sub(lowerPriceStr);
|
|
987
|
+
const b = liq.mul(a);
|
|
988
|
+
const c = MathUtil.fromX64_Decimal(b);
|
|
989
|
+
coinB = c;
|
|
990
|
+
console.log("########## a, b, c", a, b, c);
|
|
987
991
|
} else {
|
|
988
992
|
coinA = new decimal_default(0);
|
|
989
993
|
coinB = MathUtil.fromX64_Decimal(liq.mul(upperPriceStr.sub(lowerPriceStr)));
|
|
@@ -8988,9 +8992,9 @@ var main_default = MagmaClmmSDK;
|
|
|
8988
8992
|
// src/config/mainnet.ts
|
|
8989
8993
|
var SDKConfig = {
|
|
8990
8994
|
clmmConfig: {
|
|
8991
|
-
pools_id: "
|
|
8992
|
-
global_config_id: "
|
|
8993
|
-
global_vault_id: "
|
|
8995
|
+
pools_id: "0xfa145b9de10fe858be81edd1c6cdffcf27be9d016de02a1345eb1009a68ba8b2",
|
|
8996
|
+
global_config_id: "0x4c4e1402401f72c7d8533d0ed8d5f8949da363c7a3319ccef261ffe153d32f8a",
|
|
8997
|
+
global_vault_id: "0xa7e1102f222b6eb81ccc8a126e7feb2353342be9df6f6646a77c4519da29c071",
|
|
8994
8998
|
admin_cap_id: "0x89c1a321291d15ddae5a086c9abc533dff697fde3d89e0ca836c41af73e36a75"
|
|
8995
8999
|
},
|
|
8996
9000
|
magmaConfig: {
|
|
@@ -9020,8 +9024,8 @@ var clmmMainnet = {
|
|
|
9020
9024
|
config: SDKConfig.magmaConfig
|
|
9021
9025
|
},
|
|
9022
9026
|
clmm_pool: {
|
|
9023
|
-
package_id: "
|
|
9024
|
-
published_at: "
|
|
9027
|
+
package_id: "0x4a35d3dfef55ed3631b7158544c6322a23bc434fe4fca1234cb680ce0505f82d",
|
|
9028
|
+
published_at: "0x4a35d3dfef55ed3631b7158544c6322a23bc434fe4fca1234cb680ce0505f82d",
|
|
9025
9029
|
config: SDKConfig.clmmConfig
|
|
9026
9030
|
},
|
|
9027
9031
|
distribution: {
|
|
@@ -9040,8 +9044,8 @@ var clmmMainnet = {
|
|
|
9040
9044
|
package_id: "0xac95e8a5e873cfa2544916c16fe1461b6a45542d9e65504c1794ae390b3345a7",
|
|
9041
9045
|
published_at: "0xac95e8a5e873cfa2544916c16fe1461b6a45542d9e65504c1794ae390b3345a7"
|
|
9042
9046
|
},
|
|
9043
|
-
aggregatorUrl: "https://api
|
|
9044
|
-
swapCountUrl: "https://api
|
|
9047
|
+
aggregatorUrl: "https://api.magmafinance.io/api/router",
|
|
9048
|
+
swapCountUrl: "https://api.magmafinance.io/api/v2/sui/swap/count"
|
|
9045
9049
|
};
|
|
9046
9050
|
function initMainnetSDK(fullNodeUrl, simulationAccount) {
|
|
9047
9051
|
if (fullNodeUrl) {
|