Twitter Analysis

Overview

Orama's Twitter Analysis is a powerful feature that scans Twitter profiles and tweets to discover and validate Solana token addresses. This tool helps users identify token mentions and validate them against blockchain data, providing valuable context for cryptocurrency research and analysis.

Key Capabilities

  1. Token Address Detection - Finds Solana token addresses mentioned in Twitter bios and tweets

  2. Address Validation - Validates detected addresses against the Solana blockchain

  3. Historical Analysis - Examines past usernames and bio changes for suspicious patterns

  4. Cross-Reference - Links Twitter accounts to token projects for better risk assessment

How It Works

The Twitter Analysis process involves:

  1. Profile Identification: The system identifies a Twitter username associated with a project.

  2. Data Collection: Orama retrieves data through multiple sources:

    • Bio History: Historical changes to a user's Twitter bio

    • Tweets: Content from the user's Twitter timeline

    • Latest Tweets: Most recent posts from the user

  3. Address Extraction: Sophisticated pattern matching extracts potential Solana addresses from text.

  4. Validation: Each extracted address is verified against the Solana blockchain to confirm it's a valid token.

  5. Results Display: Validated addresses are presented with context and action options.

Key Components

1. Address Discovery

The system uses multiple methods to identify potential Solana addresses:

  • Direct Address Matching: Identifies standalone base58-encoded strings (32-44 characters)

  • URL Extraction: Parses addresses from common Solana-related URLs, including:

    • Solscan links (solscan.io/token/[address])

    • Explorer links (explorer.solana.com/address/[address])

    • Trading platform links (pump.fun/coin/[address], dev.fun/coin/[address])

  • Context-Based Extraction: Recognizes addresses labeled with common identifiers:

    • "ca:" or "contract:" prefixes

    • "address:" prefix

    • Other contextual indicators that signify token addresses

2. Multi-Source Scanning

The analysis scans multiple Twitter data sources:

  • Bio History:

    • Retrieves historical bio changes via the Toto API

    • Useful for finding addresses previously mentioned but later removed

    • Provides timestamp context for when addresses were mentioned

  • Tweet Timeline:

    • Analyzes the user's regular tweet timeline

    • Captures addresses mentioned in content, images (via OCR), or linked content

    • Provides date and engagement context for each mention

  • Latest Tweets:

    • Focuses on the most recent posts for time-sensitive information

    • Prioritizes fresh content for newly launched or trending tokens

3. Address Validation

Each extracted address undergoes validation to ensure authenticity:

  • Format Validation: Confirms the string conforms to Solana address format

  • Blockchain Validation: Verifies the address exists on the Solana blockchain

  • Token Verification: Determines if the address is a legitimate SPL token

  • Filtering: Removes duplicate addresses and the current token address being viewed

4. Results Presentation

Results are displayed in a user-friendly format:

  • Address List: Clean presentation of validated addresses

  • Source Context: Indication of where each address was found (Bio or Tweet)

  • Date Information: When available, shows when the address was mentioned

  • Action Buttons:

    • Copy button for quick clipboard access

    • Solscan link for detailed blockchain exploration

  • Invalid Address Handling: Notification about addresses that were filtered out

Implementation Details

Address Extraction Function

The system uses a specialized function to extract Solana addresses from text:

function extractSolanaAddresses(text) {
    // Regular expression matches potential Solana addresses (32-44 characters)
    const addressPattern = /\b([1-9A-HJ-NP-Za-km-z]{32,44})\b/g;
    
    // Additional patterns for contextual mentions and URLs
    const urlPatterns = [
        /https?:\/\/(pump|dev)\.fun\/coin\/([1-9A-HJ-NP-Za-km-z]{32,44})/g,
        /ca:\s*([1-9A-HJ-NP-Za-km-z]{32,44})/gi,
        /contract:?\s*([1-9A-HJ-NP-Za-km-z]{32,44})/gi,
        /address:?\s*([1-9A-HJ-NP-Za-km-z]{32,44})/gi
    ];
    
    // Implementation collects all matches and removes duplicates
}

Address Validation Function

Each discovered address is validated through the Solscan API:

async function validateSolanaAddress(address) {
    // Makes request to check_tweets.php endpoint with 'validate_address' action
    // Returns true only if the address is confirmed valid by Solscan
}

Use Cases

The Twitter Analysis feature serves multiple use cases:

  1. Token Discovery: Identifying other tokens mentioned by project creators

  2. Supply Lock Verification: Finding references to token lock mechanisms

  3. Project Relationship Mapping: Understanding connections between projects

  4. Token Ecosystem Analysis: Discovering related tokens in a project's ecosystem

  5. Risk Assessment: Identifying patterns of suspicious token promotions

Limitations

Users should be aware of the following limitations:

  1. API Rate Limits: Analysis depends on Twitter API access through Toto

  2. Historical Coverage: May not capture all historical tweets for older accounts

  3. Pattern Matching Limits: Some unconventional address mentions might be missed

  4. Validation Precision: Validation confirms existence but not token legitimacy

  5. Private Accounts: Cannot analyze private Twitter accounts

Best Practices

For optimal use of the Twitter Analysis feature:

  1. Use with Context: Combine findings with other research methods

  2. Check Dates: Note when addresses were mentioned relative to token launches

  3. Verify Relationships: Confirm connections between identified tokens

  4. Follow Up: Use discovered addresses as starting points for deeper research

  5. Regular Rescans: Periodically recheck accounts for new address mentions

Technical Architecture

The feature comprises three main components:

  1. Frontend JavaScript: Handles user interaction, display, and address processing

  2. PHP Endpoint: Manages API communication and caching

  3. External APIs: Toto API for Twitter data and Solscan API for validation

API Endpoints

The system interacts with several API endpoints:

  • check_tweets.php: Main controller endpoint that:

    • Routes requests to appropriate APIs

    • Manages caching to reduce API load

    • Handles error conditions

  • External endpoints:

    • https://toto.oz.xyz/api/metadata/get_bio_history

    • https://toto.oz.xyz/api/metadata/get_tweets

    • https://toto.oz.xyz/api/metadata/get_latest_tweets

    • https://pro-api.solscan.io/v2.0/account/detail

Future Enhancements

Planned improvements to the Twitter Analysis feature:

  1. Enhanced OCR: Better extraction of addresses from images

  2. Sentiment Analysis: Understanding the context of address mentions

  3. Timeline Correlation: Mapping address mentions to token price movements

  4. Multi-Platform Support: Extending to other social platforms beyond Twitter

  5. Relationship Visualization: Graphical representation of token connections

Frequently Asked Questions

Q: Why might some addresses be filtered out as invalid? A: Addresses may be invalid if they don't exist on Solana, aren't actual token addresses, or don't pass blockchain validation.

Q: How far back does the Twitter analysis go? A: The analysis covers the available bio history and recent tweets as provided by the Toto API, typically up to several hundred recent tweets.

Q: Can I analyze any Twitter account? A: Yes, as long as the account is public and accessible through the API.

Q: How accurate is the address detection? A: The system employs multiple pattern-matching techniques to achieve high accuracy, but may occasionally miss unconventional mentions or extract text that happens to match Solana address format but isn't actually an address.

Q: Are the results cached? A: Yes, results are cached to improve performance and reduce API load, with cache durations set appropriately for each data type.

User Interface

The Twitter analysis interface provides:

  • A search button to find token addresses associated with Twitter accounts

  • A loading indicator during the scanning process

  • A formatted list of discovered token addresses

  • Source information for each address (bio or tweet with date)

  • Options to copy addresses or view them on Solscan

Usage Example

To scan a Twitter account:

  1. Enter the token address or project information in the main search

  2. On the token page, look for the "Find Token Addresses on Twitter" button

  3. Click the button to begin scanning the associated Twitter account

  4. View the resulting list of token addresses found in the Twitter profile

API Usage

To check Twitter for token addresses programmatically:

POST /check_tweets.php
Content-Type: application/json

{
  "action": "check_bio",
  "username": "twitterUsername"
}

OR

POST /check_tweets.php
Content-Type: application/json

{
  "action": "check_tweets",
  "username": "twitterUsername"
}

OR

POST /check_tweets.php
Content-Type: application/json

{
  "action": "check_latest_tweets",
  "username": "twitterUsername"
}

Response Format:

{
  "success": true,
  "data": [
    {
      "address": "SolanaTokenAddress123...",
      "source": "Twitter Bio (Date)"
    },
    {
      "address": "AnotherSolanaAddress456...",
      "source": "Tweet (Date)"
    }
  ]
}

Security and Privacy

  • No private Twitter data is stored permanently

  • All analysis is performed through public API endpoints

  • Results are cached temporarily to improve performance

  • User authorization is not required as only public data is accessed

Last updated