# How to add liquidity?

{% hint style="info" %}
Before adding liquidity make sure to open a liquidity token account related to the pool code
{% endhint %}

{% tabs %}
{% tab title="@a-dex/a-dex-sdk" %}

```typescript
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"))
);

```

{% endtab %}

{% tab title="cleos" %}

```bash
cleos -u https://eos.greymass.com push transaction '{
  "delay_sec": 0,
  "max_cpu_usage_ms": 0,
  "actions": [
    {
      "account": "eosio.token",
      "name": "transfer",
      "data": {
        "from": "trader.adex",
        "to": "swap.adex",
        "quantity": "1.0000 EOS",
        "memo": "deposit:1"
      },
      "authorization": [
        {
          "actor": "trader.adex",
          "permission": "active"
        }
      ]
    },
    {
      "account": "tethertether",
      "name": "transfer",
      "data": {
        "from": "trader.adex",
        "to": "swap.adex",
        "quantity": "4.0000 USDT",
        "memo": "deposit:1"
      },
      "authorization": [
        {
          "actor": "trader.adex",
          "permission": "active"
        }
      ]
    }
  ]
}'
```

{% endtab %}

{% tab title="eosjs" %}

```javascript
const result = await api.transact({
    actions: [
    {
      account: 'eosio.token',
      name: 'transfer',
      authorization: [{
        actor: 'trader.adex',
        permission: 'active',
      }],
      data: {
        from: 'trader.adex',
        to: 'swap.adex',
        quantity: '1.0000 EOS',
        memo: 'deposit:1'
      },
    },
    {
      account: 'tethertether',
      name: 'transfer',
      authorization: [{
        actor: 'trader.adex',
        permission: 'active',
      }],
      data: {
        from: 'trader.adex',
        to: 'swap.adex',
        quantity: '4.0000 USDT',
        memo: 'deposit:1'
      }
    }]
  }, {
    blocksBehind: 3,
    expireSeconds: 30,
  });
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.a-dex.io/developers/smart-contracts/swap/examples/how-to-add-liquidity.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
