-
Notifications
You must be signed in to change notification settings - Fork 184
Open
Description
Hi guys, here is the example you provided in the Zora docs. I wonder if you support multi-hop swap, e.g., for A->B->C, and I just need to set the param sell A, buy C, you automatically do the routing.
import { TradeParameters, tradeCoin } from "@zoralabs/coins-sdk";
const tradeParameters: TradeParameters = {
sell: {
type: "erc20",
address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", // USDC
},
buy: {
type: "erc20",
address: "0x9b13358e3a023507e7046c18f508a958cda75f54", // @jacob Creator Coin
},
amountIn: BigInt(4 * 10 ** 6), // 4 USDC (6 decimals)
slippage: 0.04, // 4% slippage
sender: account.address,
};
const receipt = await tradeCoin({
tradeParameters,
walletClient,
account,
publicClient,
});
I used to encode the call data for such needs by Uniswap SDK. For example, I want to use weth to buy a creater coin, but the coin only has a USDC pair, so actually the path is weth-usdc-creator coin, but I can't encode it because the usdc-creator pool has hooks and needs a specific encoding which can only be handled by your SDK.
Metadata
Metadata
Assignees
Labels
No labels