> For the complete documentation index, see [llms.txt](https://docs.notional.finance/v3-technical-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.notional.finance/v3-technical-docs/contract-interaction-guides/accounts.md).

# Accounts

To get a list of Notional users, one can use this [subgraph query](/v3-technical-docs/subgraph-guides/notional-v3-subgraphs/fetch-notional-accounts.md) or use this [Dune query](https://dune.com/queries/2759293). &#x20;

## Get an account's balances

```
account = notional.getAccount(accountAddress)
```

## Fetch an account's positions in readable format

The following function can be used to make an account's balances more readable. This is especially useful when comparing an account's state before and after trading.

<pre><code>from datetime import datetime
<strong>
</strong><strong># CurrencyId to Symbol Mapping
</strong>CURRENCY_ID_TO_SYMBOL = {
    1: "ETH",
    2: "DAI",
    3: "USDC",
    4: "WBTC",
    5: "wstETH",
    6: "FRAX",
    7: "rETH",
    8: "USDT",
}

# This function can be used to make an account's positions readable.
def getAccountPositions(address):
        account = notional.getAccount(address)
        dict = {}
        dict['Account Address'] = address
        dict['Free collateral (ETH)'] = notional.getFreeCollateral(address)[0] / 1e8

        for i in account[1]:
            if i[0] != 0:
                symbol = CURRENCY_ID_TO_SYMBOL[i[0]]
                dict[symbol] = {
                    'p{} Balance'.format(symbol): i[1]/1e8,
                    'n{} Balance'.format(symbol): i[2]/1e8} 

        for j in account[2]:
            symbol = CURRENCY_ID_TO_SYMBOL[j[0]]
            if j[2] == 1:
                dict[symbol].update({'f{} {} {}'.format(symbol, j[1], datetime.fromtimestamp(j[1]).date()): j[3] / 1e8})
        return dict
</code></pre>

## Get an account's free collateral

If a user's free collateral is negative, then the user is eligible to get liquidated. If the user's free collateral figure is positive the account is sufficiently collateralized.

```
notional.getFreeCollateral(accountAddress)
```

## Get an account's Leveraged Vaults positions

Users can use the `getVaultAccount` methord to fetch an account's leveraged vault positions: &#x20;

<pre><code><strong>leveragedVaultAccount = notional.getVaultAccount(accountAddress, vaultAdderes)
</strong>accountVaultShares = leveragedVaultAccount["vaultShares"]/1e8
accountDebtInUnderlying = leveragedVaultAccount["accountDebtUnderlying"]/1e8
</code></pre>


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.notional.finance/v3-technical-docs/contract-interaction-guides/accounts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
