@typus/typus-perp-sdk 1.1.5 → 1.1.6

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.
@@ -1,5 +1,5 @@
1
1
  import { TOKEN } from "@typus/typus-sdk/dist/src/constants";
2
- export declare function getFromSentio(event: string, userAddress: string, startTimestamp: string): Promise<any[]>;
2
+ export declare function getFromSentio(event: string, userAddress: string, startTimestamp: string, cranker?: boolean): Promise<any[]>;
3
3
  export declare function getRecentTradesFromSentio(base_token?: TOKEN): Promise<any[]>;
4
4
  /**
5
5
  * Inputs:
@@ -51,16 +51,20 @@ var headers = {
51
51
  "api-key": "ffJa6FwxeJNrQP8NZ5doEMXqdSA7XM6mT",
52
52
  "Content-Type": "application/json",
53
53
  };
54
- function getFromSentio(event, userAddress, startTimestamp) {
54
+ function getFromSentio(event, userAddress, startTimestamp, cranker) {
55
55
  return __awaiter(this, void 0, void 0, function () {
56
- var apiUrl, requestData, jsonData, response, data;
56
+ var apiUrl, crankerFilter, requestData, jsonData, response, data;
57
57
  return __generator(this, function (_a) {
58
58
  switch (_a.label) {
59
59
  case 0:
60
60
  apiUrl = "https://app.sentio.xyz/api/v1/analytics/typus/typus_perp_mainnet/sql/execute";
61
+ crankerFilter = "";
62
+ if (cranker) {
63
+ crankerFilter = "AND is_cranker == true";
64
+ }
61
65
  requestData = {
62
66
  sqlQuery: {
63
- sql: "\n SELECT *\n FROM ".concat(event, "\n WHERE distinct_id = '").concat(userAddress, "' AND timestamp >= ").concat(startTimestamp, "\n ORDER BY timestamp DESC;\n "),
67
+ sql: "\n SELECT *\n FROM ".concat(event, "\n WHERE distinct_id = '").concat(userAddress, "' AND timestamp >= ").concat(startTimestamp, " ").concat(crankerFilter, "\n ORDER BY timestamp DESC;\n "),
64
68
  size: 1000,
65
69
  },
66
70
  };
@@ -100,7 +104,7 @@ function getRecentTradesFromSentio(base_token) {
100
104
  }
101
105
  requestData = {
102
106
  sqlQuery: {
103
- sql: "\n SELECT * FROM (\n SELECT\n PlaceOrder.timestamp as timestamp,\n PlaceOrder.base_token as base_token,\n PlaceOrder.collateral_token as collateral_token,\n PlaceOrder.order_type as order_type,\n OrderFilled.order_type as status,\n PlaceOrder.side as side,\n PlaceOrder.distinct_id as distinct_id,\n price,\n size,\n realized_amount-realized_fee-RealizeFunding.realized_funding_fee as realized_pnl,\n OrderFilled.realized_pnl-RealizeFunding.realized_funding_fee_usd as realized_pnl_usd,\n CASE\n WHEN PlaceOrder.collateral > 0 THEN PlaceOrder.collateral\n WHEN RemovePosition.remaining_collateral_amount > 0 AND realized_pnl_usd >= 0 THEN RemovePosition.remaining_collateral_amount\n WHEN RemovePosition.remaining_collateral_amount > 0 AND realized_pnl_usd < 0 THEN RemovePosition.remaining_collateral_amount - realized_pnl_usd\n ELSE 0\n END AS collateral_amount,\n PlaceOrder.transaction_hash as transaction_hash\n FROM PlaceOrder\n LEFT JOIN OrderFilled ON OrderFilled.order_id == PlaceOrder.order_id AND OrderFilled.base_token == PlaceOrder.base_token\n LEFT JOIN RealizeFunding ON RealizeFunding.position_id == OrderFilled.position_id AND RealizeFunding.base_token == OrderFilled.base_token AND RealizeFunding.transaction_hash == OrderFilled.transaction_hash\n LEFT JOIN RealizeOption ON RealizeOption.position_id == OrderFilled.position_id AND RealizeOption.base_token == OrderFilled.base_token AND RealizeOption.transaction_hash == OrderFilled.transaction_hash\n LEFT JOIN RemovePosition ON RemovePosition.transaction_hash == OrderFilled.transaction_hash\n ".concat(tokenFilter, "\n UNION ALL\n SELECT\n PlaceOrderWithBidReceipt.timestamp as timestamp,\n PlaceOrderWithBidReceipt.base_token as base_token,\n PlaceOrderWithBidReceipt.collateral_token as collateral_token,\n PlaceOrderWithBidReceipt.order_type as order_type,\n OrderFilled.order_type as status,\n PlaceOrderWithBidReceipt.side as side,\n PlaceOrderWithBidReceipt.distinct_id as distinct_id,\n price,\n size,\n realized_amount-realized_fee-RealizeFunding.realized_funding_fee as realized_pnl,\n OrderFilled.realized_pnl-RealizeFunding.realized_funding_fee_usd as realized_pnl_usd,\n RealizeOption.exercise_balance_value as collateral_amount,\n PlaceOrderWithBidReceipt.transaction_hash as transaction_hash\n FROM PlaceOrderWithBidReceipt\n JOIN OrderFilled ON OrderFilled.order_id == PlaceOrderWithBidReceipt.order_id AND OrderFilled.base_token == PlaceOrderWithBidReceipt.base_token\n LEFT JOIN RealizeFunding ON RealizeFunding.position_id == OrderFilled.position_id AND RealizeFunding.base_token == OrderFilled.base_token AND RealizeFunding.transaction_hash == OrderFilled.transaction_hash\n LEFT JOIN RealizeOption ON RealizeOption.position_id == OrderFilled.position_id AND RealizeOption.base_token == OrderFilled.base_token AND RealizeOption.transaction_hash == OrderFilled.transaction_hash\n ").concat(tokenFilter, "\n ) AS combined\n ORDER BY timestamp DESC\n "),
107
+ sql: "\n SELECT * FROM (\n WITH\n OpenOrder AS (\n SELECT\n PlaceOrder.collateral AS collateral,\n OrderFilled.position_id AS position_id,\n OrderFilled.base_token AS base_token,\n PlaceOrder.transaction_hash as transaction_hash\n FROM PlaceOrder\n JOIN OrderFilled ON OrderFilled.order_id == PlaceOrder.order_id AND OrderFilled.base_token == PlaceOrder.base_token\n WHERE OrderFilled.order_type == 'Open'\n )\n SELECT\n PlaceOrder.timestamp as timestamp,\n PlaceOrder.base_token as base_token,\n PlaceOrder.collateral_token as collateral_token,\n PlaceOrder.order_type as order_type,\n OrderFilled.order_type as status,\n PlaceOrder.side as side,\n PlaceOrder.distinct_id as distinct_id,\n price,\n size,\n realized_amount-realized_fee-RealizeFunding.realized_funding_fee as realized_pnl,\n OrderFilled.realized_pnl-RealizeFunding.realized_funding_fee_usd as realized_pnl_usd,\n OpenOrder.collateral as collateral,\n PlaceOrder.transaction_hash as transaction_hash\n FROM PlaceOrder\n LEFT JOIN OrderFilled ON OrderFilled.order_id == PlaceOrder.order_id AND OrderFilled.base_token == PlaceOrder.base_token\n LEFT JOIN RealizeFunding ON RealizeFunding.position_id == OrderFilled.position_id AND RealizeFunding.base_token == OrderFilled.base_token AND RealizeFunding.transaction_hash == OrderFilled.transaction_hash\n LEFT JOIN RealizeOption ON RealizeOption.position_id == OrderFilled.position_id AND RealizeOption.base_token == OrderFilled.base_token AND RealizeOption.transaction_hash == OrderFilled.transaction_hash\n LEFT JOIN RemovePosition ON RemovePosition.transaction_hash == OrderFilled.transaction_hash\n LEFT JOIN OpenOrder ON OpenOrder.position_id == OrderFilled.position_id AND OpenOrder.base_token == PlaceOrder.base_token\n ".concat(tokenFilter, "\n UNION ALL\n SELECT\n PlaceOrderWithBidReceipt.timestamp as timestamp,\n PlaceOrderWithBidReceipt.base_token as base_token,\n PlaceOrderWithBidReceipt.collateral_token as collateral_token,\n PlaceOrderWithBidReceipt.order_type as order_type,\n OrderFilled.order_type as status,\n PlaceOrderWithBidReceipt.side as side,\n PlaceOrderWithBidReceipt.distinct_id as distinct_id,\n price,\n size,\n realized_amount-realized_fee-RealizeFunding.realized_funding_fee as realized_pnl,\n OrderFilled.realized_pnl-RealizeFunding.realized_funding_fee_usd as realized_pnl_usd,\n RealizeOption.exercise_balance_value as collateral_amount,\n PlaceOrderWithBidReceipt.transaction_hash as transaction_hash\n FROM PlaceOrderWithBidReceipt\n JOIN OrderFilled ON OrderFilled.order_id == PlaceOrderWithBidReceipt.order_id AND OrderFilled.base_token == PlaceOrderWithBidReceipt.base_token\n LEFT JOIN RealizeFunding ON RealizeFunding.position_id == OrderFilled.position_id AND RealizeFunding.base_token == OrderFilled.base_token AND RealizeFunding.transaction_hash == OrderFilled.transaction_hash\n LEFT JOIN RealizeOption ON RealizeOption.position_id == OrderFilled.position_id AND RealizeOption.base_token == OrderFilled.base_token AND RealizeOption.transaction_hash == OrderFilled.transaction_hash\n ").concat(tokenFilter, "\n ) AS combined\n ORDER BY timestamp DESC\n "),
104
108
  size: 100,
105
109
  },
106
110
  };
@@ -34,7 +34,15 @@ export declare function getDeactivatingShares(config: TypusConfig, user: string)
34
34
  export declare function getLiquidationPriceAndPnl(config: TypusConfig, pythClient: PythClient, input: {
35
35
  positions: Position[];
36
36
  user: string;
37
- }): Promise<(string | number)[][] | undefined>;
37
+ }): Promise<PositionInfo[]>;
38
+ interface PositionInfo {
39
+ liquidationPrice: number;
40
+ pnl: number;
41
+ fundingFee: number;
42
+ borrowFee: number;
43
+ closeFee: number;
44
+ pnlAfterFee: number;
45
+ }
38
46
  export declare function getPositionCount(config: TypusConfig, input: {
39
47
  baseToken: TOKEN;
40
48
  }): Promise<number>;
@@ -46,3 +54,4 @@ export declare function getAllPositions(config: TypusConfig, input: {
46
54
  export declare function getAllPositionsWithTradingSymbol(config: TypusConfig, input: {
47
55
  baseToken: TOKEN;
48
56
  }): Promise<Position[]>;
57
+ export {};
package/dist/src/fetch.js CHANGED
@@ -448,9 +448,8 @@ function getLiquidationPriceAndPnl(config, pythClient, input) {
448
448
  return __awaiter(this, void 0, void 0, function () {
449
449
  var provider, tx, tokens, _a, _b, position, TOKEN, BASE_TOKEN, _c, _d, token, _e, _f, position, TOKEN, BASE_TOKEN, res, results;
450
450
  var e_3, _g, e_4, _h, e_5, _j;
451
- var _k;
452
- return __generator(this, function (_l) {
453
- switch (_l.label) {
451
+ return __generator(this, function (_k) {
452
+ switch (_k.label) {
454
453
  case 0:
455
454
  provider = new client_1.SuiClient({ url: config.rpcEndpoint });
456
455
  tx = new transactions_1.Transaction();
@@ -473,7 +472,7 @@ function getLiquidationPriceAndPnl(config, pythClient, input) {
473
472
  }
474
473
  return [4 /*yield*/, (0, utils_1.updatePyth)(pythClient, tx, Array.from(new Set(tokens)))];
475
474
  case 1:
476
- _l.sent();
475
+ _k.sent();
477
476
  try {
478
477
  for (_c = __values(Array.from(new Set(tokens))), _d = _c.next(); !_d.done; _d = _c.next()) {
479
478
  token = _d.value;
@@ -515,17 +514,31 @@ function getLiquidationPriceAndPnl(config, pythClient, input) {
515
514
  }
516
515
  return [4 /*yield*/, provider.devInspectTransactionBlock({ sender: input.user, transactionBlock: tx })];
517
516
  case 2:
518
- res = _l.sent();
519
- results = (_k = res.results) === null || _k === void 0 ? void 0 : _k.slice(-input.positions.length).map(function (x) {
517
+ res = _k.sent();
518
+ results = res.results.slice(-input.positions.length).map(function (x) {
520
519
  // console.log(x);
521
- var liquidationPrice = bcs_1.bcs.u64().parse(Uint8Array.from(x.returnValues[0][0]));
520
+ var liquidationPrice = Number(bcs_1.bcs.u64().parse(Uint8Array.from(x.returnValues[0][0])));
522
521
  var isProfit = bcs_1.bcs.bool().parse(Uint8Array.from(x.returnValues[1][0]));
523
522
  var pnl = Number(bcs_1.bcs.u64().parse(Uint8Array.from(x.returnValues[2][0])));
524
523
  pnl = isProfit ? pnl : -pnl;
524
+ // including closeFee
525
525
  var isCost = bcs_1.bcs.bool().parse(Uint8Array.from(x.returnValues[3][0]));
526
526
  var cost = Number(bcs_1.bcs.u64().parse(Uint8Array.from(x.returnValues[4][0])));
527
527
  cost = isCost ? cost : -cost;
528
- return [liquidationPrice, pnl - cost];
528
+ // cost = unrealized_loss + unrealized_trading_fee + unrealized_borrow_fee + unrealized_funding_fee;
529
+ var fundingFeeSign = bcs_1.bcs.bool().parse(Uint8Array.from(x.returnValues[5][0]));
530
+ var fundingFee = Number(bcs_1.bcs.u64().parse(Uint8Array.from(x.returnValues[6][0])));
531
+ fundingFee = fundingFeeSign ? fundingFee : -fundingFee;
532
+ var borrowFee = Number(bcs_1.bcs.u64().parse(Uint8Array.from(x.returnValues[7][0])));
533
+ var closeFee = Number(bcs_1.bcs.u64().parse(Uint8Array.from(x.returnValues[8][0])));
534
+ return {
535
+ liquidationPrice: liquidationPrice,
536
+ pnl: pnl + closeFee,
537
+ fundingFee: fundingFee,
538
+ borrowFee: borrowFee,
539
+ closeFee: closeFee,
540
+ pnlAfterFee: pnl - cost,
541
+ };
529
542
  });
530
543
  // console.log(results);
531
544
  return [2 /*return*/, results];
package/dist/src/index.js CHANGED
@@ -36,7 +36,7 @@ transactions_1.Transaction.registerGlobalSerializationPlugin("namedPackagesPlugi
36
36
  exports.PERP_PACKAGE_ID = exports.NETWORK == "MAINNET"
37
37
  ? "0xe27969a70f93034de9ce16e6ad661b480324574e68d15a64b513fd90eb2423e5"
38
38
  : "0x585924f160f83ef16f8927ec117e4d740abb6f4e571ecfa89ff3e973042cb1b9";
39
- exports.PERP_PUBLISHED_AT = exports.NETWORK == "MAINNET" ? "0xb52138bfce4e79d0d25c69b1d9dfe6ec81a821ed3ef03cdb1c077cb4ac9c9b9d" : "@typus/perp";
39
+ exports.PERP_PUBLISHED_AT = exports.NETWORK == "MAINNET" ? "0x5687fc97b7a4adc65c282f1e4d7d1154c30a27cfdbbb9571481dcbacb50dd754" : "@typus/perp";
40
40
  exports.PERP_PKG_V1 = exports.NETWORK == "MAINNET"
41
41
  ? "0xe27969a70f93034de9ce16e6ad661b480324574e68d15a64b513fd90eb2423e5"
42
42
  : "0x585924f160f83ef16f8927ec117e4d740abb6f4e571ecfa89ff3e973042cb1b9";
@@ -110,6 +110,17 @@ export interface ClaimArgs {
110
110
  clock: TransactionObjectInput;
111
111
  }
112
112
  export declare function claim(tx: Transaction, typeArgs: [string, string], args: ClaimArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
113
+ export interface CompleteRebalancingArgs {
114
+ version: TransactionObjectInput;
115
+ registry: TransactionObjectInput;
116
+ index: bigint | TransactionArgument;
117
+ oracleTokenA: TransactionObjectInput;
118
+ oracleTokenB: TransactionObjectInput;
119
+ swappedBackBalance: TransactionObjectInput;
120
+ rebalanceProcess: TransactionObjectInput;
121
+ clock: TransactionObjectInput;
122
+ }
123
+ export declare function completeRebalancing(tx: Transaction, typeArgs: [string, string], args: CompleteRebalancingArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
113
124
  export interface CompleteRemoveLiquidityTokenProcessArgs {
114
125
  version: TransactionObjectInput;
115
126
  registry: TransactionObjectInput;
@@ -168,6 +179,12 @@ export interface GetMutTokenPoolArgs {
168
179
  tokenType: TransactionObjectInput;
169
180
  }
170
181
  export declare function getMutTokenPool(tx: Transaction, args: GetMutTokenPoolArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
182
+ export interface GetPoolLiquidityArgs {
183
+ version: TransactionObjectInput;
184
+ registry: TransactionObjectInput;
185
+ index: bigint | TransactionArgument;
186
+ }
187
+ export declare function getPoolLiquidity(tx: Transaction, args: GetPoolLiquidityArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
171
188
  export declare function getReceiptCollateral(tx: Transaction, liquidityPool: TransactionObjectInput, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
172
189
  export interface GetReceiptCollateralBcsArgs {
173
190
  registry: TransactionObjectInput;
@@ -280,6 +297,16 @@ export interface PutReceiptCollateralsArgs {
280
297
  unsettledBidReceipts: Array<TransactionObjectInput> | TransactionArgument;
281
298
  }
282
299
  export declare function putReceiptCollaterals(tx: Transaction, args: PutReceiptCollateralsArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
300
+ export interface RebalanceArgs {
301
+ version: TransactionObjectInput;
302
+ registry: TransactionObjectInput;
303
+ index: bigint | TransactionArgument;
304
+ oracleTokenA: TransactionObjectInput;
305
+ oracleTokenB: TransactionObjectInput;
306
+ rebalanceAmount: bigint | TransactionArgument;
307
+ clock: TransactionObjectInput;
308
+ }
309
+ export declare function rebalance(tx: Transaction, typeArgs: [string, string], args: RebalanceArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
283
310
  export interface RedeemArgs {
284
311
  version: TransactionObjectInput;
285
312
  registry: TransactionObjectInput;
@@ -367,6 +394,13 @@ export interface UpdateMarginConfigArgs {
367
394
  maxOrderReserveRatioBp: bigint | TransactionArgument | TransactionArgument | null;
368
395
  }
369
396
  export declare function updateMarginConfig(tx: Transaction, typeArg: string, args: UpdateMarginConfigArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
397
+ export interface UpdateRebalanceCostThresholdBpArgs {
398
+ version: TransactionObjectInput;
399
+ registry: TransactionObjectInput;
400
+ index: bigint | TransactionArgument;
401
+ rebalanceCostThresholdBp: bigint | TransactionArgument;
402
+ }
403
+ export declare function updateRebalanceCostThresholdBp(tx: Transaction, args: UpdateRebalanceCostThresholdBpArgs, published_at?: string): import("@mysten/sui/transactions").TransactionResult;
370
404
  export interface UpdateRemoveLiquidityTokenProcessStatusArgs {
371
405
  process: TransactionObjectInput;
372
406
  targetStatusCode: bigint | TransactionArgument;
@@ -12,6 +12,7 @@ exports.checkTokenPoolStatus = checkTokenPoolStatus;
12
12
  exports.checkTradingOrderSizeValid = checkTradingOrderSizeValid;
13
13
  exports.checkTvlUpdated = checkTvlUpdated;
14
14
  exports.claim = claim;
15
+ exports.completeRebalancing = completeRebalancing;
15
16
  exports.completeRemoveLiquidityTokenProcess = completeRemoveLiquidityTokenProcess;
16
17
  exports.createDeactivatingShares = createDeactivatingShares;
17
18
  exports.deprecated = deprecated;
@@ -24,6 +25,7 @@ exports.getLiquidityTokenDecimal = getLiquidityTokenDecimal;
24
25
  exports.getLpTokenType = getLpTokenType;
25
26
  exports.getMutLiquidityPool = getMutLiquidityPool;
26
27
  exports.getMutTokenPool = getMutTokenPool;
28
+ exports.getPoolLiquidity = getPoolLiquidity;
27
29
  exports.getReceiptCollateral = getReceiptCollateral;
28
30
  exports.getReceiptCollateralBcs = getReceiptCollateralBcs;
29
31
  exports.getRemoveLiquidityTokenProcessToken = getRemoveLiquidityTokenProcessToken;
@@ -43,6 +45,7 @@ exports.oracleMatched = oracleMatched;
43
45
  exports.orderFilled = orderFilled;
44
46
  exports.putCollateral = putCollateral;
45
47
  exports.putReceiptCollaterals = putReceiptCollaterals;
48
+ exports.rebalance = rebalance;
46
49
  exports.redeem = redeem;
47
50
  exports.requestCollateral = requestCollateral;
48
51
  exports.resumePool = resumePool;
@@ -56,6 +59,7 @@ exports.tokenPoolIsActive = tokenPoolIsActive;
56
59
  exports.updateBorrowInfo = updateBorrowInfo;
57
60
  exports.updateLiquidityValue = updateLiquidityValue;
58
61
  exports.updateMarginConfig = updateMarginConfig;
62
+ exports.updateRebalanceCostThresholdBp = updateRebalanceCostThresholdBp;
59
63
  exports.updateRemoveLiquidityTokenProcessStatus = updateRemoveLiquidityTokenProcessStatus;
60
64
  exports.updateRemoveLiquidityTokenProcessToken = updateRemoveLiquidityTokenProcessToken;
61
65
  exports.updateReserveAmount = updateReserveAmount;
@@ -229,6 +233,23 @@ function claim(tx, typeArgs, args, published_at) {
229
233
  ],
230
234
  });
231
235
  }
236
+ function completeRebalancing(tx, typeArgs, args, published_at) {
237
+ if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
238
+ return tx.moveCall({
239
+ target: "".concat(published_at, "::lp_pool::complete_rebalancing"),
240
+ typeArguments: typeArgs,
241
+ arguments: [
242
+ (0, util_1.obj)(tx, args.version),
243
+ (0, util_1.obj)(tx, args.registry),
244
+ (0, util_1.pure)(tx, args.index, "u64"),
245
+ (0, util_1.obj)(tx, args.oracleTokenA),
246
+ (0, util_1.obj)(tx, args.oracleTokenB),
247
+ (0, util_1.obj)(tx, args.swappedBackBalance),
248
+ (0, util_1.obj)(tx, args.rebalanceProcess),
249
+ (0, util_1.obj)(tx, args.clock),
250
+ ],
251
+ });
252
+ }
232
253
  function completeRemoveLiquidityTokenProcess(tx, typeArg, args, published_at) {
233
254
  if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
234
255
  return tx.moveCall({
@@ -309,6 +330,13 @@ function getMutTokenPool(tx, args, published_at) {
309
330
  arguments: [(0, util_1.obj)(tx, args.liquidityPool), (0, util_1.obj)(tx, args.tokenType)],
310
331
  });
311
332
  }
333
+ function getPoolLiquidity(tx, args, published_at) {
334
+ if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
335
+ return tx.moveCall({
336
+ target: "".concat(published_at, "::lp_pool::get_pool_liquidity"),
337
+ arguments: [(0, util_1.obj)(tx, args.version), (0, util_1.obj)(tx, args.registry), (0, util_1.pure)(tx, args.index, "u64")],
338
+ });
339
+ }
312
340
  function getReceiptCollateral(tx, liquidityPool, published_at) {
313
341
  if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
314
342
  return tx.moveCall({ target: "".concat(published_at, "::lp_pool::get_receipt_collateral"), arguments: [(0, util_1.obj)(tx, liquidityPool)] });
@@ -481,6 +509,22 @@ function putReceiptCollaterals(tx, args, published_at) {
481
509
  arguments: [(0, util_1.obj)(tx, args.liquidityPool), (0, util_1.vector)(tx, "".concat(structs_2.UnsettledBidReceipt.$typeName), args.unsettledBidReceipts)],
482
510
  });
483
511
  }
512
+ function rebalance(tx, typeArgs, args, published_at) {
513
+ if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
514
+ return tx.moveCall({
515
+ target: "".concat(published_at, "::lp_pool::rebalance"),
516
+ typeArguments: typeArgs,
517
+ arguments: [
518
+ (0, util_1.obj)(tx, args.version),
519
+ (0, util_1.obj)(tx, args.registry),
520
+ (0, util_1.pure)(tx, args.index, "u64"),
521
+ (0, util_1.obj)(tx, args.oracleTokenA),
522
+ (0, util_1.obj)(tx, args.oracleTokenB),
523
+ (0, util_1.pure)(tx, args.rebalanceAmount, "u64"),
524
+ (0, util_1.obj)(tx, args.clock),
525
+ ],
526
+ });
527
+ }
484
528
  function redeem(tx, typeArg, args, published_at) {
485
529
  if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
486
530
  return tx.moveCall({
@@ -599,6 +643,18 @@ function updateMarginConfig(tx, typeArg, args, published_at) {
599
643
  ],
600
644
  });
601
645
  }
646
+ function updateRebalanceCostThresholdBp(tx, args, published_at) {
647
+ if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
648
+ return tx.moveCall({
649
+ target: "".concat(published_at, "::lp_pool::update_rebalance_cost_threshold_bp"),
650
+ arguments: [
651
+ (0, util_1.obj)(tx, args.version),
652
+ (0, util_1.obj)(tx, args.registry),
653
+ (0, util_1.pure)(tx, args.index, "u64"),
654
+ (0, util_1.pure)(tx, args.rebalanceCostThresholdBp, "u64"),
655
+ ],
656
+ });
657
+ }
602
658
  function updateRemoveLiquidityTokenProcessStatus(tx, args, published_at) {
603
659
  if (published_at === void 0) { published_at = __1.PUBLISHED_AT; }
604
660
  return tx.moveCall({