Skip to content

Commit d26576e

Browse files
committed
Fixes
1 parent 4493018 commit d26576e

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

api/_bridges/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ export const bridgeStrategies: BridgeStrategiesConfig = {
2323
// TODO: Add CCTP routes when ready
2424
};
2525

26-
export const availableBridgeStrategies = [
26+
export const routableBridgeStrategies = [
2727
getAcrossBridgeStrategy(),
28-
getHyperCoreBridgeStrategy(),
29-
getCctpBridgeStrategy(),
28+
// TODO: Add CCTP bridge strategy when ready
3029
];
3130

3231
export async function getBridgeStrategy({
@@ -44,7 +43,7 @@ export async function getBridgeStrategy({
4443
if (fromToChainOverride) {
4544
return fromToChainOverride;
4645
}
47-
const supportedBridgeStrategies = availableBridgeStrategies.filter(
46+
const supportedBridgeStrategies = routableBridgeStrategies.filter(
4847
(strategy) => strategy.isRouteSupported({ inputToken, outputToken })
4948
);
5049
if (supportedBridgeStrategies.length === 1) {

api/_bridges/utils.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,27 @@ export function isFullyUtilized(limits: LimitsResponse): boolean {
3131
}
3232

3333
/**
34-
* Fetches bridge limits and utilization data in parallel to determine strategy requirements
34+
* Fetches bridge limits and utilization data to determine routing strategy requirements.
35+
* Analyzes various factors including utilization rates, deposit amounts, token types,
36+
* and chain-specific eligibility to determine the optimal bridge strategy.
37+
*
38+
* @param params - The bridge strategy data parameters
39+
* @param params.inputToken - The input token for the bridge transaction
40+
* @param params.outputToken - The output token for the bridge transaction
41+
* @param params.amount - The amount to bridge (in wei)
42+
* @param params.amountType - The type of amount (exactInput, exactOutput, minOutput)
43+
* @param params.recipient - The recipient address (optional)
44+
* @param params.depositor - The depositor address
45+
* @param params.logger - Optional logger instance for error reporting
46+
* @returns Promise resolving to bridge strategy data or undefined if fetch fails
47+
* @returns Returns object containing strategy flags:
48+
* - canFillInstantly: Whether the bridge can fill the deposit instantly
49+
* - isUtilizationHigh: Whether bridge utilization is above 80% threshold
50+
* - isUsdcToUsdc: Whether both input and output tokens are USDC
51+
* - isLargeDeposit: Whether deposit amount exceeds 1M USD threshold
52+
* - isInThreshold: Whether deposit is within 10K USD Across threshold
53+
* - isFastCctpEligible: Whether eligible for Fast CCTP on supported chains
54+
* - isLineaSource: Whether the source chain is Linea
3555
*/
3656
export async function getBridgeStrategyData({
3757
inputToken,

0 commit comments

Comments
 (0)