CARV
CARVPlayPortalProtocol
  • Overview
    • Introducing CARV
  • SVM - AI AGENTIC CHAIN
    • Introduction
      • Architecture
      • AI Agent in TEE environment
      • CARV Verifier Nodes
    • Quick Start
      • Bridge Token
      • Explorer
      • Command line tool
      • Reading from CARV SVM Network
      • Writing to the Network
      • Network Info
  • D.A.T.A. - AI FRAMEWORK
    • Introduction
      • DeepSeek Integration
      • D.A.T.A's Core Features
      • How It Empowers AI Agents
      • Driving the Future of AI and Blockchain
      • Leveraging CARV SVM Chain for Privacy and Trustless Data Sharing
    • Quick Start Guide
    • Architecture
    • ERC-7231 (CARV ID)
    • Examples
      • On-Chain Insights
    • Getting Started
      • D.A.T.A Framework Plugin for Eliza
    • Use Cases and Implementation
      • Getting On-Chain Data for AI Agents
      • What's Coming with the D.A.T.A Framework
    • API Documentation
      • News
      • On-chain Data SQL Query
        • Ethereum Schema
        • Bitcoin Schema
        • Base Schema
        • Solana Schema
      • On-chain Data SQL Query by LLM
      • Token Info and Price
      • User Balance by Twitter ID
      • User Balance by Discord ID
  • CARV Ecosystem
    • CARV Play
      • Portal Access
      • Integration Guide
        • .Play Name Service Integration
        • API-Verified Quest (RESTFUL)
        • API-Verified Quest (GraphQL)
        • CARV ID OAuth 2.0
        • CARV ID Telegram SDK
      • Smart Contracts & Security
    • MOFF Bot & Customer Data Platform
    • CARV Account
      • ERC 7231
    • Verifier Nodes
      • How to Purchase Nodes
      • Buyback Program
      • Why Verifier Nodes
      • How do Verifier Nodes Work
        • CARV/veCARV Token
        • CARV Vault
        • CARV NFT License
        • CARV Protocol Service
        • Trusted Execution Environment (TEE)
        • Verifier Node
        • Attestation
        • Delegation
        • Rewards
        • SGX Attestation Verification
      • Verifier Node Sale Dynamics
      • Smart Contract Addresses
      • License Key (NFT)
      • Delegation
      • Node Rewards
      • Join Mainnet Verifier Nodes
        • Prerequisites
        • Delegation Tutorial
        • Operating a Verifier Node
          • Running in VPS
          • Running in CLI
            • Using Source Code
            • Using Docker
            • Gasless Server API
          • Running in Desktop App
      • Explorer
      • FAQ
        • Node Sale
        • Node Operation
  • CARV LABS
    • Introduction
    • Working with CARV Labs
  • Tokenomics
    • Utility
      • veCARV(s)
    • Distribution & Vesting
  • DECENTRALIZED GOVERNANCE
    • ⚔️Universal Guardian Program
    • 📔DAO Governance
    • 🌏Community Programs & Activities
  • Resources
    • 🗜️Writings
    • 🗞️CARV in the News
    • 🫶Social & Community Links
    • 🅰️Brand Guideline
    • 💰Job Openings
Powered by GitBook
On this page
  1. D.A.T.A. - AI FRAMEWORK
  2. Examples

On-Chain Insights

PreviousExamplesNextGetting Started

Last updated 4 months ago

In this section, we showcase how the AI Agent processes a user query and returns a structured response based on the query.

User Query:

Which address on Ethereum was the most active in the last 24 hours.

D.A.T.A framework generated query:

{
 "sql": {
   "query": "WITH address_activity AS (\n    SELECT\n        from_address AS address,\n        COUNT(*) AS tx_count\n    FROM\n        eth.transactions\n    WHERE date_parse(date, '%Y-%m-%d') >= date_add('day', -1, current_date)\n    GROUP BY\n        from_address\n    UNION ALL\n    SELECT\n        to_address AS address,\n        COUNT(*) AS tx_count\n    FROM\n        eth.transactions\n    WHERE\n        date_parse(date, '%Y-%m-%d') >= date_add('day', -1, current_date)\n    GROUP BY\n        to_address\n)\nSELECT\n    address,\n    SUM(tx_count) AS total_transactions\nFROM\n    address_activity\nGROUP BY\n    address\nORDER BY\n    total_transactions DESC\nLIMIT 1;",
   "explanation": "This query identifies the most active Ethereum address in the last 24 hours by counting transactions where the address was either the sender (from_address) or the receiver (to_address). The results are aggregated and ordered by the total number of transactions, with the most active address returned.",
   "timeRange": "Last 24 hours"
 },
 "analysis": {
   "overview": {
     "totalTransactions": "Number of transactions involving the most active address",
     "timeSpan": "Last 24 hours",
     "keyMetrics": ["Total transactions involving the address", "Address activity rank"]
   },
   "patterns": {
     "transactionPatterns": ["High frequency of transactions", "Potential bot or automated activity"],
     "addressBehavior": ["Possible exchange or DeFi protocol address", "High volume of incoming/outgoing transactions"],
     "temporalTrends": ["Peak activity during specific hours", "Consistent transaction frequency"]
   },
   "statistics": {
     "averages": {
       "transactionsPerHour": "Average transactions per hour for the address"
     },
     "distributions": {
       "transactionTypes": ["Incoming vs outgoing transactions", "Smart contract interactions"]
     },
     "anomalies": ["Unusual spikes in transaction volume", "Sudden changes in activity patterns"]
   },
   "insights": [
     "The address may belong to a high-frequency trading bot or a centralized exchange.",
     "High transaction volume could indicate market-making activity or arbitrage opportunities."
   ],
   "recommendations": [
     "Monitor the address for continued high activity to identify potential market trends.",
     "Investigate the nature of transactions (e.g., DeFi interactions, NFT trades) for deeper insights."
   ]
 }
}

D.A.T.A framework query result

   %%%% D.A.T.A. Generated SQL query: 
   WITH address_activity AS (
      SELECT
          from_address AS address,
          COUNT(*) AS tx_count
      FROM
          eth.transactions
      WHERE date_parse(date, '%Y-%m-%d') >= date_add('day', -1, current_date)
      GROUP BY
          from_address
      UNION ALL
      SELECT
          to_address AS address,
          COUNT(*) AS tx_count
      FROM
          eth.transactions
      WHERE
          date_parse(date, '%Y-%m-%d') >= date_add('day', -1, current_date)
      GROUP BY
          to_address
  )
  SELECT
      address,
      SUM(tx_count) AS total_transactions
  FROM
      address_activity
  GROUP BY
      address
  ORDER BY
      total_transactions DESC
  LIMIT 1; 

 ◎ LOGS
   %%%% D.A.T.A. queryResult 
   {
      "success": true,
      "data": [
        {
          "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
          "total_transactions": "118841"
        }
      ],
      "metadata": {
        "total": 1,
        "queryTime": "2025-01-15T08:04:54.644Z",
        "queryType": "aggregate",
        "executionTime": 0,
        "cached": false
      }
    } 

User Query:

What is the gas prive average on Ethereum last 3 days.

User Query:

Which stablecoin had the highest trading volume on Ethereum in the last 24 hours.

Ai Agent return result
Example response when Ai Agent integrate with D.A.T.A.
Example response when Ai Agent integrate with D.A.T.A.