> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webacy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Cases

> See how wallets, DeFi protocols, exchanges, and compliance teams use the Webacy SDK for pre-transaction scanning, token screening, and rug pull detection.

Use the Webacy SDK to add blockchain security across diverse applications. Here's how you can leverage these capabilities for your use case.

## Wallet Apps & Browser Extensions

**Examples**: MetaMask-like wallets, hardware wallet companions, mobile wallets

<CardGroup cols={2}>
  <Card title="Pre-Transaction Scanning" icon="shield-check" href="/sdk/threat-client#analyze-address-risk">
    `addresses.analyze()` - Check addresses before sending funds
  </Card>

  <Card title="Fast Risk Assessment" icon="bolt" href="/sdk/threat-client#get-quick-profile">
    `addresses.getQuickProfile()` - Sub-500ms risk scores for real-time UX
  </Card>

  <Card title="Copy-Paste Protection" icon="clone" href="/sdk/threat-client#check-address-poisoning">
    `addresses.checkPoisoning()` - Detect address poisoning attacks
  </Card>

  <Card title="Transaction Simulation" icon="microscope" href="/sdk/threat-client#scan-transaction">
    `scan.scanTransaction()` - Simulate transactions before signing
  </Card>
</CardGroup>

**Additional Features**:

* `scan.scanEip712()` - Verify permit signatures
* `url.check()` - Block phishing links
* `wallets.getApprovals()` - Show risky token approvals

<Accordion title="Implementation Example">
  ```typescript theme={null}
  import { ThreatClient, Chain } from '@webacy-xyz/sdk';

  const client = new ThreatClient({
    apiKey: process.env.WEBACY_API_KEY,
    defaultChain: Chain.ETH,
  });

  // Before sending funds, check the recipient
  async function checkRecipient(address: string) {
    // Quick risk check (< 500ms)
    const profile = await client.addresses.getQuickProfile(address);

    if (profile.riskScore > 70) {
      // Deep analysis for high-risk addresses
      const analysis = await client.addresses.analyze(address);
      return { safe: false, issues: analysis.issues };
    }

    // Check for address poisoning
    const poisoning = await client.addresses.checkPoisoning(address);
    if (poisoning.is_poisoned) {
      return { safe: false, issues: ['Possible address poisoning attack'] };
    }

    return { safe: true };
  }
  ```
</Accordion>

<Note>
  **Value**: Protect your users before they sign dangerous transactions
</Note>

***

## DeFi Protocols & DEXes

**Examples**: Uniswap-like DEXes, lending protocols, yield aggregators

<CardGroup cols={2}>
  <Card title="Token Screening" icon="magnifying-glass" href="/sdk/threat-client#analyze-contract">
    `contracts.analyze()` - Screen new token listings
  </Card>

  <Card title="Tax Detection" icon="percent" href="/sdk/threat-client#get-contract-tax">
    `contracts.getTax()` - Show buy/sell taxes
  </Card>

  <Card title="Compliance" icon="gavel" href="/sdk/threat-client#check-sanctions">
    `addresses.checkSanctioned()` - OFAC sanctions screening
  </Card>

  <Card title="Rug Pull Detection" icon="chart-pie" href="/sdk/trading-client#get-holder-analysis">
    `holderAnalysis.get()` - Detect concentrated holdings
  </Card>
</CardGroup>

**Additional Features**:

* `tokens.getPools()` - Pool risk analysis

<Accordion title="Implementation Example">
  ```typescript theme={null}
  import { ThreatClient, TradingClient, Chain } from '@webacy-xyz/sdk';

  const threat = new ThreatClient({ apiKey: process.env.WEBACY_API_KEY });
  const trading = new TradingClient({ apiKey: process.env.WEBACY_API_KEY });

  // Screen a token before listing
  async function screenTokenForListing(tokenAddress: string, chain: Chain) {
    const [contract, holders, tax] = await Promise.all([
      threat.contracts.analyze(tokenAddress, { chain }),
      trading.holderAnalysis.get(tokenAddress, { chain }),
      threat.contracts.getTax(tokenAddress, { chain }),
    ]);

    const redFlags: string[] = [];

    if (contract.overallRisk > 70) redFlags.push('High contract risk');
    if (holders.top10Percentage > 90) redFlags.push('Concentrated holdings');
    if (tax.buyTax > 10 || tax.sellTax > 10) redFlags.push('High tax token');

    return { approved: redFlags.length === 0, redFlags };
  }
  ```
</Accordion>

<Note>
  **Value**: Screen tokens and protect your users from scams
</Note>

***

## Trading Platforms & Bots

**Examples**: Copy trading apps, trading bots, alpha scanners

<CardGroup cols={2}>
  <Card title="Fast Token Risk" icon="gauge-high" href="/sdk/trading-client#analyze-token">
    `tradingLite.analyze()` - Rapid token analysis (Solana)
  </Card>

  <Card title="Sniper Detection" icon="crosshairs" href="/sdk/trading-client#get-holder-analysis">
    `holderAnalysis.get()` - Detect snipers and bundlers
  </Card>

  <Card title="Trending Tokens" icon="fire" href="/sdk/trading-client#list-trending-tokens">
    `tokens.getTrending()` - Find trending tokens with risk scores
  </Card>

  <Card title="Hidden Fee Detection" icon="eye-slash" href="/sdk/threat-client#get-contract-tax">
    `contracts.getTax()` - Uncover hidden trading fees
  </Card>
</CardGroup>

**Additional Features**:

* `tokens.getPoolOhlcv()` - Technical analysis data

<Accordion title="Implementation Example">
  ```typescript theme={null}
  import { TradingClient, ThreatClient, Chain } from '@webacy-xyz/sdk';

  const trading = new TradingClient({
    apiKey: process.env.WEBACY_API_KEY,
    defaultChain: Chain.SOL,
  });
  const threat = new ThreatClient({ apiKey: process.env.WEBACY_API_KEY });

  // Quick token analysis for trading bot
  async function analyzeForTrading(tokenAddress: string) {
    // Fast analysis (< 1s)
    const quick = await trading.tradingLite.analyze(tokenAddress);

    if (quick.isHoneypot) return { tradeable: false, reason: 'Honeypot' };
    if (quick.riskScore > 80) return { tradeable: false, reason: 'High risk' };

    // Check for hidden fees
    const tax = await threat.contracts.getTax(tokenAddress, { chain: Chain.SOL });
    if (tax.buyTax > 5 || tax.sellTax > 5) {
      return { tradeable: false, reason: `High tax: ${tax.buyTax}/${tax.sellTax}` };
    }

    return { tradeable: true, riskScore: quick.riskScore };
  }
  ```
</Accordion>

<Note>
  **Value**: Identify safe trading opportunities, avoid scams
</Note>

***

## Exchanges (CEX & DEX)

**Examples**: Centralized exchanges, hybrid exchanges

<CardGroup cols={2}>
  <Card title="Sanctions Screening" icon="ban" href="/sdk/threat-client#check-sanctions">
    `addresses.checkSanctioned()` - OFAC/sanctions compliance
  </Card>

  <Card title="Deposit Screening" icon="inbox" href="/sdk/threat-client#analyze-address-risk">
    `addresses.analyze()` - Screen incoming deposits
  </Card>

  <Card title="Fund Tracing" icon="route" href="/sdk/threat-client#trace-fund-flows">
    `accountTrace.trace()` - Multi-hop fund flow analysis
  </Card>

  <Card title="Transaction Monitoring" icon="desktop" href="/sdk/threat-client#analyze-transaction">
    `transactions.analyze()` - Real-time transaction screening
  </Card>
</CardGroup>

**Additional Features**:

* `contracts.analyze()` - Token listing due diligence

<Accordion title="Implementation Example">
  ```typescript theme={null}
  import { ThreatClient, Chain } from '@webacy-xyz/sdk';

  const client = new ThreatClient({
    apiKey: process.env.WEBACY_API_KEY,
    defaultChain: Chain.ETH,
  });

  // Screen deposit address for compliance
  async function screenDeposit(address: string, chain: Chain) {
    // Sanctions check (required for compliance)
    const sanctions = await client.addresses.checkSanctioned(address, { chain });
    if (sanctions.is_sanctioned) {
      return { allowed: false, reason: 'Sanctioned address', details: sanctions };
    }

    // Risk analysis
    const risk = await client.addresses.analyze(address, { chain });
    if (risk.overallRisk > 80) {
      // Trace fund sources for high-risk
      const trace = await client.accountTrace.trace(address, { chain });
      return { allowed: false, reason: 'High risk', risk, trace };
    }

    return { allowed: true, riskScore: risk.overallRisk };
  }
  ```
</Accordion>

<Note>
  **Value**: Meet regulatory requirements and protect your platform
</Note>

***

## Portfolio Trackers & Analytics

**Examples**: Zerion, DeBank-like apps, wallet dashboards

<CardGroup cols={2}>
  <Card title="Approval Management" icon="list-check" href="/sdk/threat-client#get-approvals">
    `wallets.getApprovals()` - Show and manage token approvals
  </Card>

  <Card title="Transaction History" icon="clock-rotate-left" href="/sdk/threat-client#get-transactions">
    `wallets.getTransactions()` - Risk-scored transaction history
  </Card>

  <Card title="Wallet Health" icon="heart-pulse" href="/sdk/threat-client#get-quick-profile">
    `addresses.getQuickProfile()` - Wallet security scores
  </Card>

  <Card title="Token Data" icon="coins" href="/sdk/trading-client#get-token-economics">
    `tokens.getToken()` - Token economics and safety data
  </Card>
</CardGroup>

<Accordion title="Implementation Example">
  ```typescript theme={null}
  import { ThreatClient, TradingClient, Chain } from '@webacy-xyz/sdk';

  const threat = new ThreatClient({ apiKey: process.env.WEBACY_API_KEY });
  const trading = new TradingClient({ apiKey: process.env.WEBACY_API_KEY });

  // Build wallet health dashboard
  async function getWalletHealth(address: string, chain: Chain) {
    const [profile, approvals, transactions] = await Promise.all([
      threat.addresses.getQuickProfile(address, { chain, withApprovals: true }),
      threat.wallets.getApprovals(address, { chain }),
      threat.wallets.getTransactions(address, { chain }),
    ]);

    // Count risky approvals (unlimited or to unknown contracts)
    const riskyApprovals = approvals.approvals.filter(
      a => a.amount === 'unlimited' || a.spenderRisk > 50
    );

    return {
      riskScore: profile.riskScore,
      riskLevel: profile.riskLevel,
      accountAge: profile.accountAge,
      riskyApprovals: riskyApprovals.length,
      recentIssues: transactions.issues,
    };
  }
  ```
</Accordion>

<Note>
  **Value**: Give users insights into their wallet security
</Note>

***

## Compliance & Security Teams

**Examples**: Crypto compliance firms, AML providers, forensic investigators

<CardGroup cols={2}>
  <Card title="Sanctions Screening" icon="flag" href="/sdk/threat-client#check-sanctions">
    `addresses.checkSanctioned()` - Real-time sanctions checks
  </Card>

  <Card title="Fund Tracing" icon="diagram-project" href="/sdk/threat-client#trace-fund-flows">
    `accountTrace.trace()` - Multi-hop transaction tracing
  </Card>

  <Card title="History Analysis" icon="folder-open" href="/sdk/threat-client#get-transactions">
    `wallets.getTransactions()` - Complete transaction history
  </Card>

  <Card title="Contract Audits" icon="file-code" href="/sdk/threat-client#get-code-analysis">
    `contracts.getCodeAnalysis()` - Smart contract security analysis
  </Card>
</CardGroup>

<Accordion title="Implementation Example">
  ```typescript theme={null}
  import { ThreatClient, Chain } from '@webacy-xyz/sdk';

  const client = new ThreatClient({
    apiKey: process.env.WEBACY_API_KEY,
    defaultChain: Chain.ETH,
  });

  // AML screening workflow
  async function amlScreening(address: string, chain: Chain) {
    // Step 1: Sanctions check
    const sanctions = await client.addresses.checkSanctioned(address, { chain });
    if (sanctions.is_sanctioned) {
      return { status: 'blocked', reason: 'sanctioned', data: sanctions };
    }

    // Step 2: Risk analysis
    const risk = await client.addresses.analyze(address, { chain });

    // Step 3: Fund flow tracing for medium+ risk
    if (risk.overallRisk >= 50) {
      const trace = await client.accountTrace.trace(address, { chain });
      const transactions = await client.wallets.getTransactions(address, { chain });

      return {
        status: risk.overallRisk >= 75 ? 'review' : 'monitor',
        risk,
        trace,
        transactions,
      };
    }

    return { status: 'approved', risk };
  }
  ```
</Accordion>

<Note>
  **Value**: Enterprise-grade blockchain compliance and forensics
</Note>

***

## Token Launch Platforms

**Examples**: Pump.fun integrations, launchpads, fair launch platforms

<CardGroup cols={2}>
  <Card title="Holder Distribution" icon="users" href="/sdk/trading-client#get-holder-analysis">
    `holderAnalysis.get()` - Monitor holder concentration
  </Card>

  <Card title="Launch Screening" icon="rocket" href="/sdk/trading-client#analyze-token">
    `tradingLite.analyze()` - Screen new token launches
  </Card>

  <Card title="Contract Safety" icon="file-shield" href="/sdk/threat-client#analyze-contract">
    `contracts.analyze()` - Verify contract security
  </Card>
</CardGroup>

<Accordion title="Implementation Example">
  ```typescript theme={null}
  import { ThreatClient, TradingClient, Chain } from '@webacy-xyz/sdk';

  const threat = new ThreatClient({ apiKey: process.env.WEBACY_API_KEY });
  const trading = new TradingClient({
    apiKey: process.env.WEBACY_API_KEY,
    defaultChain: Chain.SOL,
  });

  // Screen new token launch
  async function screenLaunch(tokenAddress: string) {
    const [quick, holders, contract] = await Promise.all([
      trading.tradingLite.analyze(tokenAddress),
      trading.holderAnalysis.get(tokenAddress),
      threat.contracts.analyze(tokenAddress, { chain: Chain.SOL }),
    ]);

    const warnings: string[] = [];

    if (quick.isHoneypot) warnings.push('Honeypot detected');
    if (holders.sniperCount > 5) warnings.push(`${holders.sniperCount} snipers`);
    if (holders.bundlerCount > 0) warnings.push(`${holders.bundlerCount} bundlers`);
    if (holders.top10Percentage > 80) warnings.push('High concentration');
    if (contract.overallRisk > 70) warnings.push('Contract risk');

    return {
      safe: warnings.length === 0,
      warnings,
      metrics: { holders: holders.totalHolders, liquidity: quick.liquidity },
    };
  }
  ```
</Accordion>

<Note>
  **Value**: Verify launches are safe, detect snipers and bundlers
</Note>

***

## Why Webacy SDK?

<CardGroup cols={3}>
  <Card title="Multi-Chain" icon="link-horizontal">
    12+ chains: ETH, SOL, BASE, ARB, POL, OPT, BSC, TON, SUI, STELLAR, BTC, SEI
  </Card>

  <Card title="Type-Safe" icon="code">
    Full TypeScript support with IntelliSense
  </Card>

  <Card title="Real-Time" icon="bolt">
    Quick profile optimized for sub-500ms responses
  </Card>

  <Card title="Comprehensive" icon="layer-group">
    Addresses, contracts, URLs, transactions
  </Card>

  <Card title="Production-Ready" icon="server">
    Built-in retry logic and error handling
  </Card>

  <Card title="Pre-Transaction" icon="shield">
    Stop losses before they happen
  </Card>
</CardGroup>

## Get Started

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/sdk/installation">
    Install the SDK in your project
  </Card>

  <Card title="ThreatClient" icon="shield" href="/sdk/threat-client">
    Start with address and contract analysis
  </Card>

  <Card title="TradingClient" icon="chart-line" href="/sdk/trading-client">
    Token and holder analysis
  </Card>

  <Card title="API Reference" icon="book" href="api-reference/introduction">
    Full endpoint documentation
  </Card>
</CardGroup>
