@hadron-fi/sdk 0.4.0 → 0.4.1

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.d.mts CHANGED
@@ -57,6 +57,7 @@ interface DecodedConfig {
57
57
  spreadConfigInitialized: boolean;
58
58
  deltaStaleness: number;
59
59
  oracleMode: OracleMode;
60
+ hasPoolFee: boolean;
60
61
  pendingAuthority: PublicKey;
61
62
  nominationExpiry: bigint;
62
63
  tokenProgramX: PublicKey;
@@ -256,6 +257,17 @@ interface UpdateFeeConfigParams {
256
257
  interface RotateFeeAdminParams {
257
258
  newFeeAdmin: PublicKey;
258
259
  }
260
+ interface InitializePoolFeeConfigParams {
261
+ feePpm: number;
262
+ feeAdmin: PublicKey;
263
+ feeRecipient: PublicKey;
264
+ }
265
+ interface UpdatePoolFeeConfigParams {
266
+ /** Pass null for no change (sends u32::MAX) */
267
+ feePpm: number | null;
268
+ /** Pass null for no change (sends zeros) */
269
+ feeRecipient: PublicKey | null;
270
+ }
259
271
  interface SetPoolStateParams {
260
272
  newState: PoolState;
261
273
  }
@@ -278,6 +290,7 @@ interface AllocateCurvePrefabsParams {
278
290
  mintY: PublicKey;
279
291
  maxPrefabSlots?: number;
280
292
  maxCurvePoints?: number;
293
+ authority: PublicKey;
281
294
  }
282
295
  type OrderSide = "bid" | "ask";
283
296
  interface PlaceOrderParams {
@@ -468,7 +481,7 @@ declare class Hadron {
468
481
  /** Fetch and decode the current spread config triggers from chain. */
469
482
  private fetchSpreadTriggers;
470
483
  /** Build close pool instruction. */
471
- closePool(authority: PublicKey): TransactionInstruction;
484
+ closePool(authority: PublicKey, authorityAtaX?: PublicKey, authorityAtaY?: PublicKey): TransactionInstruction;
472
485
  /**
473
486
  * Build deposit instructions with automatic SOL wrapping.
474
487
  * If mint X or Y is native SOL, prepends wrap instructions for that side.
@@ -663,6 +676,8 @@ declare const Discriminator: {
663
676
  readonly AllocateCurvePrefabs: 22;
664
677
  readonly SetQuotingAuthority: 23;
665
678
  readonly RotateFeeAdmin: 24;
679
+ readonly InitializePoolFeeConfig: 25;
680
+ readonly UpdatePoolFeeConfig: 26;
666
681
  };
667
682
  /** Per-point data in SetCurve/SetRiskCurve: u64 + u64 + u8 + 4 params = 21 bytes */
668
683
  declare const POINT_DATA_SIZE = 21;
@@ -701,6 +716,7 @@ declare function getCurveMetaAddress(seed: bigint, mintX: PublicKey, mintY: Publ
701
716
  declare function getCurvePrefabsAddress(seed: bigint, mintX: PublicKey, mintY: PublicKey, programId?: PublicKey): [PublicKey, number];
702
717
  declare function getCurveUpdatesAddress(seed: bigint, mintX: PublicKey, mintY: PublicKey, programId?: PublicKey): [PublicKey, number];
703
718
  declare function getFeeConfigAddress(programId?: PublicKey): [PublicKey, number];
719
+ declare function getPoolFeeConfigAddress(configPda: PublicKey, programId?: PublicKey): [PublicKey, number];
704
720
  declare function getSpreadConfigAddress(configPda: PublicKey, programId?: PublicKey): [PublicKey, number];
705
721
  /**
706
722
  * Derive all PDA addresses for a pool.
@@ -778,7 +794,7 @@ declare function buildWithdraw(user: PublicKey, configPda: PublicKey, mintX: Pub
778
794
  *
779
795
  * When spread config is initialized: spread_config (#16) + instructions_sysvar (#17).
780
796
  */
781
- declare function buildSwapExactIn(user: PublicKey, poolAddresses: PoolAddresses, mintX: PublicKey, mintY: PublicKey, tokenProgramX: PublicKey, tokenProgramY: PublicKey, params: SwapParams, programId?: PublicKey, spreadConfigInitialized?: boolean): TransactionInstruction;
797
+ declare function buildSwapExactIn(user: PublicKey, poolAddresses: PoolAddresses, mintX: PublicKey, mintY: PublicKey, tokenProgramX: PublicKey, tokenProgramY: PublicKey, params: SwapParams, programId?: PublicKey, spreadConfigInitialized?: boolean, feeConfigOverride?: PublicKey): TransactionInstruction;
782
798
 
783
799
  /**
784
800
  * Build a SetCurve instruction (price curve).
@@ -882,6 +898,16 @@ declare function buildUpdateFeeConfig(feeAdmin: PublicKey, params: UpdateFeeConf
882
898
  * Accounts: fee_admin (signer), fee_config (mut).
883
899
  */
884
900
  declare function buildRotateFeeAdmin(feeAdmin: PublicKey, params: RotateFeeAdminParams, programId?: PublicKey): TransactionInstruction;
901
+ /**
902
+ * Build an InitializePoolFeeConfig instruction.
903
+ * Accounts: payer, fee_admin, config, pool_fee_config, global_fee_config, system_program.
904
+ */
905
+ declare function buildInitializePoolFeeConfig(payer: PublicKey, feeAdmin: PublicKey, configPda: PublicKey, params: InitializePoolFeeConfigParams, programId?: PublicKey): TransactionInstruction;
906
+ /**
907
+ * Build an UpdatePoolFeeConfig instruction.
908
+ * Accounts: fee_admin, config, pool_fee_config.
909
+ */
910
+ declare function buildUpdatePoolFeeConfig(feeAdmin: PublicKey, configPda: PublicKey, params: UpdatePoolFeeConfigParams, programId?: PublicKey): TransactionInstruction;
885
911
 
886
912
  /**
887
913
  * Build an InitializeSpreadConfig instruction.
@@ -910,6 +936,6 @@ declare function buildUpdateDeltaStaleness(authority: PublicKey, configPda: Publ
910
936
  * curve_updates, vault_x, vault_y, token_program_x, token_program_y,
911
937
  * [optional: spread_config if initialized].
912
938
  */
913
- declare function buildClosePool(authority: PublicKey, configPda: PublicKey, midpriceOraclePda: PublicKey, curveMetaPda: PublicKey, curvePrefabsPda: PublicKey, curveUpdatesPda: PublicKey, vaultX: PublicKey, vaultY: PublicKey, tokenProgramX: PublicKey, tokenProgramY: PublicKey, spreadConfigInitialized?: boolean, programId?: PublicKey): TransactionInstruction;
939
+ declare function buildClosePool(authority: PublicKey, configPda: PublicKey, midpriceOraclePda: PublicKey, curveMetaPda: PublicKey, curvePrefabsPda: PublicKey, curveUpdatesPda: PublicKey, vaultX: PublicKey, vaultY: PublicKey, tokenProgramX: PublicKey, tokenProgramY: PublicKey, spreadConfigInitialized?: boolean, authorityAtaX?: PublicKey, authorityAtaY?: PublicKey, programId?: PublicKey): TransactionInstruction;
914
940
 
915
- export { ABSOLUTE_MAX_CURVE_POINTS, ABSOLUTE_MAX_PREFAB_SLOTS, type AllocateCurvePrefabsParams, type AmendOrderParams, CONFIG_SEED, CONFIG_SIZE, CURVE_META_SEED, CURVE_META_SIZE, CURVE_POINT_LEN, CURVE_PREFABS_SEED, CURVE_SIDE_HEADER, CURVE_UPDATES_SEED, CURVE_UPDATES_SIZE, CURVE_UPDATE_OP_SIZE, type CancelOrderParams, type CurvePoint, type CurveSide, CurveType, type CurveUpdateOp, CurveUpdateOpKind, CurveXMode, DEFAULT_MAX_CURVE_POINTS, DEFAULT_MAX_PREFAB_SLOTS, type DecodedConfig, type DecodedCurveMeta, type DecodedCurveUpdates, type DecodedFeeConfig, type DecodedMidpriceOracle, type DecodedSpreadConfig, type DepositParams, Discriminator, FEE_CONFIG_SEED, FEE_CONFIG_SIZE, HADRON_PROGRAM_ID, Hadron, HadronOrderbook, type InitializeFeeConfigParams, type InitializeParams, type InitializeSpreadConfigParams, Interpolation, MAX_CURVE_UPDATE_OPS, MAX_SETCURVE_POINTS, MIDPRICE_ORACLE_SEED, MIDPRICE_ORACLE_SIZE, type NominateAuthorityParams, OracleMode, type OrderSide, type OrderbookLevel, type OrderbookState, POINT_DATA_SIZE, type PlaceOrderParams, type PoolAddresses, PoolState, Q32_ONE, RiskMode, type RotateFeeAdminParams, SPREAD_CONFIG_SEED, type SetCurveBothParams, type SetCurveParams, type SetCurvePointInput, type SetPoolStateParams, type SetQuotingAuthorityParams, type SetRiskCurveAbsoluteBothParams, type SetRiskCurveAbsoluteParams, type SetRiskCurveAbsolutePointInput, type SetRiskCurveBothParams, type SetRiskCurveParams, type SetRiskCurvePointInput, Side, type SpreadTriggerInput, type StagedOrder, type SwapParams, type SwitchCurveParams, type UpdateBaseSpreadParams, type UpdateDeltaStalenessParams, type UpdateFeeConfigParams, type UpdateMidpriceAndBaseSpreadParams, type UpdateMidpriceParams, type UpdateSpreadConfigParams, type WithdrawParams, buildAcceptAuthority, buildAllocateCurvePrefabs, buildApplyCurveUpdates, buildClosePool, buildDeposit, buildInitialize, buildInitializeFeeConfig, buildInitializeSpreadConfig, buildNominateAuthority, buildRotateFeeAdmin, buildSetCurve, buildSetCurveBoth, buildSetPoolState, buildSetQuotingAuthority, buildSetRiskCurve, buildSetRiskCurveAbsolute, buildSetRiskCurveAbsoluteBoth, buildSetRiskCurveBoth, buildSubmitCurveUpdates, buildSwapExactIn, buildSwitchPriceCurve, buildSwitchRiskCurve, buildUpdateBaseSpread, buildUpdateDeltaStaleness, buildUpdateFeeConfig, buildUpdateMidprice, buildUpdateMidpriceAndBaseSpread, buildUpdateSpreadConfig, buildWithdraw, createWsolAtaInstruction, curvePrefabsSize, decodeActiveCurves, decodeConfig, decodeCurveMeta, decodeCurveSide, decodeCurveUpdates, decodeFeeConfig, decodeMidpriceOracle, decodeSpreadConfig, derivePoolAddresses, fromQ32, getConfigAddress, getCurveMetaAddress, getCurvePrefabsAddress, getCurveUpdatesAddress, getFeeConfigAddress, getMidpriceOracleAddress, getOrCreateAta, getSpreadConfigAddress, isNativeMint, isSlotInitialized, pctToQ32, spreadBpsToQ32, spreadQ32ToBps, toQ32, unwrapSolInstruction, wrapSolInstructions };
941
+ export { ABSOLUTE_MAX_CURVE_POINTS, ABSOLUTE_MAX_PREFAB_SLOTS, type AllocateCurvePrefabsParams, type AmendOrderParams, CONFIG_SEED, CONFIG_SIZE, CURVE_META_SEED, CURVE_META_SIZE, CURVE_POINT_LEN, CURVE_PREFABS_SEED, CURVE_SIDE_HEADER, CURVE_UPDATES_SEED, CURVE_UPDATES_SIZE, CURVE_UPDATE_OP_SIZE, type CancelOrderParams, type CurvePoint, type CurveSide, CurveType, type CurveUpdateOp, CurveUpdateOpKind, CurveXMode, DEFAULT_MAX_CURVE_POINTS, DEFAULT_MAX_PREFAB_SLOTS, type DecodedConfig, type DecodedCurveMeta, type DecodedCurveUpdates, type DecodedFeeConfig, type DecodedMidpriceOracle, type DecodedSpreadConfig, type DepositParams, Discriminator, FEE_CONFIG_SEED, FEE_CONFIG_SIZE, HADRON_PROGRAM_ID, Hadron, HadronOrderbook, type InitializeFeeConfigParams, type InitializeParams, type InitializePoolFeeConfigParams, type InitializeSpreadConfigParams, Interpolation, MAX_CURVE_UPDATE_OPS, MAX_SETCURVE_POINTS, MIDPRICE_ORACLE_SEED, MIDPRICE_ORACLE_SIZE, type NominateAuthorityParams, OracleMode, type OrderSide, type OrderbookLevel, type OrderbookState, POINT_DATA_SIZE, type PlaceOrderParams, type PoolAddresses, PoolState, Q32_ONE, RiskMode, type RotateFeeAdminParams, SPREAD_CONFIG_SEED, type SetCurveBothParams, type SetCurveParams, type SetCurvePointInput, type SetPoolStateParams, type SetQuotingAuthorityParams, type SetRiskCurveAbsoluteBothParams, type SetRiskCurveAbsoluteParams, type SetRiskCurveAbsolutePointInput, type SetRiskCurveBothParams, type SetRiskCurveParams, type SetRiskCurvePointInput, Side, type SpreadTriggerInput, type StagedOrder, type SwapParams, type SwitchCurveParams, type UpdateBaseSpreadParams, type UpdateDeltaStalenessParams, type UpdateFeeConfigParams, type UpdateMidpriceAndBaseSpreadParams, type UpdateMidpriceParams, type UpdatePoolFeeConfigParams, type UpdateSpreadConfigParams, type WithdrawParams, buildAcceptAuthority, buildAllocateCurvePrefabs, buildApplyCurveUpdates, buildClosePool, buildDeposit, buildInitialize, buildInitializeFeeConfig, buildInitializePoolFeeConfig, buildInitializeSpreadConfig, buildNominateAuthority, buildRotateFeeAdmin, buildSetCurve, buildSetCurveBoth, buildSetPoolState, buildSetQuotingAuthority, buildSetRiskCurve, buildSetRiskCurveAbsolute, buildSetRiskCurveAbsoluteBoth, buildSetRiskCurveBoth, buildSubmitCurveUpdates, buildSwapExactIn, buildSwitchPriceCurve, buildSwitchRiskCurve, buildUpdateBaseSpread, buildUpdateDeltaStaleness, buildUpdateFeeConfig, buildUpdateMidprice, buildUpdateMidpriceAndBaseSpread, buildUpdatePoolFeeConfig, buildUpdateSpreadConfig, buildWithdraw, createWsolAtaInstruction, curvePrefabsSize, decodeActiveCurves, decodeConfig, decodeCurveMeta, decodeCurveSide, decodeCurveUpdates, decodeFeeConfig, decodeMidpriceOracle, decodeSpreadConfig, derivePoolAddresses, fromQ32, getConfigAddress, getCurveMetaAddress, getCurvePrefabsAddress, getCurveUpdatesAddress, getFeeConfigAddress, getMidpriceOracleAddress, getOrCreateAta, getPoolFeeConfigAddress, getSpreadConfigAddress, isNativeMint, isSlotInitialized, pctToQ32, spreadBpsToQ32, spreadQ32ToBps, toQ32, unwrapSolInstruction, wrapSolInstructions };
package/dist/index.d.ts CHANGED
@@ -57,6 +57,7 @@ interface DecodedConfig {
57
57
  spreadConfigInitialized: boolean;
58
58
  deltaStaleness: number;
59
59
  oracleMode: OracleMode;
60
+ hasPoolFee: boolean;
60
61
  pendingAuthority: PublicKey;
61
62
  nominationExpiry: bigint;
62
63
  tokenProgramX: PublicKey;
@@ -256,6 +257,17 @@ interface UpdateFeeConfigParams {
256
257
  interface RotateFeeAdminParams {
257
258
  newFeeAdmin: PublicKey;
258
259
  }
260
+ interface InitializePoolFeeConfigParams {
261
+ feePpm: number;
262
+ feeAdmin: PublicKey;
263
+ feeRecipient: PublicKey;
264
+ }
265
+ interface UpdatePoolFeeConfigParams {
266
+ /** Pass null for no change (sends u32::MAX) */
267
+ feePpm: number | null;
268
+ /** Pass null for no change (sends zeros) */
269
+ feeRecipient: PublicKey | null;
270
+ }
259
271
  interface SetPoolStateParams {
260
272
  newState: PoolState;
261
273
  }
@@ -278,6 +290,7 @@ interface AllocateCurvePrefabsParams {
278
290
  mintY: PublicKey;
279
291
  maxPrefabSlots?: number;
280
292
  maxCurvePoints?: number;
293
+ authority: PublicKey;
281
294
  }
282
295
  type OrderSide = "bid" | "ask";
283
296
  interface PlaceOrderParams {
@@ -468,7 +481,7 @@ declare class Hadron {
468
481
  /** Fetch and decode the current spread config triggers from chain. */
469
482
  private fetchSpreadTriggers;
470
483
  /** Build close pool instruction. */
471
- closePool(authority: PublicKey): TransactionInstruction;
484
+ closePool(authority: PublicKey, authorityAtaX?: PublicKey, authorityAtaY?: PublicKey): TransactionInstruction;
472
485
  /**
473
486
  * Build deposit instructions with automatic SOL wrapping.
474
487
  * If mint X or Y is native SOL, prepends wrap instructions for that side.
@@ -663,6 +676,8 @@ declare const Discriminator: {
663
676
  readonly AllocateCurvePrefabs: 22;
664
677
  readonly SetQuotingAuthority: 23;
665
678
  readonly RotateFeeAdmin: 24;
679
+ readonly InitializePoolFeeConfig: 25;
680
+ readonly UpdatePoolFeeConfig: 26;
666
681
  };
667
682
  /** Per-point data in SetCurve/SetRiskCurve: u64 + u64 + u8 + 4 params = 21 bytes */
668
683
  declare const POINT_DATA_SIZE = 21;
@@ -701,6 +716,7 @@ declare function getCurveMetaAddress(seed: bigint, mintX: PublicKey, mintY: Publ
701
716
  declare function getCurvePrefabsAddress(seed: bigint, mintX: PublicKey, mintY: PublicKey, programId?: PublicKey): [PublicKey, number];
702
717
  declare function getCurveUpdatesAddress(seed: bigint, mintX: PublicKey, mintY: PublicKey, programId?: PublicKey): [PublicKey, number];
703
718
  declare function getFeeConfigAddress(programId?: PublicKey): [PublicKey, number];
719
+ declare function getPoolFeeConfigAddress(configPda: PublicKey, programId?: PublicKey): [PublicKey, number];
704
720
  declare function getSpreadConfigAddress(configPda: PublicKey, programId?: PublicKey): [PublicKey, number];
705
721
  /**
706
722
  * Derive all PDA addresses for a pool.
@@ -778,7 +794,7 @@ declare function buildWithdraw(user: PublicKey, configPda: PublicKey, mintX: Pub
778
794
  *
779
795
  * When spread config is initialized: spread_config (#16) + instructions_sysvar (#17).
780
796
  */
781
- declare function buildSwapExactIn(user: PublicKey, poolAddresses: PoolAddresses, mintX: PublicKey, mintY: PublicKey, tokenProgramX: PublicKey, tokenProgramY: PublicKey, params: SwapParams, programId?: PublicKey, spreadConfigInitialized?: boolean): TransactionInstruction;
797
+ declare function buildSwapExactIn(user: PublicKey, poolAddresses: PoolAddresses, mintX: PublicKey, mintY: PublicKey, tokenProgramX: PublicKey, tokenProgramY: PublicKey, params: SwapParams, programId?: PublicKey, spreadConfigInitialized?: boolean, feeConfigOverride?: PublicKey): TransactionInstruction;
782
798
 
783
799
  /**
784
800
  * Build a SetCurve instruction (price curve).
@@ -882,6 +898,16 @@ declare function buildUpdateFeeConfig(feeAdmin: PublicKey, params: UpdateFeeConf
882
898
  * Accounts: fee_admin (signer), fee_config (mut).
883
899
  */
884
900
  declare function buildRotateFeeAdmin(feeAdmin: PublicKey, params: RotateFeeAdminParams, programId?: PublicKey): TransactionInstruction;
901
+ /**
902
+ * Build an InitializePoolFeeConfig instruction.
903
+ * Accounts: payer, fee_admin, config, pool_fee_config, global_fee_config, system_program.
904
+ */
905
+ declare function buildInitializePoolFeeConfig(payer: PublicKey, feeAdmin: PublicKey, configPda: PublicKey, params: InitializePoolFeeConfigParams, programId?: PublicKey): TransactionInstruction;
906
+ /**
907
+ * Build an UpdatePoolFeeConfig instruction.
908
+ * Accounts: fee_admin, config, pool_fee_config.
909
+ */
910
+ declare function buildUpdatePoolFeeConfig(feeAdmin: PublicKey, configPda: PublicKey, params: UpdatePoolFeeConfigParams, programId?: PublicKey): TransactionInstruction;
885
911
 
886
912
  /**
887
913
  * Build an InitializeSpreadConfig instruction.
@@ -910,6 +936,6 @@ declare function buildUpdateDeltaStaleness(authority: PublicKey, configPda: Publ
910
936
  * curve_updates, vault_x, vault_y, token_program_x, token_program_y,
911
937
  * [optional: spread_config if initialized].
912
938
  */
913
- declare function buildClosePool(authority: PublicKey, configPda: PublicKey, midpriceOraclePda: PublicKey, curveMetaPda: PublicKey, curvePrefabsPda: PublicKey, curveUpdatesPda: PublicKey, vaultX: PublicKey, vaultY: PublicKey, tokenProgramX: PublicKey, tokenProgramY: PublicKey, spreadConfigInitialized?: boolean, programId?: PublicKey): TransactionInstruction;
939
+ declare function buildClosePool(authority: PublicKey, configPda: PublicKey, midpriceOraclePda: PublicKey, curveMetaPda: PublicKey, curvePrefabsPda: PublicKey, curveUpdatesPda: PublicKey, vaultX: PublicKey, vaultY: PublicKey, tokenProgramX: PublicKey, tokenProgramY: PublicKey, spreadConfigInitialized?: boolean, authorityAtaX?: PublicKey, authorityAtaY?: PublicKey, programId?: PublicKey): TransactionInstruction;
914
940
 
915
- export { ABSOLUTE_MAX_CURVE_POINTS, ABSOLUTE_MAX_PREFAB_SLOTS, type AllocateCurvePrefabsParams, type AmendOrderParams, CONFIG_SEED, CONFIG_SIZE, CURVE_META_SEED, CURVE_META_SIZE, CURVE_POINT_LEN, CURVE_PREFABS_SEED, CURVE_SIDE_HEADER, CURVE_UPDATES_SEED, CURVE_UPDATES_SIZE, CURVE_UPDATE_OP_SIZE, type CancelOrderParams, type CurvePoint, type CurveSide, CurveType, type CurveUpdateOp, CurveUpdateOpKind, CurveXMode, DEFAULT_MAX_CURVE_POINTS, DEFAULT_MAX_PREFAB_SLOTS, type DecodedConfig, type DecodedCurveMeta, type DecodedCurveUpdates, type DecodedFeeConfig, type DecodedMidpriceOracle, type DecodedSpreadConfig, type DepositParams, Discriminator, FEE_CONFIG_SEED, FEE_CONFIG_SIZE, HADRON_PROGRAM_ID, Hadron, HadronOrderbook, type InitializeFeeConfigParams, type InitializeParams, type InitializeSpreadConfigParams, Interpolation, MAX_CURVE_UPDATE_OPS, MAX_SETCURVE_POINTS, MIDPRICE_ORACLE_SEED, MIDPRICE_ORACLE_SIZE, type NominateAuthorityParams, OracleMode, type OrderSide, type OrderbookLevel, type OrderbookState, POINT_DATA_SIZE, type PlaceOrderParams, type PoolAddresses, PoolState, Q32_ONE, RiskMode, type RotateFeeAdminParams, SPREAD_CONFIG_SEED, type SetCurveBothParams, type SetCurveParams, type SetCurvePointInput, type SetPoolStateParams, type SetQuotingAuthorityParams, type SetRiskCurveAbsoluteBothParams, type SetRiskCurveAbsoluteParams, type SetRiskCurveAbsolutePointInput, type SetRiskCurveBothParams, type SetRiskCurveParams, type SetRiskCurvePointInput, Side, type SpreadTriggerInput, type StagedOrder, type SwapParams, type SwitchCurveParams, type UpdateBaseSpreadParams, type UpdateDeltaStalenessParams, type UpdateFeeConfigParams, type UpdateMidpriceAndBaseSpreadParams, type UpdateMidpriceParams, type UpdateSpreadConfigParams, type WithdrawParams, buildAcceptAuthority, buildAllocateCurvePrefabs, buildApplyCurveUpdates, buildClosePool, buildDeposit, buildInitialize, buildInitializeFeeConfig, buildInitializeSpreadConfig, buildNominateAuthority, buildRotateFeeAdmin, buildSetCurve, buildSetCurveBoth, buildSetPoolState, buildSetQuotingAuthority, buildSetRiskCurve, buildSetRiskCurveAbsolute, buildSetRiskCurveAbsoluteBoth, buildSetRiskCurveBoth, buildSubmitCurveUpdates, buildSwapExactIn, buildSwitchPriceCurve, buildSwitchRiskCurve, buildUpdateBaseSpread, buildUpdateDeltaStaleness, buildUpdateFeeConfig, buildUpdateMidprice, buildUpdateMidpriceAndBaseSpread, buildUpdateSpreadConfig, buildWithdraw, createWsolAtaInstruction, curvePrefabsSize, decodeActiveCurves, decodeConfig, decodeCurveMeta, decodeCurveSide, decodeCurveUpdates, decodeFeeConfig, decodeMidpriceOracle, decodeSpreadConfig, derivePoolAddresses, fromQ32, getConfigAddress, getCurveMetaAddress, getCurvePrefabsAddress, getCurveUpdatesAddress, getFeeConfigAddress, getMidpriceOracleAddress, getOrCreateAta, getSpreadConfigAddress, isNativeMint, isSlotInitialized, pctToQ32, spreadBpsToQ32, spreadQ32ToBps, toQ32, unwrapSolInstruction, wrapSolInstructions };
941
+ export { ABSOLUTE_MAX_CURVE_POINTS, ABSOLUTE_MAX_PREFAB_SLOTS, type AllocateCurvePrefabsParams, type AmendOrderParams, CONFIG_SEED, CONFIG_SIZE, CURVE_META_SEED, CURVE_META_SIZE, CURVE_POINT_LEN, CURVE_PREFABS_SEED, CURVE_SIDE_HEADER, CURVE_UPDATES_SEED, CURVE_UPDATES_SIZE, CURVE_UPDATE_OP_SIZE, type CancelOrderParams, type CurvePoint, type CurveSide, CurveType, type CurveUpdateOp, CurveUpdateOpKind, CurveXMode, DEFAULT_MAX_CURVE_POINTS, DEFAULT_MAX_PREFAB_SLOTS, type DecodedConfig, type DecodedCurveMeta, type DecodedCurveUpdates, type DecodedFeeConfig, type DecodedMidpriceOracle, type DecodedSpreadConfig, type DepositParams, Discriminator, FEE_CONFIG_SEED, FEE_CONFIG_SIZE, HADRON_PROGRAM_ID, Hadron, HadronOrderbook, type InitializeFeeConfigParams, type InitializeParams, type InitializePoolFeeConfigParams, type InitializeSpreadConfigParams, Interpolation, MAX_CURVE_UPDATE_OPS, MAX_SETCURVE_POINTS, MIDPRICE_ORACLE_SEED, MIDPRICE_ORACLE_SIZE, type NominateAuthorityParams, OracleMode, type OrderSide, type OrderbookLevel, type OrderbookState, POINT_DATA_SIZE, type PlaceOrderParams, type PoolAddresses, PoolState, Q32_ONE, RiskMode, type RotateFeeAdminParams, SPREAD_CONFIG_SEED, type SetCurveBothParams, type SetCurveParams, type SetCurvePointInput, type SetPoolStateParams, type SetQuotingAuthorityParams, type SetRiskCurveAbsoluteBothParams, type SetRiskCurveAbsoluteParams, type SetRiskCurveAbsolutePointInput, type SetRiskCurveBothParams, type SetRiskCurveParams, type SetRiskCurvePointInput, Side, type SpreadTriggerInput, type StagedOrder, type SwapParams, type SwitchCurveParams, type UpdateBaseSpreadParams, type UpdateDeltaStalenessParams, type UpdateFeeConfigParams, type UpdateMidpriceAndBaseSpreadParams, type UpdateMidpriceParams, type UpdatePoolFeeConfigParams, type UpdateSpreadConfigParams, type WithdrawParams, buildAcceptAuthority, buildAllocateCurvePrefabs, buildApplyCurveUpdates, buildClosePool, buildDeposit, buildInitialize, buildInitializeFeeConfig, buildInitializePoolFeeConfig, buildInitializeSpreadConfig, buildNominateAuthority, buildRotateFeeAdmin, buildSetCurve, buildSetCurveBoth, buildSetPoolState, buildSetQuotingAuthority, buildSetRiskCurve, buildSetRiskCurveAbsolute, buildSetRiskCurveAbsoluteBoth, buildSetRiskCurveBoth, buildSubmitCurveUpdates, buildSwapExactIn, buildSwitchPriceCurve, buildSwitchRiskCurve, buildUpdateBaseSpread, buildUpdateDeltaStaleness, buildUpdateFeeConfig, buildUpdateMidprice, buildUpdateMidpriceAndBaseSpread, buildUpdatePoolFeeConfig, buildUpdateSpreadConfig, buildWithdraw, createWsolAtaInstruction, curvePrefabsSize, decodeActiveCurves, decodeConfig, decodeCurveMeta, decodeCurveSide, decodeCurveUpdates, decodeFeeConfig, decodeMidpriceOracle, decodeSpreadConfig, derivePoolAddresses, fromQ32, getConfigAddress, getCurveMetaAddress, getCurvePrefabsAddress, getCurveUpdatesAddress, getFeeConfigAddress, getMidpriceOracleAddress, getOrCreateAta, getPoolFeeConfigAddress, getSpreadConfigAddress, isNativeMint, isSlotInitialized, pctToQ32, spreadBpsToQ32, spreadQ32ToBps, toQ32, unwrapSolInstruction, wrapSolInstructions };
package/dist/index.js CHANGED
@@ -99,7 +99,9 @@ var Discriminator = {
99
99
  SetPoolState: 21,
100
100
  AllocateCurvePrefabs: 22,
101
101
  SetQuotingAuthority: 23,
102
- RotateFeeAdmin: 24
102
+ RotateFeeAdmin: 24,
103
+ InitializePoolFeeConfig: 25,
104
+ UpdatePoolFeeConfig: 26
103
105
  };
104
106
  var POINT_DATA_SIZE = 21;
105
107
  var CURVE_UPDATE_OP_SIZE = 24;
@@ -163,6 +165,12 @@ function getCurveUpdatesAddress(seed, mintX, mintY, programId = HADRON_PROGRAM_I
163
165
  function getFeeConfigAddress(programId = HADRON_PROGRAM_ID) {
164
166
  return _web3js.PublicKey.findProgramAddressSync([FEE_CONFIG_SEED], programId);
165
167
  }
168
+ function getPoolFeeConfigAddress(configPda, programId = HADRON_PROGRAM_ID) {
169
+ return _web3js.PublicKey.findProgramAddressSync(
170
+ [FEE_CONFIG_SEED, configPda.toBuffer()],
171
+ programId
172
+ );
173
+ }
166
174
  function getSpreadConfigAddress(configPda, programId = HADRON_PROGRAM_ID) {
167
175
  return _web3js.PublicKey.findProgramAddressSync(
168
176
  [SPREAD_CONFIG_SEED, configPda.toBuffer()],
@@ -301,7 +309,9 @@ function decodeConfig(data) {
301
309
  offset += 1;
302
310
  const oracleMode = buf.readUInt8(offset);
303
311
  offset += 1;
304
- offset += 3;
312
+ const hasPoolFee = buf.readUInt8(offset) !== 0;
313
+ offset += 1;
314
+ offset += 2;
305
315
  const pendingAuthority = new (0, _web3js.PublicKey)(buf.subarray(offset, offset + 32));
306
316
  offset += 32;
307
317
  const nominationExpiry = buf.readBigUInt64LE(offset);
@@ -320,6 +330,7 @@ function decodeConfig(data) {
320
330
  spreadConfigInitialized,
321
331
  deltaStaleness,
322
332
  oracleMode,
333
+ hasPoolFee,
323
334
  pendingAuthority,
324
335
  nominationExpiry,
325
336
  tokenProgramX,
@@ -541,7 +552,7 @@ function buildInitialize(payer, params, programId = HADRON_PROGRAM_ID) {
541
552
  function buildAllocateCurvePrefabs(payer, params, programId = HADRON_PROGRAM_ID) {
542
553
  const maxPrefabSlots = _nullishCoalesce(params.maxPrefabSlots, () => ( DEFAULT_MAX_PREFAB_SLOTS));
543
554
  const maxCurvePoints = _nullishCoalesce(params.maxCurvePoints, () => ( DEFAULT_MAX_CURVE_POINTS));
544
- const data = Buffer.alloc(1 + 8 + 32 + 32 + 1 + 1);
555
+ const data = Buffer.alloc(1 + 8 + 32 + 32 + 1 + 1 + 32);
545
556
  let offset = 0;
546
557
  data.writeUInt8(Discriminator.AllocateCurvePrefabs, offset);
547
558
  offset += 1;
@@ -554,6 +565,8 @@ function buildAllocateCurvePrefabs(payer, params, programId = HADRON_PROGRAM_ID)
554
565
  data.writeUInt8(maxPrefabSlots, offset);
555
566
  offset += 1;
556
567
  data.writeUInt8(maxCurvePoints, offset);
568
+ offset += 1;
569
+ params.authority.toBuffer().copy(data, offset);
557
570
  const [curvePrefabsPda] = _web3js.PublicKey.findProgramAddressSync(
558
571
  [
559
572
  Buffer.from("hadron-curve-prefabs"),
@@ -653,7 +666,7 @@ function buildWithdraw(user, configPda, mintX, mintY, tokenProgramX, tokenProgra
653
666
 
654
667
 
655
668
 
656
- function buildSwapExactIn(user, poolAddresses, mintX, mintY, tokenProgramX, tokenProgramY, params, programId = HADRON_PROGRAM_ID, spreadConfigInitialized = false) {
669
+ function buildSwapExactIn(user, poolAddresses, mintX, mintY, tokenProgramX, tokenProgramY, params, programId = HADRON_PROGRAM_ID, spreadConfigInitialized = false, feeConfigOverride) {
657
670
  const data = Buffer.alloc(1 + 1 + 8 + 8 + 8);
658
671
  let offset = 0;
659
672
  data.writeUInt8(Discriminator.SwapExactIn, offset);
@@ -669,7 +682,7 @@ function buildSwapExactIn(user, poolAddresses, mintX, mintY, tokenProgramX, toke
669
682
  const userX = _spltoken.getAssociatedTokenAddressSync.call(void 0, mintX, user, false, tokenProgramX);
670
683
  const userY = _spltoken.getAssociatedTokenAddressSync.call(void 0, mintY, user, false, tokenProgramY);
671
684
  const [userSource, vaultSource, vaultDest, userDest] = params.isX ? [userX, poolAddresses.vaultX, poolAddresses.vaultY, userY] : [userY, poolAddresses.vaultY, poolAddresses.vaultX, userX];
672
- const [feeConfigPda] = getFeeConfigAddress(programId);
685
+ const feeConfigPda = _nullishCoalesce(feeConfigOverride, () => ( getFeeConfigAddress(programId)[0]));
673
686
  const inputMint = params.isX ? mintX : mintY;
674
687
  const inputMintProgram = params.isX ? tokenProgramX : tokenProgramY;
675
688
  const feeRecipientAta = _spltoken.getAssociatedTokenAddressSync.call(void 0,
@@ -1137,6 +1150,52 @@ function buildRotateFeeAdmin(feeAdmin, params, programId = HADRON_PROGRAM_ID) {
1137
1150
  data
1138
1151
  });
1139
1152
  }
1153
+ function buildInitializePoolFeeConfig(payer, feeAdmin, configPda, params, programId = HADRON_PROGRAM_ID) {
1154
+ const [poolFeeConfigPda] = getPoolFeeConfigAddress(configPda, programId);
1155
+ const [globalFeeConfigPda] = getFeeConfigAddress(programId);
1156
+ const data = Buffer.alloc(1 + 4 + 32 + 32);
1157
+ let offset = 0;
1158
+ data.writeUInt8(Discriminator.InitializePoolFeeConfig, offset);
1159
+ offset += 1;
1160
+ data.writeUInt32LE(params.feePpm, offset);
1161
+ offset += 4;
1162
+ params.feeAdmin.toBuffer().copy(data, offset);
1163
+ offset += 32;
1164
+ params.feeRecipient.toBuffer().copy(data, offset);
1165
+ return new (0, _web3js.TransactionInstruction)({
1166
+ programId,
1167
+ keys: [
1168
+ { pubkey: payer, isSigner: true, isWritable: true },
1169
+ { pubkey: feeAdmin, isSigner: true, isWritable: false },
1170
+ { pubkey: configPda, isSigner: false, isWritable: true },
1171
+ { pubkey: poolFeeConfigPda, isSigner: false, isWritable: true },
1172
+ { pubkey: globalFeeConfigPda, isSigner: false, isWritable: false },
1173
+ { pubkey: _web3js.SystemProgram.programId, isSigner: false, isWritable: false }
1174
+ ],
1175
+ data
1176
+ });
1177
+ }
1178
+ function buildUpdatePoolFeeConfig(feeAdmin, configPda, params, programId = HADRON_PROGRAM_ID) {
1179
+ const [poolFeeConfigPda] = getPoolFeeConfigAddress(configPda, programId);
1180
+ const data = Buffer.alloc(1 + 4 + 32);
1181
+ let offset = 0;
1182
+ data.writeUInt8(Discriminator.UpdatePoolFeeConfig, offset);
1183
+ offset += 1;
1184
+ data.writeUInt32LE(params.feePpm !== null ? params.feePpm : 4294967295, offset);
1185
+ offset += 4;
1186
+ if (params.feeRecipient) {
1187
+ params.feeRecipient.toBuffer().copy(data, offset);
1188
+ }
1189
+ return new (0, _web3js.TransactionInstruction)({
1190
+ programId,
1191
+ keys: [
1192
+ { pubkey: feeAdmin, isSigner: true, isWritable: false },
1193
+ { pubkey: configPda, isSigner: false, isWritable: false },
1194
+ { pubkey: poolFeeConfigPda, isSigner: false, isWritable: true }
1195
+ ],
1196
+ data
1197
+ });
1198
+ }
1140
1199
 
1141
1200
  // src/instructions/spreadConfig.ts
1142
1201
 
@@ -1216,7 +1275,7 @@ function buildUpdateDeltaStaleness(authority, configPda, params, programId = HAD
1216
1275
  data
1217
1276
  });
1218
1277
  }
1219
- function buildClosePool(authority, configPda, midpriceOraclePda, curveMetaPda, curvePrefabsPda, curveUpdatesPda, vaultX, vaultY, tokenProgramX, tokenProgramY, spreadConfigInitialized = false, programId = HADRON_PROGRAM_ID) {
1278
+ function buildClosePool(authority, configPda, midpriceOraclePda, curveMetaPda, curvePrefabsPda, curveUpdatesPda, vaultX, vaultY, tokenProgramX, tokenProgramY, spreadConfigInitialized = false, authorityAtaX, authorityAtaY, programId = HADRON_PROGRAM_ID) {
1220
1279
  const data = Buffer.alloc(1);
1221
1280
  data.writeUInt8(Discriminator.ClosePool, 0);
1222
1281
  const keys = [
@@ -1239,6 +1298,12 @@ function buildClosePool(authority, configPda, midpriceOraclePda, curveMetaPda, c
1239
1298
  isWritable: true
1240
1299
  });
1241
1300
  }
1301
+ if (authorityAtaX) {
1302
+ keys.push({ pubkey: authorityAtaX, isSigner: false, isWritable: true });
1303
+ }
1304
+ if (authorityAtaY) {
1305
+ keys.push({ pubkey: authorityAtaY, isSigner: false, isWritable: true });
1306
+ }
1242
1307
  return new (0, _web3js.TransactionInstruction)({ programId, keys, data });
1243
1308
  }
1244
1309
 
@@ -1340,7 +1405,8 @@ var Hadron = class _Hadron {
1340
1405
  mintX: params.mintX,
1341
1406
  mintY: params.mintY,
1342
1407
  maxPrefabSlots,
1343
- maxCurvePoints
1408
+ maxCurvePoints,
1409
+ authority: params.authority
1344
1410
  };
1345
1411
  const instructions = [];
1346
1412
  const size = curvePrefabsSize(maxPrefabSlots, maxCurvePoints);
@@ -1683,7 +1749,7 @@ var Hadron = class _Hadron {
1683
1749
  return decoded.triggers;
1684
1750
  }
1685
1751
  /** Build close pool instruction. */
1686
- closePool(authority) {
1752
+ closePool(authority, authorityAtaX, authorityAtaY) {
1687
1753
  return buildClosePool(
1688
1754
  authority,
1689
1755
  this.poolAddress,
@@ -1696,6 +1762,8 @@ var Hadron = class _Hadron {
1696
1762
  this.config.tokenProgramX,
1697
1763
  this.config.tokenProgramY,
1698
1764
  this.config.spreadConfigInitialized,
1765
+ authorityAtaX,
1766
+ authorityAtaY,
1699
1767
  this.programId
1700
1768
  );
1701
1769
  }
@@ -2435,5 +2503,8 @@ async function getOrCreateAta(connection, mint, owner, payer, tokenProgram = _sp
2435
2503
 
2436
2504
 
2437
2505
 
2438
- exports.ABSOLUTE_MAX_CURVE_POINTS = ABSOLUTE_MAX_CURVE_POINTS; exports.ABSOLUTE_MAX_PREFAB_SLOTS = ABSOLUTE_MAX_PREFAB_SLOTS; exports.CONFIG_SEED = CONFIG_SEED; exports.CONFIG_SIZE = CONFIG_SIZE; exports.CURVE_META_SEED = CURVE_META_SEED; exports.CURVE_META_SIZE = CURVE_META_SIZE; exports.CURVE_POINT_LEN = CURVE_POINT_LEN; exports.CURVE_PREFABS_SEED = CURVE_PREFABS_SEED; exports.CURVE_SIDE_HEADER = CURVE_SIDE_HEADER; exports.CURVE_UPDATES_SEED = CURVE_UPDATES_SEED; exports.CURVE_UPDATES_SIZE = CURVE_UPDATES_SIZE; exports.CURVE_UPDATE_OP_SIZE = CURVE_UPDATE_OP_SIZE; exports.CurveType = CurveType; exports.CurveUpdateOpKind = CurveUpdateOpKind; exports.CurveXMode = CurveXMode; exports.DEFAULT_MAX_CURVE_POINTS = DEFAULT_MAX_CURVE_POINTS; exports.DEFAULT_MAX_PREFAB_SLOTS = DEFAULT_MAX_PREFAB_SLOTS; exports.Discriminator = Discriminator; exports.FEE_CONFIG_SEED = FEE_CONFIG_SEED; exports.FEE_CONFIG_SIZE = FEE_CONFIG_SIZE; exports.HADRON_PROGRAM_ID = HADRON_PROGRAM_ID; exports.Hadron = Hadron; exports.HadronOrderbook = HadronOrderbook; exports.Interpolation = Interpolation; exports.MAX_CURVE_UPDATE_OPS = MAX_CURVE_UPDATE_OPS; exports.MAX_SETCURVE_POINTS = MAX_SETCURVE_POINTS; exports.MIDPRICE_ORACLE_SEED = MIDPRICE_ORACLE_SEED; exports.MIDPRICE_ORACLE_SIZE = MIDPRICE_ORACLE_SIZE; exports.NATIVE_MINT = _spltoken.NATIVE_MINT; exports.OracleMode = OracleMode; exports.POINT_DATA_SIZE = POINT_DATA_SIZE; exports.PoolState = PoolState; exports.Q32_ONE = Q32_ONE; exports.RiskMode = RiskMode; exports.SPREAD_CONFIG_SEED = SPREAD_CONFIG_SEED; exports.Side = Side; exports.buildAcceptAuthority = buildAcceptAuthority; exports.buildAllocateCurvePrefabs = buildAllocateCurvePrefabs; exports.buildApplyCurveUpdates = buildApplyCurveUpdates; exports.buildClosePool = buildClosePool; exports.buildDeposit = buildDeposit; exports.buildInitialize = buildInitialize; exports.buildInitializeFeeConfig = buildInitializeFeeConfig; exports.buildInitializeSpreadConfig = buildInitializeSpreadConfig; exports.buildNominateAuthority = buildNominateAuthority; exports.buildRotateFeeAdmin = buildRotateFeeAdmin; exports.buildSetCurve = buildSetCurve; exports.buildSetCurveBoth = buildSetCurveBoth; exports.buildSetPoolState = buildSetPoolState; exports.buildSetQuotingAuthority = buildSetQuotingAuthority; exports.buildSetRiskCurve = buildSetRiskCurve; exports.buildSetRiskCurveAbsolute = buildSetRiskCurveAbsolute; exports.buildSetRiskCurveAbsoluteBoth = buildSetRiskCurveAbsoluteBoth; exports.buildSetRiskCurveBoth = buildSetRiskCurveBoth; exports.buildSubmitCurveUpdates = buildSubmitCurveUpdates; exports.buildSwapExactIn = buildSwapExactIn; exports.buildSwitchPriceCurve = buildSwitchPriceCurve; exports.buildSwitchRiskCurve = buildSwitchRiskCurve; exports.buildUpdateBaseSpread = buildUpdateBaseSpread; exports.buildUpdateDeltaStaleness = buildUpdateDeltaStaleness; exports.buildUpdateFeeConfig = buildUpdateFeeConfig; exports.buildUpdateMidprice = buildUpdateMidprice; exports.buildUpdateMidpriceAndBaseSpread = buildUpdateMidpriceAndBaseSpread; exports.buildUpdateSpreadConfig = buildUpdateSpreadConfig; exports.buildWithdraw = buildWithdraw; exports.createWsolAtaInstruction = createWsolAtaInstruction; exports.curvePrefabsSize = curvePrefabsSize; exports.decodeActiveCurves = decodeActiveCurves; exports.decodeConfig = decodeConfig; exports.decodeCurveMeta = decodeCurveMeta; exports.decodeCurveSide = decodeCurveSide; exports.decodeCurveUpdates = decodeCurveUpdates; exports.decodeFeeConfig = decodeFeeConfig; exports.decodeMidpriceOracle = decodeMidpriceOracle; exports.decodeSpreadConfig = decodeSpreadConfig; exports.derivePoolAddresses = derivePoolAddresses; exports.fromQ32 = fromQ32; exports.getConfigAddress = getConfigAddress; exports.getCurveMetaAddress = getCurveMetaAddress; exports.getCurvePrefabsAddress = getCurvePrefabsAddress; exports.getCurveUpdatesAddress = getCurveUpdatesAddress; exports.getFeeConfigAddress = getFeeConfigAddress; exports.getMidpriceOracleAddress = getMidpriceOracleAddress; exports.getOrCreateAta = getOrCreateAta; exports.getSpreadConfigAddress = getSpreadConfigAddress; exports.isNativeMint = isNativeMint; exports.isSlotInitialized = isSlotInitialized; exports.pctToQ32 = pctToQ32; exports.spreadBpsToQ32 = spreadBpsToQ32; exports.spreadQ32ToBps = spreadQ32ToBps; exports.toQ32 = toQ32; exports.unwrapSolInstruction = unwrapSolInstruction; exports.wrapSolInstructions = wrapSolInstructions;
2506
+
2507
+
2508
+
2509
+ exports.ABSOLUTE_MAX_CURVE_POINTS = ABSOLUTE_MAX_CURVE_POINTS; exports.ABSOLUTE_MAX_PREFAB_SLOTS = ABSOLUTE_MAX_PREFAB_SLOTS; exports.CONFIG_SEED = CONFIG_SEED; exports.CONFIG_SIZE = CONFIG_SIZE; exports.CURVE_META_SEED = CURVE_META_SEED; exports.CURVE_META_SIZE = CURVE_META_SIZE; exports.CURVE_POINT_LEN = CURVE_POINT_LEN; exports.CURVE_PREFABS_SEED = CURVE_PREFABS_SEED; exports.CURVE_SIDE_HEADER = CURVE_SIDE_HEADER; exports.CURVE_UPDATES_SEED = CURVE_UPDATES_SEED; exports.CURVE_UPDATES_SIZE = CURVE_UPDATES_SIZE; exports.CURVE_UPDATE_OP_SIZE = CURVE_UPDATE_OP_SIZE; exports.CurveType = CurveType; exports.CurveUpdateOpKind = CurveUpdateOpKind; exports.CurveXMode = CurveXMode; exports.DEFAULT_MAX_CURVE_POINTS = DEFAULT_MAX_CURVE_POINTS; exports.DEFAULT_MAX_PREFAB_SLOTS = DEFAULT_MAX_PREFAB_SLOTS; exports.Discriminator = Discriminator; exports.FEE_CONFIG_SEED = FEE_CONFIG_SEED; exports.FEE_CONFIG_SIZE = FEE_CONFIG_SIZE; exports.HADRON_PROGRAM_ID = HADRON_PROGRAM_ID; exports.Hadron = Hadron; exports.HadronOrderbook = HadronOrderbook; exports.Interpolation = Interpolation; exports.MAX_CURVE_UPDATE_OPS = MAX_CURVE_UPDATE_OPS; exports.MAX_SETCURVE_POINTS = MAX_SETCURVE_POINTS; exports.MIDPRICE_ORACLE_SEED = MIDPRICE_ORACLE_SEED; exports.MIDPRICE_ORACLE_SIZE = MIDPRICE_ORACLE_SIZE; exports.NATIVE_MINT = _spltoken.NATIVE_MINT; exports.OracleMode = OracleMode; exports.POINT_DATA_SIZE = POINT_DATA_SIZE; exports.PoolState = PoolState; exports.Q32_ONE = Q32_ONE; exports.RiskMode = RiskMode; exports.SPREAD_CONFIG_SEED = SPREAD_CONFIG_SEED; exports.Side = Side; exports.buildAcceptAuthority = buildAcceptAuthority; exports.buildAllocateCurvePrefabs = buildAllocateCurvePrefabs; exports.buildApplyCurveUpdates = buildApplyCurveUpdates; exports.buildClosePool = buildClosePool; exports.buildDeposit = buildDeposit; exports.buildInitialize = buildInitialize; exports.buildInitializeFeeConfig = buildInitializeFeeConfig; exports.buildInitializePoolFeeConfig = buildInitializePoolFeeConfig; exports.buildInitializeSpreadConfig = buildInitializeSpreadConfig; exports.buildNominateAuthority = buildNominateAuthority; exports.buildRotateFeeAdmin = buildRotateFeeAdmin; exports.buildSetCurve = buildSetCurve; exports.buildSetCurveBoth = buildSetCurveBoth; exports.buildSetPoolState = buildSetPoolState; exports.buildSetQuotingAuthority = buildSetQuotingAuthority; exports.buildSetRiskCurve = buildSetRiskCurve; exports.buildSetRiskCurveAbsolute = buildSetRiskCurveAbsolute; exports.buildSetRiskCurveAbsoluteBoth = buildSetRiskCurveAbsoluteBoth; exports.buildSetRiskCurveBoth = buildSetRiskCurveBoth; exports.buildSubmitCurveUpdates = buildSubmitCurveUpdates; exports.buildSwapExactIn = buildSwapExactIn; exports.buildSwitchPriceCurve = buildSwitchPriceCurve; exports.buildSwitchRiskCurve = buildSwitchRiskCurve; exports.buildUpdateBaseSpread = buildUpdateBaseSpread; exports.buildUpdateDeltaStaleness = buildUpdateDeltaStaleness; exports.buildUpdateFeeConfig = buildUpdateFeeConfig; exports.buildUpdateMidprice = buildUpdateMidprice; exports.buildUpdateMidpriceAndBaseSpread = buildUpdateMidpriceAndBaseSpread; exports.buildUpdatePoolFeeConfig = buildUpdatePoolFeeConfig; exports.buildUpdateSpreadConfig = buildUpdateSpreadConfig; exports.buildWithdraw = buildWithdraw; exports.createWsolAtaInstruction = createWsolAtaInstruction; exports.curvePrefabsSize = curvePrefabsSize; exports.decodeActiveCurves = decodeActiveCurves; exports.decodeConfig = decodeConfig; exports.decodeCurveMeta = decodeCurveMeta; exports.decodeCurveSide = decodeCurveSide; exports.decodeCurveUpdates = decodeCurveUpdates; exports.decodeFeeConfig = decodeFeeConfig; exports.decodeMidpriceOracle = decodeMidpriceOracle; exports.decodeSpreadConfig = decodeSpreadConfig; exports.derivePoolAddresses = derivePoolAddresses; exports.fromQ32 = fromQ32; exports.getConfigAddress = getConfigAddress; exports.getCurveMetaAddress = getCurveMetaAddress; exports.getCurvePrefabsAddress = getCurvePrefabsAddress; exports.getCurveUpdatesAddress = getCurveUpdatesAddress; exports.getFeeConfigAddress = getFeeConfigAddress; exports.getMidpriceOracleAddress = getMidpriceOracleAddress; exports.getOrCreateAta = getOrCreateAta; exports.getPoolFeeConfigAddress = getPoolFeeConfigAddress; exports.getSpreadConfigAddress = getSpreadConfigAddress; exports.isNativeMint = isNativeMint; exports.isSlotInitialized = isSlotInitialized; exports.pctToQ32 = pctToQ32; exports.spreadBpsToQ32 = spreadBpsToQ32; exports.spreadQ32ToBps = spreadQ32ToBps; exports.toQ32 = toQ32; exports.unwrapSolInstruction = unwrapSolInstruction; exports.wrapSolInstructions = wrapSolInstructions;
2439
2510
  //# sourceMappingURL=index.js.map