Skip to content

Commit

Permalink
Merge branch 'npai/align' of https://github.com/across-protocol/frontend
Browse files Browse the repository at this point in the history
 into npai/align
  • Loading branch information
nicholaspai committed Sep 7, 2024
2 parents 97876c2 + 5ec3c77 commit 4d466ca
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions api/limits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,11 @@ const handler = async (
const {
REACT_APP_FULL_RELAYERS, // These are relayers running a full auto-rebalancing strategy.
REACT_APP_TRANSFER_RESTRICTED_RELAYERS, // These are relayers whose funds stay put.
REACT_APP_MIN_DEPOSIT_USD,
MIN_DEPOSIT_USD, // The global minimum deposit in USD for all destination chains. The minimum deposit
// returned by the relayerFeeDetails() call will be floor'd with this value (after converting to token units).
} = process.env;
const provider = getProvider(HUB_POOL_CHAIN_ID);

const minDeposits = REACT_APP_MIN_DEPOSIT_USD
? JSON.parse(REACT_APP_MIN_DEPOSIT_USD)
: {};

const fullRelayers = !REACT_APP_FULL_RELAYERS
? []
: (JSON.parse(REACT_APP_FULL_RELAYERS) as string[]).map((relayer) => {
Expand Down Expand Up @@ -116,6 +113,12 @@ const handler = async (
const amount = BigNumber.from(
amountInput ?? ethers.BigNumber.from("10").pow(l1Token.decimals)
);
let minDepositUsdForDestinationChainId = Number(
process.env[`MIN_DEPOSIT_USD_${destinationChainId}`] ?? MIN_DEPOSIT_USD
);
if (isNaN(minDepositUsdForDestinationChainId)) {
minDepositUsdForDestinationChainId = 0;
}

const hubPool = getHubPool(provider);
const configStoreClient = new sdk.contracts.acrossConfigStore.Client(
Expand Down Expand Up @@ -227,7 +230,7 @@ const handler = async (
? ethers.BigNumber.from(0)
: ethers.utils
.parseUnits(
(minDeposits[destinationChainId] ?? 0).toString(),
minDepositUsdForDestinationChainId.toString(),
l1Token.decimals
)
.mul(ethers.utils.parseUnits("1"))
Expand Down

0 comments on commit 4d466ca

Please sign in to comment.