---
# System prepended metadata

title: Untitled

---

```javascript=
      const gasPrices = await fetchRes(
        getZapperApi("/gas-price", {
          sellTokenAddress,
          address,
        }),
      );

      const gasPrice = BigNumber.from(gasPrices.fast.toFixed(0))
        .mul(10 ** 9)
        .toString();

      if (!isSellTokenEth) {
        const approvalState = await fetchRes(
          getZapperApi("/zap-in/pickle/approval-state", {
            sellTokenAddress,
            ownerAddress: address,
          }),
        );
        if (!approvalState.isApproved) {
          const { from, to, data } = await fetchRes(
            getZapperApi("/zap-in/pickle/approval-transaction", {
              gasPrice,
              sellTokenAddress,
              ownerAddress: address,
            }),
          );
          const approveTx = await signer.sendTransaction({ from, to, data });
          await approveTx.wait();
        }
      }
      const { from, to, data, value } = await fetchRes(
        getZapperApi("/zap-in/pickle/transaction", {
          slippagePercentage,
          gasPrice,
          poolAddress,
          sellTokenAddress,
          sellAmount,
          ownerAddress: address,
        }),
      );
      const zapTx = await signer.sendTransaction({ from, to, data, value });
```