# Getting Started

<figure><img src="https://355116152-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyvjIeznprQQJj7d3yYKh%2Fuploads%2FQUCk8C8uyvHPrdd3jU6W%2FWarehouse%20Getting%20Started.webp?alt=media&#x26;token=93933dbe-bcfd-4914-9abb-06a6bed3ae43" alt=""><figcaption></figcaption></figure>

{% embed url="<https://warehouse.xfi.ms>" %}

You can create QUERIES (1), create DASHBOARDS (2) combining queries and visualizations built for them, TAG (3) them, and PUBLISH (4) for  public usage. Queries should be published in order to be available for dashboards and public. Dashboards should be published in order to be available from outside. Let’s take a look for a “XFI Pools Activity” (5) dashboard for example.

<figure><img src="https://355116152-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyvjIeznprQQJj7d3yYKh%2Fuploads%2FQ5Boaf8l3aL7FzMr0De2%2Fwarehouse_gettingStarted_slide_1.png?alt=media&#x26;token=003ebbbe-f87e-446e-ae02-b5e30135510a" alt=""><figcaption></figcaption></figure>

{% embed url="<https://warehouse.xfi.ms/dashboards?order=-created_at&page=1&page_size=20>" fullWidth="false" %}

Here we have a set of QUERY DASHBOARDS (1), global params for dashboards (2),  and REFRESH rate (3). In order to go down to the QUERY (4), select it from DROPDOWN (5).

<figure><img src="https://355116152-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyvjIeznprQQJj7d3yYKh%2Fuploads%2FxGAzZaABGhzNgS41FFAv%2Fwarehouse_gettingStarted_slide_2.png?alt=media&#x26;token=32af1c06-f945-45c1-baa7-c53199d26f87" alt=""><figcaption></figcaption></figure>

{% embed url="<https://warehouse.xfi.ms/dashboards/xfi_pools_activity?p_dates=d_last_month&p_limit=100&p_network=xfi_test>" %}

On a query page there is a SQL QUERY (1) with PARAMS (2). On a left you can find a LIST OF TABLES (3) for a network, and select REQUIRED TABLE (4). Query result is found in a TABLE (5). Next, take a look at VISUALIZATION (6).

<figure><img src="https://355116152-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyvjIeznprQQJj7d3yYKh%2Fuploads%2FNX1LIlw8yLGt5gO8w1WA%2Fwarehouse_gettingStarted_slide_3.png?alt=media&#x26;token=25cd5eed-f4e0-49df-a210-a4bf90cdf3bb" alt=""><figcaption></figcaption></figure>

```sql
WITH
    toUnixTimestamp(toString('{{dates.start}}')) AS dateStart,
    toUnixTimestamp(toString('{{dates.end}}')) AS dateEnd
SELECT 
    pool_address,
    wallet_address,
    DATE(block_timestamp) as timestamp,
    CAST(token_addresses[1] as CHAR) as tokenFrom,
    CAST(token_addresses[2] as CHAR) as tokenTo,
    amounts[1] as tokenFromAmount,
    amounts[2] as tokenToAmount,
    transaction_type
FROM xfi_test.dex_trades
```

{% embed url="<https://warehouse.xfi.ms/queries/85/source?p_dates=d_last_month#130>" %}

Go down the VISUALIZATION CONFIG (1, 2), select CHART (3) type and choose required AXIS AND PARAMS (4). There’s a variety of dashboards you can build (5).

<figure><img src="https://355116152-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyvjIeznprQQJj7d3yYKh%2Fuploads%2FTKEwZwHxQSyjko4NjKhz%2Fwarehouse_gettingStarted_slide_4.png?alt=media&#x26;token=c0b056b3-c525-4bbb-9494-16ee040e02da" alt=""><figcaption></figcaption></figure>

Query can be used via REST (1), dashboard can be published via URL (2).

<div data-full-width="true"><figure><img src="https://355116152-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyvjIeznprQQJj7d3yYKh%2Fuploads%2F21wjsmsrxFWrOLeJXJYS%2Fwarehouse_gettingStarted_slide_5.png?alt=media&#x26;token=d795ebba-7e9d-40c2-960d-a2a5d0174b4e" alt=""><figcaption></figcaption></figure></div>

{% embed url="<https://warehouse.xfi.ms/queries/85/source?p_dates=d_last_month#-1>" %}

{% code title="CURL" overflow="wrap" %}

```
curl -X POST 'https://api.dev.dex.guru/wh/xfi_addresses_interaction?api_key=sTa5PAljgZuakDAojY8YipKcUq0jHQH2mI8xKlxn' -H 'Content-Type: application/json' --data '{"parameters": {"dates":"d_last_month"}}'
```

{% endcode %}

{% code title="JS" overflow="wrap" %}

```
fetch( "https://api.dev.dex.guru/wh/xfi_addresses_interaction?api_key=sTa5PAljgZuakDAojY8YipKcUq0jHQH2mI8xKlxn", { method: "POST", headers: {"Content-Type": "application/json"}, body: '{"parameters": {"dates":"d_last_month"}}' } )
```

{% endcode %}

That is all for a main features introduction. All details can be provided on demand. Other features and uses cases will be described in a while.
