LogoLogo
  • Introduction
  • Foundation Initiatives and Grants
    • Users
    • Ambassadors
    • Developers
    • Validators
  • Bug Bounty Program
  • The Unique Value of CrossFi Grants
  • FAQ Public Testnet
  • XFI PAD
  • How to do tasks
    • Test XFI Console
    • Faucets
      • Telagram faucet
      • Discord faucet
    • How to verify the task
    • Unique tasks
      • Social media
      • Delegate MPX to validator
    • Daily tasks
      • Send MPX
      • Send MPX to different addresses in the same transaction
      • Claim XFI reward
      • Send Cosmos XFI
      • Send EVM XFI
      • Send XFI to different addresses in the same transaction
      • Send XFI and MPX to different addresses in the same transaction
  • Additional MPX
  • CrossFi Evolution Hackathons
    • Hackaton # 1 - Boost XFI utility
      • Workshops Roadmap & Timeline
        • CrossFi Workshop #1
        • CrossFi Workshop #2
        • Partner Workshop: DEX Guru
          • Block Explorer & Data Warehouse Walkthrough
          • Quick Start Guide for Developers at XFI Hackathon
          • Data Warehouse
            • Query, Dashboard, API
          • Block Explorer
          • XFI Swap
          • Data Warehouse API
        • Partner Workshop: Bware Labs
          • Roadmap
          • Introduction
          • A Guide to Blast
          • Breaking DeFi Barriers with Blast
            • Using CrossFi with Blast
          • Public CrossFi Gateway
            • Public API
          • CrossFi RPC
            • CrossFi RPC Method Calls
          • Blast Intoduction
            • API Docs
            • Things to Know
            • Tutorials & Guides
            • Blast SDK
            • Blast Protocol
        • Partner Workshop: Covalent
          • A Guide to GoldRush
        • Partner Workshop: DIA
        • Workshop FAQs
      • Hackathon Judges
        • Interested in Becoming a Judge?
      • Hackathon FAQs
Powered by GitBook
On this page
  1. CrossFi Evolution Hackathons
  2. Hackaton # 1 - Boost XFI utility
  3. Workshops Roadmap & Timeline
  4. Partner Workshop: DEX Guru
  5. Data Warehouse

Query, Dashboard, API

PreviousData WarehouseNextBlock Explorer

Last updated 10 months ago

Video Explainer:

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.

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).

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).

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).

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

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).

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

CURL
curl -X POST 'http://warehouse-api.xfi.ms/wh/xfi_addresses_interaction?api_key=API_KEY' -H 'Content-Type: application/json' --data '{"parameters": {"dates":"d_last_month"}}'
JS
fetch( "http://warehouse-api.xfi.ms/wh/xfi_addresses_interaction?api_key=API_KEY", { method: "POST", headers: {"Content-Type": "application/json"}, body: '{"parameters": {"dates":"d_last_month"}}' } )

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.

https://www.loom.com/share/0eeddb99fdc24ff7a7b86fed83cfbb38?sid=6b474221-33b0-4699-8def-5634c8d950c4
https://warehouse.xfi.ms/dashboards?order=-created_at&page=1&page_size=20warehouse.xfi.ms
https://warehouse.xfi.ms/dashboards/xfi_pools_activity?p_dates=d_last_month&p_limit=100&p_network=xfi_testwarehouse.xfi.ms
https://warehouse.xfi.ms/dashboards/xfi_pools_activity?p_dates=d_last_month&p_limit=100&p_network=xfi_testwarehouse.xfi.ms
https://warehouse.xfi.ms/queries/85/source?p_dates=d_last_month#130warehouse.xfi.ms