Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable lifi cross-account trades #5835

Merged
merged 2 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ export async function getTradeQuote(
toChainId: Number(fromChainId(buyAsset.chainId).chainReference),
fromTokenAddress: getLifiEvmAssetAddress(sellAsset),
toTokenAddress: getLifiEvmAssetAddress(buyAsset),
// HACK: use the receive address as the send address
// lifi's exchanges may use this to check allowance on their side
// this swapper is not cross-account so this works
fromAddress: sendAddress,
toAddress: receiveAddress,
gomesalexandre marked this conversation as resolved.
Show resolved Hide resolved
fromAmount: sellAmountIncludingProtocolFeesCryptoBaseUnit,
Expand Down
5 changes: 1 addition & 4 deletions src/state/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@ import { assertUnreachable } from '../lib/utils'
export const isCrossAccountTradeSupported = (swapperName: SwapperName) => {
switch (swapperName) {
case SwapperName.Thorchain:
case SwapperName.LIFI:
case SwapperName.OneInch:
return true
// NOTE: Before enabling cross-account for LIFI and OneInch - we must pass the sending address
// to the swappers up so allowance checks work. They're currently using the receive address
// assuming it's the same address as the sending address.
gomesalexandre marked this conversation as resolved.
Show resolved Hide resolved
case SwapperName.LIFI:
case SwapperName.Zrx:
case SwapperName.CowSwap:
case SwapperName.Test:
Expand Down