@cetusprotocol/dlmm-sdk 0.0.7 → 0.0.8

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/README.md CHANGED
@@ -296,18 +296,6 @@ const tx = await sdk.Position.collectRewardAndFeePayload([{
296
296
  coin_type_b
297
297
  }])
298
298
 
299
- // Simulate or send the transaction
300
- const sim_result = await sdk.FullClient.sendSimulationTransaction(tx, wallet)
301
- ```
302
- 2. **Collect Partner ref fee**:
303
- ```typescript
304
- // Build collect fee and reward transaction
305
- const tx = await sdk.Position.claimRefFeePayload({
306
- partner_id: "0x..",
307
- partner_cap_id: "0x..", // Optional parameter
308
- fee_coin_types: [coin_type]
309
- })
310
-
311
299
  // Simulate or send the transaction
312
300
  const sim_result = await sdk.FullClient.sendSimulationTransaction(tx, wallet)
313
301
  ```
@@ -759,17 +747,28 @@ const tx = sdk.Partner.createPartnerPayload({
759
747
 
760
748
  // Update referral fee rate
761
749
  const updateFeeTx = await sdk.Partner.updateRefFeeRatePayload({
762
- partner_id: '0x9d171399393e3cbedffc24269eb606e735fb56fee17c15153eb5e2d5274a3677',
750
+ partner_id: '0x..',
763
751
  ref_fee_rate: 0.02,
764
752
  })
765
753
 
766
754
  // Update time range
767
755
  const start_time = Math.floor(Date.now() / 1000)
768
756
  const updateTimeTx = await sdk.Partner.updateTimeRangePayload({
769
- partner_id: '0x9d171399393e3cbedffc24269eb606e735fb56fee17c15153eb5e2d5274a3677',
757
+ partner_id: '0x..',
770
758
  start_time,
771
759
  end_time: start_time + 10 * 7 * 24 * 3600,
772
760
  })
761
+
762
+ // claim ref fee
763
+ const tx = await sdk.Position.claimRefFeePayload({
764
+ partner_id: "0x..",
765
+ partner_cap_id: "0x..", // Optional parameter
766
+ fee_coin_types: [coin_type]
767
+ })
768
+
769
+ // Simulate or send the transaction
770
+ const sim_result = await sdk.FullClient.sendSimulationTransaction(tx, wallet)
771
+
773
772
  ```
774
773
 
775
774
  ### 7. Reward Operations
package/dist/index.d.mts CHANGED
@@ -1023,6 +1023,44 @@ declare class FeeUtils {
1023
1023
  };
1024
1024
  }
1025
1025
 
1026
+ type IlmInputOptions = {
1027
+ curvature: number;
1028
+ initial_price: string;
1029
+ max_price: string;
1030
+ bin_step: number;
1031
+ total_supply: string;
1032
+ pool_share_percentage: number;
1033
+ config: {
1034
+ price_curve_points_num: number;
1035
+ liquidity_distribution_num: number;
1036
+ tokens_table_num: number;
1037
+ price_table_num: number;
1038
+ };
1039
+ };
1040
+ type Axis = {
1041
+ x: string;
1042
+ y: string;
1043
+ };
1044
+ type TokenTable = {
1045
+ withdrawn: string;
1046
+ price: string;
1047
+ usdc_in_pool: string;
1048
+ };
1049
+ type IlmInputResult = {
1050
+ price_curve: Axis[];
1051
+ liquidity_curve: Axis[];
1052
+ dlmm_bins: Axis[];
1053
+ tokens_table: TokenTable[];
1054
+ price_table: TokenTable[];
1055
+ initial_fdv: string;
1056
+ final_fdv: string;
1057
+ usdc_in_pool: string;
1058
+ };
1059
+
1060
+ declare class IlmUtils {
1061
+ static calculateIlm(options: IlmInputOptions): IlmInputResult;
1062
+ }
1063
+
1026
1064
  declare const MAX_BIN_PER_POSITION = 1000;
1027
1065
  declare const MIN_BIN_ID = -443636;
1028
1066
  declare const MAX_BIN_ID = 443636;
@@ -1040,4 +1078,4 @@ declare const dlmmMainnet: SdkOptions;
1040
1078
 
1041
1079
  declare const dlmmTestnet: SdkOptions;
1042
1080
 
1043
- export { type AddLiquidityOption, type AddRewardOption, BASIS_POINT, BASIS_POINT_MAX, BIN_BOUND, type BaseAddLiquidityOption, type BaseCalculateAddLiquidityOption, type BaseCreatePoolAndAddOption, type BaseCreatePoolOption, type BinAmount, type BinLiquidityInfo, type BinManager, type BinStepConfig, type BinSwap, BinUtils, type BinWeight, type CalculateAddLiquidityAutoFillOption, type CalculateAddLiquidityOption, type CalculateRemoveLiquidityBothOption, type CalculateRemoveLiquidityOnlyOption, CetusDlmmSDK, type ClaimRefFeeOption, type ClosePositionOption, type CollectFeeOption, type CollectRewardAndFeeOption, type CollectRewardOption, type CreatePartnerOption, type CreatePoolAndAddOption, type CreatePoolAndAddWithPriceOption, type CreatePoolOption, DEFAULT_MAX_WEIGHT, DEFAULT_MIN_WEIGHT, type DlmmBasePool, type DlmmConfigs, type DlmmGlobalConfig, type DlmmPool, type DlmmPosition, FEE_PRECISION, type FeeRate, FeeUtils, type GetPoolBinInfoOption, type GetTotalFeeRateOption, type InitRewardOption, MAX_BIN_ID, MAX_BIN_PER_POSITION, MAX_FEE_RATE, MIN_BIN_ID, ONE, type OpenAndAddLiquidityOption, type OpenAndAddLiquidityWithPriceOption, type OpenPositionOption, type Partner, PoolModule, type PoolPermissions, type PoolTransactionInfo, type PositionFee, type PositionManager, type PositionReward, type PreSwapOption, type PreSwapQuote, REWARD_PERIOD, REWARD_PERIOD_START_AT, type RemoveLiquidityOption, type Reward, type RewardAccessOption, type RewardInfo, type RewardManager, type RewardPeriodEmission, type RewardPeriodEmissionFormat, type RewardWhiteListOption, SCALE_OFFSET, type SdkOptions, StrategyType, StrategyUtils, type SwapOption, type UpdatePositionFeeAndRewardsOption, type UpdateRefFeeRateOption, type UpdateTimeRangeOption, type ValidateActiveIdSlippageOption, type VariableParameters, WeightUtils, type WeightsInfo, type WeightsOptions, buildPoolKey, CetusDlmmSDK as default, dlmmMainnet, dlmmTestnet, generateRewardSchedule, getRouterModule, parseBinInfo, parseBinInfoList, parseCurrentRewardPeriodEmission, parseDlmmBasePool, parseDlmmPool, parseDlmmPosition, parseLiquidityShares, parsePartner, parsePoolTransactionInfo, parseRewardPeriodEmission, parseStrategyType, parsedDlmmPosFeeData, parsedDlmmPosRewardData, parsedSwapQuoteData, poolFilterEvenTypes, safeAmount, safeMulAmount };
1081
+ export { type AddLiquidityOption, type AddRewardOption, type Axis, BASIS_POINT, BASIS_POINT_MAX, BIN_BOUND, type BaseAddLiquidityOption, type BaseCalculateAddLiquidityOption, type BaseCreatePoolAndAddOption, type BaseCreatePoolOption, type BinAmount, type BinLiquidityInfo, type BinManager, type BinStepConfig, type BinSwap, BinUtils, type BinWeight, type CalculateAddLiquidityAutoFillOption, type CalculateAddLiquidityOption, type CalculateRemoveLiquidityBothOption, type CalculateRemoveLiquidityOnlyOption, CetusDlmmSDK, type ClaimRefFeeOption, type ClosePositionOption, type CollectFeeOption, type CollectRewardAndFeeOption, type CollectRewardOption, type CreatePartnerOption, type CreatePoolAndAddOption, type CreatePoolAndAddWithPriceOption, type CreatePoolOption, DEFAULT_MAX_WEIGHT, DEFAULT_MIN_WEIGHT, type DlmmBasePool, type DlmmConfigs, type DlmmGlobalConfig, type DlmmPool, type DlmmPosition, FEE_PRECISION, type FeeRate, FeeUtils, type GetPoolBinInfoOption, type GetTotalFeeRateOption, type IlmInputOptions, type IlmInputResult, IlmUtils, type InitRewardOption, MAX_BIN_ID, MAX_BIN_PER_POSITION, MAX_FEE_RATE, MIN_BIN_ID, ONE, type OpenAndAddLiquidityOption, type OpenAndAddLiquidityWithPriceOption, type OpenPositionOption, type Partner, PoolModule, type PoolPermissions, type PoolTransactionInfo, type PositionFee, type PositionManager, type PositionReward, type PreSwapOption, type PreSwapQuote, REWARD_PERIOD, REWARD_PERIOD_START_AT, type RemoveLiquidityOption, type Reward, type RewardAccessOption, type RewardInfo, type RewardManager, type RewardPeriodEmission, type RewardPeriodEmissionFormat, type RewardWhiteListOption, SCALE_OFFSET, type SdkOptions, StrategyType, StrategyUtils, type SwapOption, type TokenTable, type UpdatePositionFeeAndRewardsOption, type UpdateRefFeeRateOption, type UpdateTimeRangeOption, type ValidateActiveIdSlippageOption, type VariableParameters, WeightUtils, type WeightsInfo, type WeightsOptions, buildPoolKey, CetusDlmmSDK as default, dlmmMainnet, dlmmTestnet, generateRewardSchedule, getRouterModule, parseBinInfo, parseBinInfoList, parseCurrentRewardPeriodEmission, parseDlmmBasePool, parseDlmmPool, parseDlmmPosition, parseLiquidityShares, parsePartner, parsePoolTransactionInfo, parseRewardPeriodEmission, parseStrategyType, parsedDlmmPosFeeData, parsedDlmmPosRewardData, parsedSwapQuoteData, poolFilterEvenTypes, safeAmount, safeMulAmount };
package/dist/index.d.ts CHANGED
@@ -1023,6 +1023,44 @@ declare class FeeUtils {
1023
1023
  };
1024
1024
  }
1025
1025
 
1026
+ type IlmInputOptions = {
1027
+ curvature: number;
1028
+ initial_price: string;
1029
+ max_price: string;
1030
+ bin_step: number;
1031
+ total_supply: string;
1032
+ pool_share_percentage: number;
1033
+ config: {
1034
+ price_curve_points_num: number;
1035
+ liquidity_distribution_num: number;
1036
+ tokens_table_num: number;
1037
+ price_table_num: number;
1038
+ };
1039
+ };
1040
+ type Axis = {
1041
+ x: string;
1042
+ y: string;
1043
+ };
1044
+ type TokenTable = {
1045
+ withdrawn: string;
1046
+ price: string;
1047
+ usdc_in_pool: string;
1048
+ };
1049
+ type IlmInputResult = {
1050
+ price_curve: Axis[];
1051
+ liquidity_curve: Axis[];
1052
+ dlmm_bins: Axis[];
1053
+ tokens_table: TokenTable[];
1054
+ price_table: TokenTable[];
1055
+ initial_fdv: string;
1056
+ final_fdv: string;
1057
+ usdc_in_pool: string;
1058
+ };
1059
+
1060
+ declare class IlmUtils {
1061
+ static calculateIlm(options: IlmInputOptions): IlmInputResult;
1062
+ }
1063
+
1026
1064
  declare const MAX_BIN_PER_POSITION = 1000;
1027
1065
  declare const MIN_BIN_ID = -443636;
1028
1066
  declare const MAX_BIN_ID = 443636;
@@ -1040,4 +1078,4 @@ declare const dlmmMainnet: SdkOptions;
1040
1078
 
1041
1079
  declare const dlmmTestnet: SdkOptions;
1042
1080
 
1043
- export { type AddLiquidityOption, type AddRewardOption, BASIS_POINT, BASIS_POINT_MAX, BIN_BOUND, type BaseAddLiquidityOption, type BaseCalculateAddLiquidityOption, type BaseCreatePoolAndAddOption, type BaseCreatePoolOption, type BinAmount, type BinLiquidityInfo, type BinManager, type BinStepConfig, type BinSwap, BinUtils, type BinWeight, type CalculateAddLiquidityAutoFillOption, type CalculateAddLiquidityOption, type CalculateRemoveLiquidityBothOption, type CalculateRemoveLiquidityOnlyOption, CetusDlmmSDK, type ClaimRefFeeOption, type ClosePositionOption, type CollectFeeOption, type CollectRewardAndFeeOption, type CollectRewardOption, type CreatePartnerOption, type CreatePoolAndAddOption, type CreatePoolAndAddWithPriceOption, type CreatePoolOption, DEFAULT_MAX_WEIGHT, DEFAULT_MIN_WEIGHT, type DlmmBasePool, type DlmmConfigs, type DlmmGlobalConfig, type DlmmPool, type DlmmPosition, FEE_PRECISION, type FeeRate, FeeUtils, type GetPoolBinInfoOption, type GetTotalFeeRateOption, type InitRewardOption, MAX_BIN_ID, MAX_BIN_PER_POSITION, MAX_FEE_RATE, MIN_BIN_ID, ONE, type OpenAndAddLiquidityOption, type OpenAndAddLiquidityWithPriceOption, type OpenPositionOption, type Partner, PoolModule, type PoolPermissions, type PoolTransactionInfo, type PositionFee, type PositionManager, type PositionReward, type PreSwapOption, type PreSwapQuote, REWARD_PERIOD, REWARD_PERIOD_START_AT, type RemoveLiquidityOption, type Reward, type RewardAccessOption, type RewardInfo, type RewardManager, type RewardPeriodEmission, type RewardPeriodEmissionFormat, type RewardWhiteListOption, SCALE_OFFSET, type SdkOptions, StrategyType, StrategyUtils, type SwapOption, type UpdatePositionFeeAndRewardsOption, type UpdateRefFeeRateOption, type UpdateTimeRangeOption, type ValidateActiveIdSlippageOption, type VariableParameters, WeightUtils, type WeightsInfo, type WeightsOptions, buildPoolKey, CetusDlmmSDK as default, dlmmMainnet, dlmmTestnet, generateRewardSchedule, getRouterModule, parseBinInfo, parseBinInfoList, parseCurrentRewardPeriodEmission, parseDlmmBasePool, parseDlmmPool, parseDlmmPosition, parseLiquidityShares, parsePartner, parsePoolTransactionInfo, parseRewardPeriodEmission, parseStrategyType, parsedDlmmPosFeeData, parsedDlmmPosRewardData, parsedSwapQuoteData, poolFilterEvenTypes, safeAmount, safeMulAmount };
1081
+ export { type AddLiquidityOption, type AddRewardOption, type Axis, BASIS_POINT, BASIS_POINT_MAX, BIN_BOUND, type BaseAddLiquidityOption, type BaseCalculateAddLiquidityOption, type BaseCreatePoolAndAddOption, type BaseCreatePoolOption, type BinAmount, type BinLiquidityInfo, type BinManager, type BinStepConfig, type BinSwap, BinUtils, type BinWeight, type CalculateAddLiquidityAutoFillOption, type CalculateAddLiquidityOption, type CalculateRemoveLiquidityBothOption, type CalculateRemoveLiquidityOnlyOption, CetusDlmmSDK, type ClaimRefFeeOption, type ClosePositionOption, type CollectFeeOption, type CollectRewardAndFeeOption, type CollectRewardOption, type CreatePartnerOption, type CreatePoolAndAddOption, type CreatePoolAndAddWithPriceOption, type CreatePoolOption, DEFAULT_MAX_WEIGHT, DEFAULT_MIN_WEIGHT, type DlmmBasePool, type DlmmConfigs, type DlmmGlobalConfig, type DlmmPool, type DlmmPosition, FEE_PRECISION, type FeeRate, FeeUtils, type GetPoolBinInfoOption, type GetTotalFeeRateOption, type IlmInputOptions, type IlmInputResult, IlmUtils, type InitRewardOption, MAX_BIN_ID, MAX_BIN_PER_POSITION, MAX_FEE_RATE, MIN_BIN_ID, ONE, type OpenAndAddLiquidityOption, type OpenAndAddLiquidityWithPriceOption, type OpenPositionOption, type Partner, PoolModule, type PoolPermissions, type PoolTransactionInfo, type PositionFee, type PositionManager, type PositionReward, type PreSwapOption, type PreSwapQuote, REWARD_PERIOD, REWARD_PERIOD_START_AT, type RemoveLiquidityOption, type Reward, type RewardAccessOption, type RewardInfo, type RewardManager, type RewardPeriodEmission, type RewardPeriodEmissionFormat, type RewardWhiteListOption, SCALE_OFFSET, type SdkOptions, StrategyType, StrategyUtils, type SwapOption, type TokenTable, type UpdatePositionFeeAndRewardsOption, type UpdateRefFeeRateOption, type UpdateTimeRangeOption, type ValidateActiveIdSlippageOption, type VariableParameters, WeightUtils, type WeightsInfo, type WeightsOptions, buildPoolKey, CetusDlmmSDK as default, dlmmMainnet, dlmmTestnet, generateRewardSchedule, getRouterModule, parseBinInfo, parseBinInfoList, parseCurrentRewardPeriodEmission, parseDlmmBasePool, parseDlmmPool, parseDlmmPosition, parseLiquidityShares, parsePartner, parsePoolTransactionInfo, parseRewardPeriodEmission, parseStrategyType, parsedDlmmPosFeeData, parsedDlmmPosRewardData, parsedSwapQuoteData, poolFilterEvenTypes, safeAmount, safeMulAmount };