How to add liquidity?

Before adding liquidity make sure to open a liquidity token account related to the pool code

import {
  SwapActionGenerator,
  SwapTransactionGenerator,
} from "@a-dex/a-dex-sdk";
import { ExtendedAsset, Name, Sym, Asset, ExtendedSymbol } from "eos-common";

const actionsGen = new SwapActionGenerator("swap.adex");
const trxGen = new SwapTransactionGenerator(
  [
    {
      actor: "trader.adex",
      permission: "active",
    },
  ],
  actionsGen
);

const trx = await trxGen.addLiquidity(
  new Name("trader.adex"),
  new Sym("LPA", 0),
  0,
  new ExtendedAsset(new Asset("1.0000 EOS"), new Name("eosio.token")),
  new ExtendedAsset(new Asset("4.0000 USDT"), new Name("tethertether"))
);

Last updated