Back to LiveQuery Integrations

    Sui Fullnode (Mainnet)

    Sui Fullnode (Mainnet) from Flipside CryptoFlipside Crypto
    Log in to Manage

    Gain insights into the Sui mainnet via the fullnode API endpoint. The fullnode is provided by Flipside Crypto.

    The following query demonstrates the basic usage of LiveQuery by listing each validator and its APY, ordered by APY:

    WITH api_call as (
      SELECT
        livequery.live.udf_api(
          'POST',
          'https://rpc.mainnet.sui.flipside.services',
          { 'Content-Type': 'application/json' },
          { 'jsonrpc': '2.0',
          'id': 1,
          'method': 'suix_getValidatorsApy',
          'params': [] }
        ) as rawOutput
    ),
    formatted_results as (
      SELECT
        value:address::string as address,
        value:apy::FLOAT as apy
      FROM
        api_call,
        LATERAL FLATTEN (input => rawoutput:data:result:apys)
    )
    SELECT
      *
    FROM
      formatted_results
    ORDER BY apy DESC
    


    This query has the three basic building blocks of a LiveQuery query:

    1. Use the livequery livequery.live.udf_api function to perform an API request. You can specify the method, URL, headers, and JSON body as parameters.
    2. Format the result into rows using LATERAL FLATTEN.
    3. Perform the query on the formatted rows.
    Getting Started

    Start off by familiarizing yourself with the Flipside Data Studio LiveQuery feature via its documentaton. You will specifically be using the livequery.live.udf_api function, which is documented with examples here.

    After you understand how to use LiveQuery, you can use it to access the Sui fullnode API at https://rpc.mainnet.sui.flipside.services then query the results as though they were tabular data. You can use LiveQuery to query the API as follows:

    SELECT
      livequery.live.udf_api(
        'POST', -- Method
        'https://rpc.mainnet.sui.flipside.services', -- URL
        { 'Content-Type': 'application/json' } -- Headers
        { '...' }) -- JSON Body
    


    A body for a JSON-RPC request might look like:

    { 'jsonrpc': '2.0',
    'id': 1,
    'method': 'suix_getValidatorsApy',
    'params': [ ... ] }
    


    Overview

    Flipside provides free, community access to public RPC nodes for emerging Blockchain networks and those that the community shows interest in. This enables builder and analysts on those networks to develop applications on those chains and gather advanced insights via LiveQuery.

    Sui is a first-of-its-kind Layer 1 blockchain and smart contract platform designed to make digital asset ownership fast, private, secure, and accessible. Gain insights into the network via the fullnode RPC.

    Available API endpoints:

    • Sui JSON-RPC API: https://rpc.mainnet.sui.flipside.services/