@hyperbridge/sdk 2.8.7 → 2.8.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.
@@ -2992,9 +2992,9 @@ interface AvailableLiquidity {
2992
2992
  }) | null;
2993
2993
  }
2994
2994
  /**
2995
- * Chain-specific buy and sell rates expressed as quote-token units per one
2996
- * base token. The quote token is the less valuable currency when the indexed
2997
- * rates establish an ordering (for example, cNGN in a USDC/cNGN pair).
2995
+ * Aggregate indexed pool buy and sell rates expressed as quote-token units per
2996
+ * one base token. The quote token is the less valuable currency when the rates
2997
+ * establish an ordering (for example, cNGN in a USDC/cNGN pair).
2998
2998
  */
2999
2999
  interface BuyAndSellRates {
3000
3000
  baseTokenSymbol: ConfiguredAssetSymbol;
@@ -5007,6 +5007,18 @@ interface PhantomAggregation {
5007
5007
  interface AggregationLogger {
5008
5008
  warn: (payload: unknown, message: string) => void;
5009
5009
  }
5010
+ /**
5011
+ * Haircut applied to a quote that is priced off a Uniswap V4 pool, in basis points.
5012
+ *
5013
+ * A bid that declares V4 positions is quoting off those pools, and a pool price is what a trade
5014
+ * gets BEFORE the pool takes its fee — so the amount such a bid names is more than the solver
5015
+ * would actually be left holding once the swap that sources it clears. 30bps is the fee tier the
5016
+ * pools these positions sit in charge, so netting it out here is what makes a pool-priced quote
5017
+ * comparable to a wallet-funded one, whose inventory has already paid its cost of goods.
5018
+ */
5019
+ declare const UNISWAP_QUOTE_HAIRCUT_BPS = 30n;
5020
+ /** Applies {@link UNISWAP_QUOTE_HAIRCUT_BPS} to a quoted output amount, rounding down. */
5021
+ declare function applyUniswapQuoteHaircut(amount: bigint): bigint;
5010
5022
  declare function weightedMedian(entries: {
5011
5023
  price: bigint;
5012
5024
  weight: bigint;
@@ -7916,4 +7928,4 @@ declare const _default: {
7916
7928
  }];
7917
7929
  };
7918
7930
 
7919
- export { type AssetTeleportedResponse as $, type AssetTeleported as A, type BuyAndSellRates as B, ChainConfigService as C, type Bid as D, type EstimateGasCallData as E, type FillerBid as F, type GetRequestWithStatus as G, type HexString$1 as H, type IChain as I, type EstimateFillOrderParams as J, type FillOrderEstimate as K, type OrderFeesQuote as L, type ERC7821Call as M, type OrderWithStatus as N, type Order as O, type PostRequestWithStatus as P, type QueryBuyAndSellRatesParams as Q, type RetryConfig as R, type StateMachineIdParams as S, type Transaction as T, OrderStatus as U, type TokenGatewayAssetTeleportedWithStatus as V, TeleportStatus as W, type DecodedOrderPlacedLog as X, type DecodedPostRequestEvent as Y, type DecodedPostResponseEvent as Z, type AllStatusKey as _, type IEvmConfig as a, type SigningAccount as a$, type BidStorageEntry as a0, type BidSubmissionResult as a1, type BlockMetadata as a2, type BytesLikeHex as a3, type CancelOptions as a4, type ChainConfig as a5, type ChainConfigData as a6, Chains as a7, type ConfiguredAssetSymbol as a8, type ConfiguredAssetSymbolInput as a9, type ITimeoutPostRequestMessage as aA, ABI as aB, type IntentGatewayParams as aC, IntentOrderStatus as aD, type IntentOrderStatusKey as aE, type IsmpRequest as aF, type LiquiditySlice as aG, type OrderResponse as aH, type OrderStatusMetadata as aI, type PaymentInfo as aJ, type PhantomBid as aK, type PhantomBidBatchResult as aL, type PhantomBidDeclaration as aM, type PhantomBidOutcome as aN, type PhantomOrderEvent as aO, type PhantomOrderLeg as aP, type PhantomOrderPriceSnapshot as aQ, type PhantomOrderPriceSnapshotsResponse as aR, type PollPhantomOrdersOptions as aS, type PostRequestStatus as aT, type RequestBody as aU, type RequestCommitment as aV, RequestKind as aW, type RequestResponse as aX, RequestStatus as aY, type RequestStatusKey as aZ, type SelectOptions as a_, type Deployment as aa, type DispatchGet as ab, type DispatchInfo as ac, type DispatchPost as ad, type Erc4626VaultConfigData as ae, type ExecuteIntentOrderOptions as af, type ExecutionResult as ag, type FillOptions as ah, type FillerConfig as ai, type GetRequestResponse as aj, type GetResponseByRequestIdResponse as ak, type GetResponseStorageValues as al, type HostParams as am, HyperClientStatus as an, type IBatchConsensusAndGetResponseMessage as ao, type IBatchConsensusAndPostRequestMessage as ap, type IConfig as aq, type IConsensusMessage as ar, type IGetRequestMessage as as, type IGetResponse as at, type IGetResponseMessage as au, type IHyperbridgeConfig as av, INCLUSION_TIMEOUT_MS as aw, type IPostResponse as ax, type IRequestMessage as ay, type ISubstrateConfig as az, type IMessage as b, recoverBidSignerViem as b$, type StateMachineId as b0, type StateMachineResponse as b1, type StorageFacade as b2, TimeoutStatus as b3, type TimeoutStatusKey as b4, type TokenGatewayAssetTeleportedResponse as b5, type TokenInfo as b6, type TokenPrice as b7, type TokenPricesResponse as b8, type UniswapV4PoolConfigData as b9, poolSlug as bA, sortPoolSymbols as bB, tronChainIds as bC, tronNile as bD, type AggregationLogger as bE, type BidNonceKeyFn as bF, type BidSignature as bG, ENTRY_POINT_V08_ADDRESS as bH, FILL_ORDER_ABI as bI, type FetchLike as bJ, type FillData as bK, type HexString as bL, _default as bM, type LpBalance as bN, type OrderCommitmentFn as bO, type PhantomAggregation as bP, type PhantomLegAggregation as bQ, type PhantomLegBidder as bR, type RecoverBidSigner as bS, type RpcBidInfo as bT, type SolverBalanceReader as bU, type YieldVaultMap as bV, aggregatePhantomBids as bW, extractFillData as bX, fetchBidsForOrder as bY, memoizedSolverBalance as bZ, orderCommitmentFromDecoded as b_, chainConfigs as ba, convertCodecToIGetRequest as bb, convertCodecToIProof as bc, convertIGetRequestToCodec as bd, convertIProofToCodec as be, convertStateIdToStateMachineId as bf, convertStateMachineEnumToString as bg, convertStateMachineIdToEnum as bh, decodeAcceptedSourceChains as bi, decodeERC7821ExecuteBatch as bj, decodePhantomBidDeclaration as bk, decodeUserOpScale as bl, deriveHttpUrl as bm, encodeAcceptedSourceChains as bn, encodeERC7821ExecuteBatch as bo, encodeISMPMessage as bp, encodePhantomBidDeclaration as bq, encodeUserOpScale as br, getChainId as bs, getConfigByStateMachineId as bt, getViemChain as bu, hyperbridgeAddress as bv, pharosAtlantic as bw, pharosMainnet as bx, polkadotAssetHubPaseo as by, polkadotHubMainnet as bz, type StateMachineHeight as c, setAggregationFetch as c0, splitBidSignature as c1, weightedMedian as c2, zipFillLegs as c3, type IIsmpMessage as d, type IPostRequest as e, type IGetRequest as f, type IPolkadotHubConfig as g, type IPharosConfig as h, type StateMachineUpdate as i, type ResponseCommitmentWithValues as j, type RequestStatusWithMetadata as k, type PostRequestTimeoutStatus as l, SubstrateChain as m, type ClientConfig as n, type IndexerQueryClient as o, type IProof as p, type IEvmChain as q, IntentsCoprocessor as r, type AvailableLiquidity as s, type IntentOrderStatusUpdate as t, type SelectBidResult as u, type ResumeIntentOrderOptions as v, type CancelOrderOptions as w, type CancelQuote as x, type SubmitBidOptions as y, type PackedUserOperation as z };
7931
+ export { type DecodedPostResponseEvent as $, type AssetTeleported as A, type BuyAndSellRates as B, ChainConfigService as C, type SubmitBidOptions as D, type EstimateGasCallData as E, type PackedUserOperation as F, type GetRequestWithStatus as G, type HexString$1 as H, type IChain as I, type FillerBid as J, type Bid as K, type EstimateFillOrderParams as L, type FillOrderEstimate as M, type OrderFeesQuote as N, type Order as O, type PostRequestWithStatus as P, type QueryBuyAndSellRatesParams as Q, type RetryConfig as R, type StateMachineIdParams as S, type Transaction as T, type ERC7821Call as U, type OrderWithStatus as V, OrderStatus as W, type TokenGatewayAssetTeleportedWithStatus as X, TeleportStatus as Y, type DecodedOrderPlacedLog as Z, type DecodedPostRequestEvent as _, type IEvmConfig as a, type SigningAccount as a$, type AllStatusKey as a0, type AssetTeleportedResponse as a1, type BidStorageEntry as a2, type BidSubmissionResult as a3, type BlockMetadata as a4, type BytesLikeHex as a5, type CancelOptions as a6, type ChainConfig as a7, type ChainConfigData as a8, type ConfiguredAssetSymbolInput as a9, type ITimeoutPostRequestMessage as aA, ABI as aB, type IntentGatewayParams as aC, IntentOrderStatus as aD, type IntentOrderStatusKey as aE, type IsmpRequest as aF, type LiquiditySlice as aG, type OrderResponse as aH, type OrderStatusMetadata as aI, type PaymentInfo as aJ, type PhantomBid as aK, type PhantomBidBatchResult as aL, type PhantomBidDeclaration as aM, type PhantomBidOutcome as aN, type PhantomOrderEvent as aO, type PhantomOrderLeg as aP, type PhantomOrderPriceSnapshot as aQ, type PhantomOrderPriceSnapshotsResponse as aR, type PollPhantomOrdersOptions as aS, type PostRequestStatus as aT, type RequestBody as aU, type RequestCommitment as aV, RequestKind as aW, type RequestResponse as aX, RequestStatus as aY, type RequestStatusKey as aZ, type SelectOptions as a_, type Deployment as aa, type DispatchGet as ab, type DispatchInfo as ac, type DispatchPost as ad, type Erc4626VaultConfigData as ae, type ExecuteIntentOrderOptions as af, type ExecutionResult as ag, type FillOptions as ah, type FillerConfig as ai, type GetRequestResponse as aj, type GetResponseByRequestIdResponse as ak, type GetResponseStorageValues as al, type HostParams as am, HyperClientStatus as an, type IBatchConsensusAndGetResponseMessage as ao, type IBatchConsensusAndPostRequestMessage as ap, type IConfig as aq, type IConsensusMessage as ar, type IGetRequestMessage as as, type IGetResponse as at, type IGetResponseMessage as au, type IHyperbridgeConfig as av, INCLUSION_TIMEOUT_MS as aw, type IPostResponse as ax, type IRequestMessage as ay, type ISubstrateConfig as az, type IMessage as b, memoizedSolverBalance as b$, type StateMachineId as b0, type StateMachineResponse as b1, type StorageFacade as b2, TimeoutStatus as b3, type TimeoutStatusKey as b4, type TokenGatewayAssetTeleportedResponse as b5, type TokenInfo as b6, type TokenPrice as b7, type TokenPricesResponse as b8, UNISWAP_QUOTE_HAIRCUT_BPS as b9, polkadotAssetHubPaseo as bA, polkadotHubMainnet as bB, poolSlug as bC, sortPoolSymbols as bD, tronChainIds as bE, tronNile as bF, type AggregationLogger as bG, type BidNonceKeyFn as bH, type BidSignature as bI, ENTRY_POINT_V08_ADDRESS as bJ, FILL_ORDER_ABI as bK, type FetchLike as bL, type FillData as bM, type HexString as bN, _default as bO, type LpBalance as bP, type OrderCommitmentFn as bQ, type PhantomAggregation as bR, type PhantomLegAggregation as bS, type PhantomLegBidder as bT, type RecoverBidSigner as bU, type RpcBidInfo as bV, type SolverBalanceReader as bW, type YieldVaultMap as bX, aggregatePhantomBids as bY, extractFillData as bZ, fetchBidsForOrder as b_, type UniswapV4PoolConfigData as ba, applyUniswapQuoteHaircut as bb, chainConfigs as bc, convertCodecToIGetRequest as bd, convertCodecToIProof as be, convertIGetRequestToCodec as bf, convertIProofToCodec as bg, convertStateIdToStateMachineId as bh, convertStateMachineEnumToString as bi, convertStateMachineIdToEnum as bj, decodeAcceptedSourceChains as bk, decodeERC7821ExecuteBatch as bl, decodePhantomBidDeclaration as bm, decodeUserOpScale as bn, deriveHttpUrl as bo, encodeAcceptedSourceChains as bp, encodeERC7821ExecuteBatch as bq, encodeISMPMessage as br, encodePhantomBidDeclaration as bs, encodeUserOpScale as bt, getChainId as bu, getConfigByStateMachineId as bv, getViemChain as bw, hyperbridgeAddress as bx, pharosAtlantic as by, pharosMainnet as bz, type StateMachineHeight as c, orderCommitmentFromDecoded as c0, recoverBidSignerViem as c1, setAggregationFetch as c2, splitBidSignature as c3, weightedMedian as c4, zipFillLegs as c5, type IIsmpMessage as d, type IPostRequest as e, type IGetRequest as f, type IPolkadotHubConfig as g, type IPharosConfig as h, type StateMachineUpdate as i, type ResponseCommitmentWithValues as j, type RequestStatusWithMetadata as k, type PostRequestTimeoutStatus as l, SubstrateChain as m, type ClientConfig as n, type IndexerQueryClient as o, type IProof as p, type IEvmChain as q, IntentsCoprocessor as r, Chains as s, type ConfiguredAssetSymbol as t, type AvailableLiquidity as u, type IntentOrderStatusUpdate as v, type SelectBidResult as w, type ResumeIntentOrderOptions as x, type CancelOrderOptions as y, type CancelQuote as z };
@@ -2992,9 +2992,9 @@ interface AvailableLiquidity {
2992
2992
  }) | null;
2993
2993
  }
2994
2994
  /**
2995
- * Chain-specific buy and sell rates expressed as quote-token units per one
2996
- * base token. The quote token is the less valuable currency when the indexed
2997
- * rates establish an ordering (for example, cNGN in a USDC/cNGN pair).
2995
+ * Aggregate indexed pool buy and sell rates expressed as quote-token units per
2996
+ * one base token. The quote token is the less valuable currency when the rates
2997
+ * establish an ordering (for example, cNGN in a USDC/cNGN pair).
2998
2998
  */
2999
2999
  interface BuyAndSellRates {
3000
3000
  baseTokenSymbol: ConfiguredAssetSymbol;
@@ -5007,6 +5007,18 @@ interface PhantomAggregation {
5007
5007
  interface AggregationLogger {
5008
5008
  warn: (payload: unknown, message: string) => void;
5009
5009
  }
5010
+ /**
5011
+ * Haircut applied to a quote that is priced off a Uniswap V4 pool, in basis points.
5012
+ *
5013
+ * A bid that declares V4 positions is quoting off those pools, and a pool price is what a trade
5014
+ * gets BEFORE the pool takes its fee — so the amount such a bid names is more than the solver
5015
+ * would actually be left holding once the swap that sources it clears. 30bps is the fee tier the
5016
+ * pools these positions sit in charge, so netting it out here is what makes a pool-priced quote
5017
+ * comparable to a wallet-funded one, whose inventory has already paid its cost of goods.
5018
+ */
5019
+ declare const UNISWAP_QUOTE_HAIRCUT_BPS = 30n;
5020
+ /** Applies {@link UNISWAP_QUOTE_HAIRCUT_BPS} to a quoted output amount, rounding down. */
5021
+ declare function applyUniswapQuoteHaircut(amount: bigint): bigint;
5010
5022
  declare function weightedMedian(entries: {
5011
5023
  price: bigint;
5012
5024
  weight: bigint;
@@ -7916,4 +7928,4 @@ declare const _default: {
7916
7928
  }];
7917
7929
  };
7918
7930
 
7919
- export { type AssetTeleportedResponse as $, type AssetTeleported as A, type BuyAndSellRates as B, ChainConfigService as C, type Bid as D, type EstimateGasCallData as E, type FillerBid as F, type GetRequestWithStatus as G, type HexString$1 as H, type IChain as I, type EstimateFillOrderParams as J, type FillOrderEstimate as K, type OrderFeesQuote as L, type ERC7821Call as M, type OrderWithStatus as N, type Order as O, type PostRequestWithStatus as P, type QueryBuyAndSellRatesParams as Q, type RetryConfig as R, type StateMachineIdParams as S, type Transaction as T, OrderStatus as U, type TokenGatewayAssetTeleportedWithStatus as V, TeleportStatus as W, type DecodedOrderPlacedLog as X, type DecodedPostRequestEvent as Y, type DecodedPostResponseEvent as Z, type AllStatusKey as _, type IEvmConfig as a, type SigningAccount as a$, type BidStorageEntry as a0, type BidSubmissionResult as a1, type BlockMetadata as a2, type BytesLikeHex as a3, type CancelOptions as a4, type ChainConfig as a5, type ChainConfigData as a6, Chains as a7, type ConfiguredAssetSymbol as a8, type ConfiguredAssetSymbolInput as a9, type ITimeoutPostRequestMessage as aA, ABI as aB, type IntentGatewayParams as aC, IntentOrderStatus as aD, type IntentOrderStatusKey as aE, type IsmpRequest as aF, type LiquiditySlice as aG, type OrderResponse as aH, type OrderStatusMetadata as aI, type PaymentInfo as aJ, type PhantomBid as aK, type PhantomBidBatchResult as aL, type PhantomBidDeclaration as aM, type PhantomBidOutcome as aN, type PhantomOrderEvent as aO, type PhantomOrderLeg as aP, type PhantomOrderPriceSnapshot as aQ, type PhantomOrderPriceSnapshotsResponse as aR, type PollPhantomOrdersOptions as aS, type PostRequestStatus as aT, type RequestBody as aU, type RequestCommitment as aV, RequestKind as aW, type RequestResponse as aX, RequestStatus as aY, type RequestStatusKey as aZ, type SelectOptions as a_, type Deployment as aa, type DispatchGet as ab, type DispatchInfo as ac, type DispatchPost as ad, type Erc4626VaultConfigData as ae, type ExecuteIntentOrderOptions as af, type ExecutionResult as ag, type FillOptions as ah, type FillerConfig as ai, type GetRequestResponse as aj, type GetResponseByRequestIdResponse as ak, type GetResponseStorageValues as al, type HostParams as am, HyperClientStatus as an, type IBatchConsensusAndGetResponseMessage as ao, type IBatchConsensusAndPostRequestMessage as ap, type IConfig as aq, type IConsensusMessage as ar, type IGetRequestMessage as as, type IGetResponse as at, type IGetResponseMessage as au, type IHyperbridgeConfig as av, INCLUSION_TIMEOUT_MS as aw, type IPostResponse as ax, type IRequestMessage as ay, type ISubstrateConfig as az, type IMessage as b, recoverBidSignerViem as b$, type StateMachineId as b0, type StateMachineResponse as b1, type StorageFacade as b2, TimeoutStatus as b3, type TimeoutStatusKey as b4, type TokenGatewayAssetTeleportedResponse as b5, type TokenInfo as b6, type TokenPrice as b7, type TokenPricesResponse as b8, type UniswapV4PoolConfigData as b9, poolSlug as bA, sortPoolSymbols as bB, tronChainIds as bC, tronNile as bD, type AggregationLogger as bE, type BidNonceKeyFn as bF, type BidSignature as bG, ENTRY_POINT_V08_ADDRESS as bH, FILL_ORDER_ABI as bI, type FetchLike as bJ, type FillData as bK, type HexString as bL, _default as bM, type LpBalance as bN, type OrderCommitmentFn as bO, type PhantomAggregation as bP, type PhantomLegAggregation as bQ, type PhantomLegBidder as bR, type RecoverBidSigner as bS, type RpcBidInfo as bT, type SolverBalanceReader as bU, type YieldVaultMap as bV, aggregatePhantomBids as bW, extractFillData as bX, fetchBidsForOrder as bY, memoizedSolverBalance as bZ, orderCommitmentFromDecoded as b_, chainConfigs as ba, convertCodecToIGetRequest as bb, convertCodecToIProof as bc, convertIGetRequestToCodec as bd, convertIProofToCodec as be, convertStateIdToStateMachineId as bf, convertStateMachineEnumToString as bg, convertStateMachineIdToEnum as bh, decodeAcceptedSourceChains as bi, decodeERC7821ExecuteBatch as bj, decodePhantomBidDeclaration as bk, decodeUserOpScale as bl, deriveHttpUrl as bm, encodeAcceptedSourceChains as bn, encodeERC7821ExecuteBatch as bo, encodeISMPMessage as bp, encodePhantomBidDeclaration as bq, encodeUserOpScale as br, getChainId as bs, getConfigByStateMachineId as bt, getViemChain as bu, hyperbridgeAddress as bv, pharosAtlantic as bw, pharosMainnet as bx, polkadotAssetHubPaseo as by, polkadotHubMainnet as bz, type StateMachineHeight as c, setAggregationFetch as c0, splitBidSignature as c1, weightedMedian as c2, zipFillLegs as c3, type IIsmpMessage as d, type IPostRequest as e, type IGetRequest as f, type IPolkadotHubConfig as g, type IPharosConfig as h, type StateMachineUpdate as i, type ResponseCommitmentWithValues as j, type RequestStatusWithMetadata as k, type PostRequestTimeoutStatus as l, SubstrateChain as m, type ClientConfig as n, type IndexerQueryClient as o, type IProof as p, type IEvmChain as q, IntentsCoprocessor as r, type AvailableLiquidity as s, type IntentOrderStatusUpdate as t, type SelectBidResult as u, type ResumeIntentOrderOptions as v, type CancelOrderOptions as w, type CancelQuote as x, type SubmitBidOptions as y, type PackedUserOperation as z };
7931
+ export { type DecodedPostResponseEvent as $, type AssetTeleported as A, type BuyAndSellRates as B, ChainConfigService as C, type SubmitBidOptions as D, type EstimateGasCallData as E, type PackedUserOperation as F, type GetRequestWithStatus as G, type HexString$1 as H, type IChain as I, type FillerBid as J, type Bid as K, type EstimateFillOrderParams as L, type FillOrderEstimate as M, type OrderFeesQuote as N, type Order as O, type PostRequestWithStatus as P, type QueryBuyAndSellRatesParams as Q, type RetryConfig as R, type StateMachineIdParams as S, type Transaction as T, type ERC7821Call as U, type OrderWithStatus as V, OrderStatus as W, type TokenGatewayAssetTeleportedWithStatus as X, TeleportStatus as Y, type DecodedOrderPlacedLog as Z, type DecodedPostRequestEvent as _, type IEvmConfig as a, type SigningAccount as a$, type AllStatusKey as a0, type AssetTeleportedResponse as a1, type BidStorageEntry as a2, type BidSubmissionResult as a3, type BlockMetadata as a4, type BytesLikeHex as a5, type CancelOptions as a6, type ChainConfig as a7, type ChainConfigData as a8, type ConfiguredAssetSymbolInput as a9, type ITimeoutPostRequestMessage as aA, ABI as aB, type IntentGatewayParams as aC, IntentOrderStatus as aD, type IntentOrderStatusKey as aE, type IsmpRequest as aF, type LiquiditySlice as aG, type OrderResponse as aH, type OrderStatusMetadata as aI, type PaymentInfo as aJ, type PhantomBid as aK, type PhantomBidBatchResult as aL, type PhantomBidDeclaration as aM, type PhantomBidOutcome as aN, type PhantomOrderEvent as aO, type PhantomOrderLeg as aP, type PhantomOrderPriceSnapshot as aQ, type PhantomOrderPriceSnapshotsResponse as aR, type PollPhantomOrdersOptions as aS, type PostRequestStatus as aT, type RequestBody as aU, type RequestCommitment as aV, RequestKind as aW, type RequestResponse as aX, RequestStatus as aY, type RequestStatusKey as aZ, type SelectOptions as a_, type Deployment as aa, type DispatchGet as ab, type DispatchInfo as ac, type DispatchPost as ad, type Erc4626VaultConfigData as ae, type ExecuteIntentOrderOptions as af, type ExecutionResult as ag, type FillOptions as ah, type FillerConfig as ai, type GetRequestResponse as aj, type GetResponseByRequestIdResponse as ak, type GetResponseStorageValues as al, type HostParams as am, HyperClientStatus as an, type IBatchConsensusAndGetResponseMessage as ao, type IBatchConsensusAndPostRequestMessage as ap, type IConfig as aq, type IConsensusMessage as ar, type IGetRequestMessage as as, type IGetResponse as at, type IGetResponseMessage as au, type IHyperbridgeConfig as av, INCLUSION_TIMEOUT_MS as aw, type IPostResponse as ax, type IRequestMessage as ay, type ISubstrateConfig as az, type IMessage as b, memoizedSolverBalance as b$, type StateMachineId as b0, type StateMachineResponse as b1, type StorageFacade as b2, TimeoutStatus as b3, type TimeoutStatusKey as b4, type TokenGatewayAssetTeleportedResponse as b5, type TokenInfo as b6, type TokenPrice as b7, type TokenPricesResponse as b8, UNISWAP_QUOTE_HAIRCUT_BPS as b9, polkadotAssetHubPaseo as bA, polkadotHubMainnet as bB, poolSlug as bC, sortPoolSymbols as bD, tronChainIds as bE, tronNile as bF, type AggregationLogger as bG, type BidNonceKeyFn as bH, type BidSignature as bI, ENTRY_POINT_V08_ADDRESS as bJ, FILL_ORDER_ABI as bK, type FetchLike as bL, type FillData as bM, type HexString as bN, _default as bO, type LpBalance as bP, type OrderCommitmentFn as bQ, type PhantomAggregation as bR, type PhantomLegAggregation as bS, type PhantomLegBidder as bT, type RecoverBidSigner as bU, type RpcBidInfo as bV, type SolverBalanceReader as bW, type YieldVaultMap as bX, aggregatePhantomBids as bY, extractFillData as bZ, fetchBidsForOrder as b_, type UniswapV4PoolConfigData as ba, applyUniswapQuoteHaircut as bb, chainConfigs as bc, convertCodecToIGetRequest as bd, convertCodecToIProof as be, convertIGetRequestToCodec as bf, convertIProofToCodec as bg, convertStateIdToStateMachineId as bh, convertStateMachineEnumToString as bi, convertStateMachineIdToEnum as bj, decodeAcceptedSourceChains as bk, decodeERC7821ExecuteBatch as bl, decodePhantomBidDeclaration as bm, decodeUserOpScale as bn, deriveHttpUrl as bo, encodeAcceptedSourceChains as bp, encodeERC7821ExecuteBatch as bq, encodeISMPMessage as br, encodePhantomBidDeclaration as bs, encodeUserOpScale as bt, getChainId as bu, getConfigByStateMachineId as bv, getViemChain as bw, hyperbridgeAddress as bx, pharosAtlantic as by, pharosMainnet as bz, type StateMachineHeight as c, orderCommitmentFromDecoded as c0, recoverBidSignerViem as c1, setAggregationFetch as c2, splitBidSignature as c3, weightedMedian as c4, zipFillLegs as c5, type IIsmpMessage as d, type IPostRequest as e, type IGetRequest as f, type IPolkadotHubConfig as g, type IPharosConfig as h, type StateMachineUpdate as i, type ResponseCommitmentWithValues as j, type RequestStatusWithMetadata as k, type PostRequestTimeoutStatus as l, SubstrateChain as m, type ClientConfig as n, type IndexerQueryClient as o, type IProof as p, type IEvmChain as q, IntentsCoprocessor as r, Chains as s, type ConfiguredAssetSymbol as t, type AvailableLiquidity as u, type IntentOrderStatusUpdate as v, type SelectBidResult as w, type ResumeIntentOrderOptions as x, type CancelOrderOptions as y, type CancelQuote as z };
@@ -2593,6 +2593,10 @@ function zipFillLegs(assets, outputs) {
2593
2593
  };
2594
2594
  });
2595
2595
  }
2596
+ var UNISWAP_QUOTE_HAIRCUT_BPS = 30n;
2597
+ function applyUniswapQuoteHaircut(amount) {
2598
+ return amount * (10000n - UNISWAP_QUOTE_HAIRCUT_BPS) / 10000n;
2599
+ }
2596
2600
  function weightedMedian(entries) {
2597
2601
  const sorted = [...entries].sort((a, b) => a.price < b.price ? -1 : a.price > b.price ? 1 : 0);
2598
2602
  const totalWeight = sorted.reduce((acc, e) => e.weight > 0n ? acc + e.weight : acc, 0n);
@@ -2951,7 +2955,10 @@ async function runAggregation(params, isDelegated) {
2951
2955
  countedSolvers.add(normalizedSolver);
2952
2956
  const declaration = decodePhantomBidDeclaration(decoded.paymasterAndData);
2953
2957
  const acceptedSources = declaration.acceptedSources;
2954
- const quotedLegs = [...fillData.legs.entries()].filter(([, leg]) => leg.solverAmount !== 0n);
2958
+ const poolPriced = declaration.uniswapV4Positions.length > 0;
2959
+ const quotedLegs = [...fillData.legs.entries()].map(
2960
+ ([legIndex, leg]) => poolPriced ? [legIndex, { ...leg, solverAmount: applyUniswapQuoteHaircut(leg.solverAmount) }] : [legIndex, leg]
2961
+ ).filter(([, leg]) => leg.solverAmount !== 0n);
2955
2962
  const declaredPositions = v4Contracts ? declaration.uniswapV4Positions : [];
2956
2963
  const positions = (await Promise.all(
2957
2964
  declaredPositions.map((tokenId) => readPosition(destUrl, chain, v4Contracts, tokenId))
@@ -3031,7 +3038,9 @@ async function runAggregation(params, isDelegated) {
3031
3038
  exports.ENTRY_POINT_V08_ADDRESS = ENTRY_POINT_V08_ADDRESS;
3032
3039
  exports.FILL_ORDER_ABI = FILL_ORDER_ABI;
3033
3040
  exports.IntentGatewayV2 = IntentGatewayV2_default;
3041
+ exports.UNISWAP_QUOTE_HAIRCUT_BPS = UNISWAP_QUOTE_HAIRCUT_BPS;
3034
3042
  exports.aggregatePhantomBids = aggregatePhantomBids;
3043
+ exports.applyUniswapQuoteHaircut = applyUniswapQuoteHaircut;
3035
3044
  exports.decodeAcceptedSourceChains = decodeAcceptedSourceChains;
3036
3045
  exports.decodeERC7821ExecuteBatch = decodeERC7821ExecuteBatch;
3037
3046
  exports.decodePhantomBidDeclaration = decodePhantomBidDeclaration;