> For the complete documentation index, see [llms.txt](https://docs.ston.fi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ston.fi/developer-section/dex/sdk/legacy/v0.4/getters.md).

# Using Get Methods

Example of usage of various get methods of the SDK.

```typescript
import TonWeb from 'tonweb';

import { Router, ROUTER_REVISION, ROUTER_REVISION_ADDRESS } from '@ston-fi/sdk';

(async () => {
  const OWNER_ADDRESS = '';

  const JETTON0 = 'EQDQoc5M3Bh8eWFephi9bClhevelbZZvWhkqdo80XuY_0qXv';
  const JETTON1 = 'EQC_1YoM8RBixN95lz7odcF3Vrkc_N8Ne7gQi7Abtlet_Efi';

  const provider = new TonWeb.HttpProvider();

  const router = new Router(provider, {
    revision: ROUTER_REVISION.V1,
    address: ROUTER_REVISION_ADDRESS.V1,
  });

  const routerData = await router.getData();

  const {
    isLocked,
    adminAddress,
    tempUpgrade,
    poolCode,
    jettonLpWalletCode,
    lpAccountCode,
  } = routerData;

  const pool = await router.getPool({ jettonAddresses: [JETTON0, JETTON1] });

  if (!pool) {
    throw Error(`Pool for ${JETTON0}/${JETTON1} not found`);
  }

  const poolAddress = await pool.getAddress();

  const poolData = await pool.getData();
  const {
    reserve0,
    reserve1,
    token0WalletAddress,
    token1WalletAddress,
    lpFee,
    protocolFee,
    refFee,
    protocolFeeAddress,
    collectedToken0ProtocolFee,
    collectedToken1ProtocolFee,
  } = poolData;

  const expectedLiquidityData = await pool.getExpectedLiquidity({
    jettonAmount: new TonWeb.utils.BN(500000000),
  });

  const { amount0, amount1 } = expectedLiquidityData;

  const expectedLpTokensAmount = await pool.getExpectedTokens({
    amount0: new TonWeb.utils.BN(500000000),
    amount1: new TonWeb.utils.BN(200000000),
  });

  if (token0WalletAddress) {
    const expectedOutputsData = await pool.getExpectedOutputs({
      amount: new TonWeb.utils.BN(500000000),
      jettonWallet: token0WalletAddress,
    });

    const { jettonToReceive, protocolFeePaid, refFeePaid } =
      expectedOutputsData;
  }

  const lpAccountAddress = await pool.getLpAccountAddress({
    ownerAddress: OWNER_ADDRESS,
  });

  const lpAccount = await pool.getLpAccount({ ownerAddress: OWNER_ADDRESS });

  if (lpAccount) {
    const lpAccountData = await lpAccount.getData();
    const { userAddress, poolAddress, amount0, amount1 } = lpAccountData;
  }
})();

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.ston.fi/developer-section/dex/sdk/legacy/v0.4/getters.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.
