@agg-build/ui 4.24.0 → 4.26.0
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/{chunk-Q5NJCH5O.mjs → chunk-4X7OLBO6.mjs} +1 -1
- package/dist/{chunk-HZXHDH6G.mjs → chunk-KN7JN7F5.mjs} +148 -66
- package/dist/{chunk-G4KXZ5XX.mjs → chunk-PHT5VLGB.mjs} +3 -3
- package/dist/{event-market-YBWA2HRJ.mjs → event-market-Q2LBJJ5E.mjs} +2 -2
- package/dist/index.js +149 -68
- package/dist/index.mjs +3 -3
- package/dist/pages.js +149 -68
- package/dist/pages.mjs +3 -3
- package/dist/trading.js +147 -66
- package/dist/trading.mjs +1 -1
- package/dist/types/trading/place-order/index.place-order.utils.d.mts +20 -4
- package/dist/types/trading/place-order/index.place-order.utils.d.ts +20 -4
- package/package.json +3 -3
|
@@ -1193,6 +1193,7 @@ var formatChainIdLabel = (chainId) => {
|
|
|
1193
1193
|
|
|
1194
1194
|
// src/trading/place-order/index.place-order.utils.ts
|
|
1195
1195
|
import {
|
|
1196
|
+
LIMIT_PRICE_RAW_SCALE,
|
|
1196
1197
|
Venue as Venue4
|
|
1197
1198
|
} from "@agg-build/sdk";
|
|
1198
1199
|
var ATOMIC_UNITS = 1e6;
|
|
@@ -1512,13 +1513,16 @@ var getPlaceOrderBuyPayout = (quoteData) => {
|
|
|
1512
1513
|
var _a;
|
|
1513
1514
|
return (_a = quoteData.estimatedPayout) != null ? _a : quoteData.totalFilled;
|
|
1514
1515
|
};
|
|
1515
|
-
var getPlaceOrderSellProceeds = (quoteData) =>
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
);
|
|
1516
|
+
var getPlaceOrderSellProceeds = (quoteData) => {
|
|
1517
|
+
var _a;
|
|
1518
|
+
return (_a = quoteData.estimatedNetProceeds) != null ? _a : Math.max(
|
|
1519
|
+
0,
|
|
1520
|
+
quoteData.rawExecCost - quoteData.fills.reduce((sum, fill) => {
|
|
1521
|
+
var _a2, _b;
|
|
1522
|
+
return sum + ((_a2 = fill.venueFee) != null ? _a2 : 0) + ((_b = fill.builderFee) != null ? _b : 0);
|
|
1523
|
+
}, 0)
|
|
1524
|
+
);
|
|
1525
|
+
};
|
|
1522
1526
|
var getPlaceOrderQuoteValue = (quoteData, tradeSide) => tradeSide === "sell" ? getPlaceOrderSellProceeds(quoteData) : getPlaceOrderBuyPayout(quoteData);
|
|
1523
1527
|
var resolvePlaceOrderNetResult = ({
|
|
1524
1528
|
quoteData,
|
|
@@ -2874,6 +2878,38 @@ var isPercentageBelowMinimum = (value, minimumValue) => {
|
|
|
2874
2878
|
if (parsedValue === null) return false;
|
|
2875
2879
|
return parsedValue < minimumValue;
|
|
2876
2880
|
};
|
|
2881
|
+
var ceilDiv = (numerator, denominator) => {
|
|
2882
|
+
return (numerator + denominator - BigInt(1)) / denominator;
|
|
2883
|
+
};
|
|
2884
|
+
var toRaw6 = (value) => {
|
|
2885
|
+
const normalizedValue = Number.isFinite(value) ? Math.max(0, value) : 0;
|
|
2886
|
+
return Math.ceil(normalizedValue * Number(LIMIT_PRICE_RAW_SCALE)).toString();
|
|
2887
|
+
};
|
|
2888
|
+
var parseSizeStepRaw = (sizeStepRaw) => {
|
|
2889
|
+
if (!sizeStepRaw || !/^[1-9]\d*$/.test(sizeStepRaw)) return BigInt(1);
|
|
2890
|
+
return BigInt(sizeStepRaw);
|
|
2891
|
+
};
|
|
2892
|
+
var toLimitSizeRaw = ({
|
|
2893
|
+
amount,
|
|
2894
|
+
limitPriceRaw,
|
|
2895
|
+
side,
|
|
2896
|
+
sizeStepRaw
|
|
2897
|
+
}) => {
|
|
2898
|
+
const step = parseSizeStepRaw(sizeStepRaw);
|
|
2899
|
+
if (step <= BigInt(1)) {
|
|
2900
|
+
if (side === "sell") return toRaw6(amount);
|
|
2901
|
+
const spendRaw = BigInt(toRaw6(amount));
|
|
2902
|
+
const priceRaw = BigInt(limitPriceRaw);
|
|
2903
|
+
return ceilDiv(spendRaw * LIMIT_PRICE_RAW_SCALE, priceRaw).toString();
|
|
2904
|
+
}
|
|
2905
|
+
const rawSize = side === "sell" ? BigInt(toRaw6(amount)) : BigInt(toRaw6(amount)) * LIMIT_PRICE_RAW_SCALE / BigInt(limitPriceRaw);
|
|
2906
|
+
return (rawSize / step * step).toString();
|
|
2907
|
+
};
|
|
2908
|
+
var isLimitSizeBelowMinimum = (sizeRaw, minSizeRaw) => {
|
|
2909
|
+
const size = BigInt(sizeRaw);
|
|
2910
|
+
if (size <= BigInt(0)) return true;
|
|
2911
|
+
return !!minSizeRaw && /^\d+$/.test(minSizeRaw) && size < BigInt(minSizeRaw);
|
|
2912
|
+
};
|
|
2877
2913
|
|
|
2878
2914
|
// src/trading/place-order/index.place-order.execution-steps.ts
|
|
2879
2915
|
var COMPLETED_RAW_STATUSES = /* @__PURE__ */ new Set([
|
|
@@ -3924,32 +3960,21 @@ var resolvePlaceOrderPortalContainer = (triggerElement) => {
|
|
|
3924
3960
|
return (_a = triggerElement == null ? void 0 : triggerElement.closest(".agg-modal-center")) != null ? _a : void 0;
|
|
3925
3961
|
};
|
|
3926
3962
|
var LIMIT_EXPIRATION_OPTION_COUNT = 5;
|
|
3963
|
+
var LIMIT_SIZE_STEP_VENUES = /* @__PURE__ */ new Set([
|
|
3964
|
+
Venue5.tiprun,
|
|
3965
|
+
Venue5.hyperliquid,
|
|
3966
|
+
Venue5.pred,
|
|
3967
|
+
Venue5.polymarket
|
|
3968
|
+
]);
|
|
3927
3969
|
dayjs.extend(utc);
|
|
3928
3970
|
dayjs.extend(timezone);
|
|
3929
3971
|
var LIMIT_PRICE_STEP = 1e-3;
|
|
3930
3972
|
var LIMIT_PRICE_MIN = 1e-3;
|
|
3931
3973
|
var LIMIT_PRICE_MAX = 0.999;
|
|
3932
|
-
var ceilDiv = (numerator, denominator) => {
|
|
3933
|
-
return (numerator + denominator - BigInt(1)) / denominator;
|
|
3934
|
-
};
|
|
3935
|
-
var toRaw6 = (value) => {
|
|
3936
|
-
const normalizedValue = Number.isFinite(value) ? Math.max(0, value) : 0;
|
|
3937
|
-
return Math.ceil(normalizedValue * Number(LIMIT_ORDER_RAW_SCALE)).toString();
|
|
3938
|
-
};
|
|
3939
3974
|
var toLimitPriceRaw = (value) => {
|
|
3940
3975
|
const clampedValue = Math.min(LIMIT_PRICE_MAX, Math.max(LIMIT_PRICE_MIN, value));
|
|
3941
3976
|
return Math.round(clampedValue * Number(LIMIT_ORDER_RAW_SCALE)).toString();
|
|
3942
3977
|
};
|
|
3943
|
-
var toLimitSizeRaw = ({
|
|
3944
|
-
amount,
|
|
3945
|
-
limitPriceRaw,
|
|
3946
|
-
side
|
|
3947
|
-
}) => {
|
|
3948
|
-
if (side === "sell") return toRaw6(amount);
|
|
3949
|
-
const spendRaw = BigInt(toRaw6(amount));
|
|
3950
|
-
const priceRaw = BigInt(limitPriceRaw);
|
|
3951
|
-
return ceilDiv(spendRaw * LIMIT_ORDER_RAW_SCALE, priceRaw).toString();
|
|
3952
|
-
};
|
|
3953
3978
|
var formatLimitPriceLabel = (value) => {
|
|
3954
3979
|
return `${(value * 100).toLocaleString("en-US", {
|
|
3955
3980
|
minimumFractionDigits: 0,
|
|
@@ -3989,11 +4014,12 @@ var buildLimitOrderExecutionGroup = ({
|
|
|
3989
4014
|
var getLimitOrderToWinValue = ({
|
|
3990
4015
|
amount,
|
|
3991
4016
|
limitPriceRaw,
|
|
3992
|
-
side
|
|
4017
|
+
side,
|
|
4018
|
+
sizeStepRaw
|
|
3993
4019
|
}) => {
|
|
3994
4020
|
const priceRaw = BigInt(limitPriceRaw);
|
|
3995
4021
|
if (priceRaw <= BigInt(0) || priceRaw >= LIMIT_ORDER_RAW_SCALE) return 0;
|
|
3996
|
-
const sizeRaw = BigInt(toLimitSizeRaw({ amount, limitPriceRaw, side }));
|
|
4022
|
+
const sizeRaw = BigInt(toLimitSizeRaw({ amount, limitPriceRaw, side, sizeStepRaw }));
|
|
3997
4023
|
if (side === "buy") return Number(sizeRaw) / Number(LIMIT_ORDER_RAW_SCALE);
|
|
3998
4024
|
return Number(ceilDiv(priceRaw * sizeRaw, LIMIT_ORDER_RAW_SCALE)) / Number(LIMIT_ORDER_RAW_SCALE);
|
|
3999
4025
|
};
|
|
@@ -4945,7 +4971,8 @@ var PlaceOrder = ({
|
|
|
4945
4971
|
const limitVenueQuoteRequests = useMemo(
|
|
4946
4972
|
() => visibleLimitVenueOptions.map((option) => ({
|
|
4947
4973
|
venue: option.venue,
|
|
4948
|
-
venueMarketOutcomeId: option.venueMarketOutcomeId
|
|
4974
|
+
venueMarketOutcomeId: option.venueMarketOutcomeId,
|
|
4975
|
+
venueMarketId: option.venueMarketId
|
|
4949
4976
|
})),
|
|
4950
4977
|
[visibleLimitVenueOptions]
|
|
4951
4978
|
);
|
|
@@ -4977,10 +5004,83 @@ var PlaceOrder = ({
|
|
|
4977
5004
|
}
|
|
4978
5005
|
return venues;
|
|
4979
5006
|
}, [limitVenueQuotes.quotes]);
|
|
5007
|
+
const originalLimitPriceRaw = useMemo(() => toLimitPriceRaw(limitPrice), [limitPrice]);
|
|
5008
|
+
const limitPriceAdjustmentByVenue = useMemo(() => {
|
|
5009
|
+
var _a2;
|
|
5010
|
+
const adjustments = /* @__PURE__ */ new Map();
|
|
5011
|
+
for (const option of visibleLimitVenueOptions) {
|
|
5012
|
+
try {
|
|
5013
|
+
adjustments.set(
|
|
5014
|
+
option.venue,
|
|
5015
|
+
adjustLimitPriceRawToTick({
|
|
5016
|
+
limitPriceRaw: originalLimitPriceRaw,
|
|
5017
|
+
side: internalTab,
|
|
5018
|
+
tickSize: (_a2 = limitVenueQuoteByVenue.get(option.venue)) == null ? void 0 : _a2.tickSize
|
|
5019
|
+
})
|
|
5020
|
+
);
|
|
5021
|
+
} catch (e) {
|
|
5022
|
+
adjustments.set(
|
|
5023
|
+
option.venue,
|
|
5024
|
+
adjustLimitPriceRawToTick({
|
|
5025
|
+
limitPriceRaw: originalLimitPriceRaw,
|
|
5026
|
+
side: internalTab,
|
|
5027
|
+
tickSize: null
|
|
5028
|
+
})
|
|
5029
|
+
);
|
|
5030
|
+
}
|
|
5031
|
+
}
|
|
5032
|
+
return adjustments;
|
|
5033
|
+
}, [internalTab, limitVenueQuoteByVenue, originalLimitPriceRaw, visibleLimitVenueOptions]);
|
|
5034
|
+
const limitSizeRulesByVenue = useMemo(() => {
|
|
5035
|
+
var _a2, _b2;
|
|
5036
|
+
const rulesByVenue = /* @__PURE__ */ new Map();
|
|
5037
|
+
for (const quote of limitVenueQuotes.quotes) {
|
|
5038
|
+
if (!quote.sizeStepRaw && !quote.minSizeRaw) continue;
|
|
5039
|
+
rulesByVenue.set(quote.request.venue, {
|
|
5040
|
+
sizeStepRaw: (_a2 = quote.sizeStepRaw) != null ? _a2 : void 0,
|
|
5041
|
+
minSizeRaw: (_b2 = quote.minSizeRaw) != null ? _b2 : void 0
|
|
5042
|
+
});
|
|
5043
|
+
}
|
|
5044
|
+
return rulesByVenue;
|
|
5045
|
+
}, [limitVenueQuotes.quotes]);
|
|
5046
|
+
const belowMinimumLimitVenues = useMemo(() => {
|
|
5047
|
+
var _a2, _b2;
|
|
5048
|
+
const venues = /* @__PURE__ */ new Set();
|
|
5049
|
+
if (!isLimitOrder || internalAmount <= 0) return venues;
|
|
5050
|
+
for (const option of visibleLimitVenueOptions) {
|
|
5051
|
+
if (geoBlockedLimitVenues.has(option.venue) || getVenueAvailabilityState({
|
|
5052
|
+
venueId: option.venue,
|
|
5053
|
+
disabledVenues,
|
|
5054
|
+
isConfigLoading: isAppConfigLoading
|
|
5055
|
+
}) !== "available")
|
|
5056
|
+
continue;
|
|
5057
|
+
const rules = limitSizeRulesByVenue.get(option.venue);
|
|
5058
|
+
if (!(rules == null ? void 0 : rules.sizeStepRaw) && !(rules == null ? void 0 : rules.minSizeRaw)) continue;
|
|
5059
|
+
const sizeRaw = toLimitSizeRaw({
|
|
5060
|
+
amount: internalAmount,
|
|
5061
|
+
limitPriceRaw: (_b2 = (_a2 = limitPriceAdjustmentByVenue.get(option.venue)) == null ? void 0 : _a2.adjustedPriceRaw) != null ? _b2 : originalLimitPriceRaw,
|
|
5062
|
+
side: internalTab,
|
|
5063
|
+
sizeStepRaw: rules.sizeStepRaw
|
|
5064
|
+
});
|
|
5065
|
+
if (isLimitSizeBelowMinimum(sizeRaw, rules.minSizeRaw)) venues.add(option.venue);
|
|
5066
|
+
}
|
|
5067
|
+
return venues;
|
|
5068
|
+
}, [
|
|
5069
|
+
disabledVenues,
|
|
5070
|
+
geoBlockedLimitVenues,
|
|
5071
|
+
internalAmount,
|
|
5072
|
+
internalTab,
|
|
5073
|
+
isAppConfigLoading,
|
|
5074
|
+
isLimitOrder,
|
|
5075
|
+
limitPriceAdjustmentByVenue,
|
|
5076
|
+
limitSizeRulesByVenue,
|
|
5077
|
+
originalLimitPriceRaw,
|
|
5078
|
+
visibleLimitVenueOptions
|
|
5079
|
+
]);
|
|
4980
5080
|
const availableLimitVenueOptions = useMemo(() => {
|
|
4981
5081
|
return visibleLimitVenueOptions.filter((option) => {
|
|
4982
5082
|
var _a2;
|
|
4983
|
-
return !geoBlockedLimitVenues.has(option.venue) && // A limit SELL rests against shares held at that specific venue, so a
|
|
5083
|
+
return !geoBlockedLimitVenues.has(option.venue) && !belowMinimumLimitVenues.has(option.venue) && // A limit SELL rests against shares held at that specific venue, so a
|
|
4984
5084
|
// venue the user has no position on is a guaranteed 409 from the
|
|
4985
5085
|
// server's reservation check — and the automatic pick, which sorts on
|
|
4986
5086
|
// price alone, would happily choose one. Only narrow once we know
|
|
@@ -4992,6 +5092,7 @@ var PlaceOrder = ({
|
|
|
4992
5092
|
}) === "available";
|
|
4993
5093
|
});
|
|
4994
5094
|
}, [
|
|
5095
|
+
belowMinimumLimitVenues,
|
|
4995
5096
|
disabledVenues,
|
|
4996
5097
|
geoBlockedLimitVenues,
|
|
4997
5098
|
isAppConfigLoading,
|
|
@@ -5849,8 +5950,6 @@ var PlaceOrder = ({
|
|
|
5849
5950
|
const isSelectedVenueInventoryInsufficient = isSell && (selectedRouteCard == null ? void 0 : selectedRouteCard.kind) === "venue" && selectedRouteCard.insufficientInventory === true;
|
|
5850
5951
|
const isBelowClientMinimum = !isSell && hasEnteredAmount && internalAmount < MIN_BUY_ORDER_AMOUNT;
|
|
5851
5952
|
const isBelowVenueMinimumFromQuote = isQuoteBelowVenueMinimum(activeQuoteData);
|
|
5852
|
-
const isBelowMinimum = isBelowClientMinimum || isBelowVenueMinimumFromQuote;
|
|
5853
|
-
const belowMinimumMessage = isBelowClientMinimum ? tradingLabels.minimumOrderAmount(MIN_BUY_ORDER_AMOUNT) : tradingLabels.minOrderSizeViolated;
|
|
5854
5953
|
const quoteStatus = useMemo(() => {
|
|
5855
5954
|
if (!orderEligibility.canPlaceOrder) return void 0;
|
|
5856
5955
|
return resolvePlaceOrderQuoteStatus({
|
|
@@ -5977,33 +6076,6 @@ var PlaceOrder = ({
|
|
|
5977
6076
|
return averagePrice == null ? "" : tradingLabels.averagePrice(averagePrice);
|
|
5978
6077
|
}, [selectedRouteCard, tradingLabels]);
|
|
5979
6078
|
const displayedToWinValue = (_ea = selectedRouteCard == null ? void 0 : selectedRouteCard.numericValue) != null ? _ea : 0;
|
|
5980
|
-
const originalLimitPriceRaw = useMemo(() => toLimitPriceRaw(limitPrice), [limitPrice]);
|
|
5981
|
-
const limitPriceAdjustmentByVenue = useMemo(() => {
|
|
5982
|
-
var _a2;
|
|
5983
|
-
const adjustments = /* @__PURE__ */ new Map();
|
|
5984
|
-
for (const option of visibleLimitVenueOptions) {
|
|
5985
|
-
try {
|
|
5986
|
-
adjustments.set(
|
|
5987
|
-
option.venue,
|
|
5988
|
-
adjustLimitPriceRawToTick({
|
|
5989
|
-
limitPriceRaw: originalLimitPriceRaw,
|
|
5990
|
-
side: internalTab,
|
|
5991
|
-
tickSize: (_a2 = limitVenueQuoteByVenue.get(option.venue)) == null ? void 0 : _a2.tickSize
|
|
5992
|
-
})
|
|
5993
|
-
);
|
|
5994
|
-
} catch (e) {
|
|
5995
|
-
adjustments.set(
|
|
5996
|
-
option.venue,
|
|
5997
|
-
adjustLimitPriceRawToTick({
|
|
5998
|
-
limitPriceRaw: originalLimitPriceRaw,
|
|
5999
|
-
side: internalTab,
|
|
6000
|
-
tickSize: null
|
|
6001
|
-
})
|
|
6002
|
-
);
|
|
6003
|
-
}
|
|
6004
|
-
}
|
|
6005
|
-
return adjustments;
|
|
6006
|
-
}, [internalTab, limitVenueQuoteByVenue, originalLimitPriceRaw, visibleLimitVenueOptions]);
|
|
6007
6079
|
const selectedLimitPriceAdjustment = selectedLimitVenueOption ? limitPriceAdjustmentByVenue.get(selectedLimitVenueOption.venue) : void 0;
|
|
6008
6080
|
const selectedLimitPriceRaw = (_fa = selectedLimitPriceAdjustment == null ? void 0 : selectedLimitPriceAdjustment.adjustedPriceRaw) != null ? _fa : originalLimitPriceRaw;
|
|
6009
6081
|
const limitPriceAdjustmentMessage = useMemo(() => {
|
|
@@ -6024,6 +6096,8 @@ var PlaceOrder = ({
|
|
|
6024
6096
|
selectedLimitVenueOption,
|
|
6025
6097
|
tradingLabels
|
|
6026
6098
|
]);
|
|
6099
|
+
const selectedLimitSizeRules = selectedLimitVenueOption ? limitSizeRulesByVenue.get(selectedLimitVenueOption.venue) : void 0;
|
|
6100
|
+
const isLimitSizeRulesPending = isLimitOrder && selectedLimitVenueOption != null && LIMIT_SIZE_STEP_VENUES.has(selectedLimitVenueOption.venue) && limitVenueQuotes.isMetadataPending;
|
|
6027
6101
|
const limitOrderPayload = useMemo(() => {
|
|
6028
6102
|
if (!selectedLimitVenueOption || internalAmount <= 0) return null;
|
|
6029
6103
|
if (limitPriceInputError) return null;
|
|
@@ -6039,7 +6113,8 @@ var PlaceOrder = ({
|
|
|
6039
6113
|
const sizeRaw = toLimitSizeRaw({
|
|
6040
6114
|
amount: internalAmount,
|
|
6041
6115
|
limitPriceRaw,
|
|
6042
|
-
side: internalTab
|
|
6116
|
+
side: internalTab,
|
|
6117
|
+
sizeStepRaw: selectedLimitSizeRules == null ? void 0 : selectedLimitSizeRules.sizeStepRaw
|
|
6043
6118
|
});
|
|
6044
6119
|
const expiresAt = expirationDate ? serializeLimitOrderExpiration(expirationDate) : void 0;
|
|
6045
6120
|
return __spreadValues({
|
|
@@ -6058,8 +6133,12 @@ var PlaceOrder = ({
|
|
|
6058
6133
|
limitExpirationType,
|
|
6059
6134
|
limitPriceInputError,
|
|
6060
6135
|
selectedLimitVenueOption,
|
|
6061
|
-
selectedLimitPriceRaw
|
|
6136
|
+
selectedLimitPriceRaw,
|
|
6137
|
+
selectedLimitSizeRules == null ? void 0 : selectedLimitSizeRules.sizeStepRaw
|
|
6062
6138
|
]);
|
|
6139
|
+
const isLimitSizeBelowVenueMinimum = isLimitOrder && (limitOrderPayload != null && isLimitSizeBelowMinimum(limitOrderPayload.sizeRaw, selectedLimitSizeRules == null ? void 0 : selectedLimitSizeRules.minSizeRaw) || selectedLimitVenueOption == null && belowMinimumLimitVenues.size > 0);
|
|
6140
|
+
const isBelowMinimum = isBelowClientMinimum || isBelowVenueMinimumFromQuote || isLimitSizeBelowVenueMinimum;
|
|
6141
|
+
const belowMinimumMessage = isBelowClientMinimum ? tradingLabels.minimumOrderAmount(MIN_BUY_ORDER_AMOUNT) : isSell ? tradingLabels.venueMinOrderSize : tradingLabels.minOrderSizeViolated;
|
|
6063
6142
|
const resolvedLimitExpirationDraftDate = useMemo(() => {
|
|
6064
6143
|
return resolveLimitExpirationDate({
|
|
6065
6144
|
expirationType: "CUSTOM",
|
|
@@ -6103,12 +6182,13 @@ var PlaceOrder = ({
|
|
|
6103
6182
|
}, [internalTab, limitOrderPayload]);
|
|
6104
6183
|
const limitRouteCards = useMemo(() => {
|
|
6105
6184
|
return visibleLimitVenueOptions.map((option) => {
|
|
6106
|
-
var _a2, _b2, _c2, _d2;
|
|
6185
|
+
var _a2, _b2, _c2, _d2, _e2;
|
|
6107
6186
|
const effectiveLimitPriceRaw = (_b2 = (_a2 = limitPriceAdjustmentByVenue.get(option.venue)) == null ? void 0 : _a2.adjustedPriceRaw) != null ? _b2 : originalLimitPriceRaw;
|
|
6108
6187
|
const venueToWinValue = getLimitOrderToWinValue({
|
|
6109
6188
|
amount: internalAmount,
|
|
6110
6189
|
limitPriceRaw: effectiveLimitPriceRaw,
|
|
6111
|
-
side: internalTab
|
|
6190
|
+
side: internalTab,
|
|
6191
|
+
sizeStepRaw: (_c2 = limitSizeRulesByVenue.get(option.venue)) == null ? void 0 : _c2.sizeStepRaw
|
|
6112
6192
|
});
|
|
6113
6193
|
const availabilityState = getVenueAvailabilityState({
|
|
6114
6194
|
venueId: option.venue,
|
|
@@ -6116,10 +6196,10 @@ var PlaceOrder = ({
|
|
|
6116
6196
|
isConfigLoading: isAppConfigLoading
|
|
6117
6197
|
});
|
|
6118
6198
|
const isGeoBlocked = geoBlockedLimitVenues.has(option.venue);
|
|
6119
|
-
const isUnavailable = isTradingBlocked || isGeoBlocked || availabilityState !== "available";
|
|
6199
|
+
const isUnavailable = isTradingBlocked || isGeoBlocked || belowMinimumLimitVenues.has(option.venue) || availabilityState !== "available";
|
|
6120
6200
|
const currentPriceLabel = option.currentPrice == null ? "\u2014" : formatProbabilityCents(option.currentPrice, formatPrice);
|
|
6121
6201
|
const totalFees = getSmartRouteTotalFees(
|
|
6122
|
-
(
|
|
6202
|
+
(_e2 = (_d2 = limitVenueQuoteByVenue.get(option.venue)) == null ? void 0 : _d2.data) == null ? void 0 : _e2.feeBreakdown
|
|
6123
6203
|
);
|
|
6124
6204
|
const feeLabel = totalFees == null ? void 0 : formatUsd(totalFees, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
6125
6205
|
return {
|
|
@@ -6138,6 +6218,7 @@ var PlaceOrder = ({
|
|
|
6138
6218
|
};
|
|
6139
6219
|
});
|
|
6140
6220
|
}, [
|
|
6221
|
+
belowMinimumLimitVenues,
|
|
6141
6222
|
disabledVenues,
|
|
6142
6223
|
formatPrice,
|
|
6143
6224
|
geoBlockedLimitVenues,
|
|
@@ -6146,6 +6227,7 @@ var PlaceOrder = ({
|
|
|
6146
6227
|
isAppConfigLoading,
|
|
6147
6228
|
isTradingBlocked,
|
|
6148
6229
|
limitPriceAdjustmentByVenue,
|
|
6230
|
+
limitSizeRulesByVenue,
|
|
6149
6231
|
limitVenueQuoteByVenue,
|
|
6150
6232
|
originalLimitPriceRaw,
|
|
6151
6233
|
tradingLabels,
|
|
@@ -6244,10 +6326,10 @@ var PlaceOrder = ({
|
|
|
6244
6326
|
const fills = (_b2 = (_a2 = selectedRouteCard.quoteData) == null ? void 0 : _a2.fills) != null ? _b2 : [];
|
|
6245
6327
|
return fills.length > 0 && fills.every((f) => geoBlockedVenuesFromWarnings.has(f.venue));
|
|
6246
6328
|
}, [selectedRouteCard, geoBlockedVenuesFromWarnings]);
|
|
6247
|
-
const shouldShowGeoBlockBanner = isTradingBlocked || selectedRouteGeoBlocked || isPrimaryVenueGeoBlocked || isLimitOrder && limitRouteCards.length > 0 && limitRouteCards.every((card) => card.isUnavailable);
|
|
6329
|
+
const shouldShowGeoBlockBanner = isTradingBlocked || selectedRouteGeoBlocked || isPrimaryVenueGeoBlocked || isLimitOrder && limitRouteCards.length > 0 && limitRouteCards.every((card) => card.isUnavailable) && limitRouteCards.some((card) => !card.venue || !belowMinimumLimitVenues.has(card.venue));
|
|
6248
6330
|
const actionLabel = `${internalTab === "buy" ? tradingLabels.buy : tradingLabels.sell} ${selectedOutcomeLabel}`.trim();
|
|
6249
|
-
const isActionDisabled = isPrimaryActionDisabled || !orderEligibility.canPlaceOrder || isActionLoading || !hasEnteredAmount || !scopedSelectedMarket || isInsufficientBalance || isBetdexBalanceUnavailable && !canExecuteBetdexQuote || isQuoteInsufficientBalance && !canExecuteBetdexQuote || isSell && isQuoteInputEditing || isSellAmountAboveAvailability || isBelowMinimum || !isLimitOrder && isQuoteLoading || isSelectedVenueInventoryInsufficient || (isLimitOrder ? !limitOrderPayload : !selectedRouteCard || !selectedRouteCard.quoteData.quoteId && !canExecuteBetdexQuote) || selectedRouteGeoBlocked || !isAuthenticated || !isLimitOrder && quoteStatus !== void 0 && !canExecuteBetdexQuote;
|
|
6250
|
-
const shouldShowSmartRouting = orderEligibility.canPlaceOrder && hasEnteredAmount && !
|
|
6331
|
+
const isActionDisabled = isPrimaryActionDisabled || !orderEligibility.canPlaceOrder || isActionLoading || !hasEnteredAmount || !scopedSelectedMarket || isInsufficientBalance || isBetdexBalanceUnavailable && !canExecuteBetdexQuote || isQuoteInsufficientBalance && !canExecuteBetdexQuote || isSell && isQuoteInputEditing || isSellAmountAboveAvailability || isBelowMinimum || isLimitSizeRulesPending || !isLimitOrder && isQuoteLoading || isSelectedVenueInventoryInsufficient || (isLimitOrder ? !limitOrderPayload : !selectedRouteCard || !selectedRouteCard.quoteData.quoteId && !canExecuteBetdexQuote) || selectedRouteGeoBlocked || !isAuthenticated || !isLimitOrder && quoteStatus !== void 0 && !canExecuteBetdexQuote;
|
|
6332
|
+
const shouldShowSmartRouting = orderEligibility.canPlaceOrder && hasEnteredAmount && !isBelowClientMinimum && !isBelowVenueMinimumFromQuote && (isLimitOrder ? limitRouteCards.length > 0 : displayedRouteCards.length > 0 || smartRoute.isFetching || smartRoute.isLoading || isSell && (venueSellQuotes.isFetching || venueSellQuotes.isLoading));
|
|
6251
6333
|
const shouldShowRouteToggle = !isLimitOrder && !isQuoteLoading && displayedRouteCards.length > PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT;
|
|
6252
6334
|
const handleReturnToOrderForm = useCallback3(() => {
|
|
6253
6335
|
const submittedSelection = submittedSelectionRef.current;
|
|
@@ -21,13 +21,13 @@ import {
|
|
|
21
21
|
parseRawMicroValue,
|
|
22
22
|
selectOpenLimitOrders,
|
|
23
23
|
useOpenOrderCancellation
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-4X7OLBO6.mjs";
|
|
25
25
|
import {
|
|
26
26
|
DEPOSIT_MODAL_OPEN_EVENT,
|
|
27
27
|
WITHDRAW_MODAL_OPEN_EVENT,
|
|
28
28
|
formatChainIdLabel,
|
|
29
29
|
useClaimWinnings
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-KN7JN7F5.mjs";
|
|
31
31
|
import {
|
|
32
32
|
AggErrorBoundary,
|
|
33
33
|
Button,
|
|
@@ -266,7 +266,7 @@ var useHomePageModals = () => {
|
|
|
266
266
|
// src/pages/home/index.tsx
|
|
267
267
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
268
268
|
var DeferredEventMarketPage = lazy(
|
|
269
|
-
() => import("./event-market-
|
|
269
|
+
() => import("./event-market-Q2LBJJ5E.mjs").then((module) => ({ default: module.EventMarketPage }))
|
|
270
270
|
);
|
|
271
271
|
var MIN_SEARCH_LENGTH = 3;
|
|
272
272
|
var SEARCH_DEBOUNCE_MS = 300;
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
EventOpenOrdersCard,
|
|
7
7
|
formatRecurringCountdown,
|
|
8
8
|
useEventOpenOrders
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4X7OLBO6.mjs";
|
|
10
10
|
import "./chunk-YYGS6S7N.mjs";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-KN7JN7F5.mjs";
|
|
12
12
|
import "./chunk-WOCZ4TVT.mjs";
|
|
13
13
|
import "./chunk-7ORC3TUJ.mjs";
|
|
14
14
|
import "./chunk-XZVGHKMW.mjs";
|