# How to remove liquidity?

{% hint style="info" %}
Both tokens accounts should be opened
{% endhint %}

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

```typescript
import { SwapActionGenerator } from "@a-dex/a-dex-sdk";

const actionsGen = new SwapActionGenerator("swap.adex");

const action = await actionsGen.withdraw(
  [
    {
      actor: "trader.adex",
      permission: "active",
    },
  ],
  "trader.adex",
  "1000 LPA"
);

```

{% endtab %}

{% tab title="cleos" %}

```bash
cleos -u https://eos.greymass.com push transaction '{
  "delay_sec": 0,
  "max_cpu_usage_ms": 0,
  "actions": [
    {
      "account": "swap.adex",
      "name": "withdraw",
      "data": {
        "owner": "trader.adex",
        "quantity": "1000 LPA"
      },
      "authorization": [
        {
          "actor": "trader.adex",
          "permission": "active"
        }
      ]
    }
  ]
}'
```

{% endtab %}

{% tab title="eosjs" %}

```javascript
const result = await api.transact({
  actions: [{
    account: 'swap.adex',
    name: 'withdraw',
    authorization: [{
      actor: 'trader.adex',
      permission: 'active',
    }],
    data: {
      owner: 'trader.adex',
      lq_tokens: '1000 LQA'
    },
  }]
}, {
  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-remove-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.
