@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.js
CHANGED
|
@@ -1186,7 +1186,11 @@ var ClmmPoolUtil = class {
|
|
|
1186
1186
|
coinB = new decimal_default(0);
|
|
1187
1187
|
} else if (curSqrtPrice.lt(upperSqrtPrice)) {
|
|
1188
1188
|
coinA = MathUtil.toX64_Decimal(liq).mul(upperPriceStr.sub(curSqrtPriceStr)).div(curSqrtPriceStr.mul(upperPriceStr));
|
|
1189
|
-
|
|
1189
|
+
const a = curSqrtPriceStr.sub(lowerPriceStr);
|
|
1190
|
+
const b = liq.mul(a);
|
|
1191
|
+
const c = MathUtil.fromX64_Decimal(b);
|
|
1192
|
+
coinB = c;
|
|
1193
|
+
console.log("########## a, b, c", a, b, c);
|
|
1190
1194
|
} else {
|
|
1191
1195
|
coinA = new decimal_default(0);
|
|
1192
1196
|
coinB = MathUtil.fromX64_Decimal(liq.mul(upperPriceStr.sub(lowerPriceStr)));
|
|
@@ -9189,9 +9193,9 @@ var main_default = MagmaClmmSDK;
|
|
|
9189
9193
|
// src/config/mainnet.ts
|
|
9190
9194
|
var SDKConfig = {
|
|
9191
9195
|
clmmConfig: {
|
|
9192
|
-
pools_id: "
|
|
9193
|
-
global_config_id: "
|
|
9194
|
-
global_vault_id: "
|
|
9196
|
+
pools_id: "0xfa145b9de10fe858be81edd1c6cdffcf27be9d016de02a1345eb1009a68ba8b2",
|
|
9197
|
+
global_config_id: "0x4c4e1402401f72c7d8533d0ed8d5f8949da363c7a3319ccef261ffe153d32f8a",
|
|
9198
|
+
global_vault_id: "0xa7e1102f222b6eb81ccc8a126e7feb2353342be9df6f6646a77c4519da29c071",
|
|
9195
9199
|
admin_cap_id: "0x89c1a321291d15ddae5a086c9abc533dff697fde3d89e0ca836c41af73e36a75"
|
|
9196
9200
|
},
|
|
9197
9201
|
magmaConfig: {
|
|
@@ -9221,8 +9225,8 @@ var clmmMainnet = {
|
|
|
9221
9225
|
config: SDKConfig.magmaConfig
|
|
9222
9226
|
},
|
|
9223
9227
|
clmm_pool: {
|
|
9224
|
-
package_id: "
|
|
9225
|
-
published_at: "
|
|
9228
|
+
package_id: "0x4a35d3dfef55ed3631b7158544c6322a23bc434fe4fca1234cb680ce0505f82d",
|
|
9229
|
+
published_at: "0x4a35d3dfef55ed3631b7158544c6322a23bc434fe4fca1234cb680ce0505f82d",
|
|
9226
9230
|
config: SDKConfig.clmmConfig
|
|
9227
9231
|
},
|
|
9228
9232
|
distribution: {
|
|
@@ -9241,8 +9245,8 @@ var clmmMainnet = {
|
|
|
9241
9245
|
package_id: "0xac95e8a5e873cfa2544916c16fe1461b6a45542d9e65504c1794ae390b3345a7",
|
|
9242
9246
|
published_at: "0xac95e8a5e873cfa2544916c16fe1461b6a45542d9e65504c1794ae390b3345a7"
|
|
9243
9247
|
},
|
|
9244
|
-
aggregatorUrl: "https://api
|
|
9245
|
-
swapCountUrl: "https://api
|
|
9248
|
+
aggregatorUrl: "https://api.magmafinance.io/api/router",
|
|
9249
|
+
swapCountUrl: "https://api.magmafinance.io/api/v2/sui/swap/count"
|
|
9246
9250
|
};
|
|
9247
9251
|
function initMainnetSDK(fullNodeUrl, simulationAccount) {
|
|
9248
9252
|
if (fullNodeUrl) {
|