# Cross-Asset Market Sentiment & Fear/Greed Intelligence (`khnaami/cross-asset-market-sentiment-fear-greed-intelligence`) Actor

Real-time psychological market indices, Stock & Crypto Fear & Greed gauges, CBOE Put/Call ratios, VIX term curve indicators, cross-asset correlation matrices, and stablecoin market cap liquidity flows.

- **URL**: https://apify.com/khnaami/cross-asset-market-sentiment-fear-greed-intelligence.md
- **Developed by:** [khalid naami](https://apify.com/khnaami) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Cross-Asset Market Sentiment & Fear/Greed Intelligence 🔮📊

**Cross-Asset Market Sentiment Intelligence** is a quantitative sentiment analysis Actor on Apify. It extracts and models psychological indices, equity & cryptocurrency Fear & Greed gauges, option Put/Call volume ratios, 90-day Pearson cross-asset correlation matrices, multi-horizon benchmark performance matrices, and on-chain circulating stablecoin liquidity flows.

***

### 🌟 Key Features

1. **Stock Market Fear & Greed Index (0-100):**
   - **Market Momentum:** S\&P 500 relative to 125-day moving average.
   - **Market Volatility (VIX):** VIX relative to 50-day moving average.
   - **Safe Haven Demand:** 20-day return spread between Equities (SPY) and Gold (GLD).
   - **Junk Bond Demand:** 20-day return spread between High-Yield Debt (JNK) and Investment-Grade Corporate Debt (LQD).
   - **Put/Call Ratio:** Real-time options chain put vs call volume ratio.

2. **Crypto Market Fear & Greed Index (0-100):**
   - **Retail Fear & Greed:** Alternative.me retail psychological index.
   - **Bitcoin Momentum:** BTC price relative to 125-day moving average.
   - **ETH/BTC Relative Strength:** Ratio relative to 50-day moving average.
   - **Bitcoin Volatility:** 20-day annualized rolling volatility.

3. **Global Cross-Asset Sentiment Composite:**
   - Weighted composite index ($0-100$) classifying overall market psychology into `Extreme Fear`, `Fear`, `Neutral`, `Greed`, or `Extreme Greed`.

4. **Macro-Crypto Pearson Correlation Matrix:**
   - 90-day rolling correlation coefficient matrix between Bitcoin, Ethereum, Solana, S\&P 500, Gold, Crude Oil, and the US Dollar Index (UUP/DXY).

5. **Multi-Horizon Benchmark Performance Matrix:**
   - Real-time percentage returns across **1W, 1M, 3M, 6M, YTD, 1Y** for key equity (SPX, SPY, QQQ, IWM) and crypto (BTC, ETH, SOL, BNB) benchmarks.

6. **Circulating Stablecoin Supply & Liquidity Flows:**
   - Tracks total circulating stablecoin supply ($B) from DeFiLlama paired with Bitcoin price to identify leading liquidity inflows into risk assets.

***

### 📥 Input Configuration

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `includeStockSentiment` | `boolean` | `true` | Calculate equity sentiment index and underlying 5 drivers. |
| `includeCryptoSentiment` | `boolean` | `true` | Calculate crypto sentiment index and underlying 4 drivers. |
| `includeCorrelationMatrix` | `boolean` | `true` | Compute 90-day Pearson correlation matrix across assets. |
| `includeStablecoinSupply` | `boolean` | `true` | Track circulating stablecoin market cap vs Bitcoin price. |
| `includeBenchmarkPerformance` | `boolean` | `true` | Compute multi-horizon performance comparison table. |
| `historyDays` | `integer` | `30` | Number of daily historical sentiment records to output (7–365). |

***

### 📤 Output Schema

```json
{
  "recordType": "CROSS_ASSET_SENTIMENT_DOSSIER",
  "globalSentimentScore": 62.4,
  "globalClassification": "Greed 🤑",
  "stockSentimentScore": 65.8,
  "stockClassification": "Greed 🤑",
  "cryptoSentimentScore": 59.0,
  "cryptoClassification": "Greed 🤑",
  "marketMomentumScore": 72.4,
  "vixScore": 68.1,
  "safeHavenScore": 60.5,
  "junkBondScore": 62.2,
  "putCallRatioScore": 65.0,
  "retailCryptoFngScore": 58.0,
  "bitcoinMomentumScore": 64.2,
  "ethBtcStrengthScore": 52.0,
  "bitcoinVolatilityScore": 61.8,
  "stablecoinSupplyBillions": 182.54,
  "stockIndicatorsBreakdown": { ... },
  "cryptoIndicatorsBreakdown": { ... },
  "benchmarkPerformance": { ... },
  "macroCorrelationMatrix": { ... }
}
```

***

### 🚀 Local Run

```bash
uv run --with apify --with pandas --with numpy --with yfinance --with requests --with pytz --with python-dateutil python -m src.main
```

# Actor input Schema

## `includeStockSentiment` (type: `boolean`):

Calculate equity sentiment index from Momentum, VIX, Safe Haven demand, Junk Bond demand, and Options Put/Call ratio.

## `includeCryptoSentiment` (type: `boolean`):

Calculate crypto sentiment index from Alternative.me FNG, BTC momentum, ETH/BTC strength, and rolling volatility.

## `includeCorrelationMatrix` (type: `boolean`):

Compute 90-day correlation matrix between Bitcoin, Ethereum, Solana, S\&P 500, Gold, Oil, and US Dollar Index.

## `includeStablecoinSupply` (type: `boolean`):

Fetch DeFiLlama total circulating stablecoin supply and cross-reference with Bitcoin price to track liquidity expansions.

## `includeBenchmarkPerformance` (type: `boolean`):

Compute 1W, 1M, 3M, 6M, YTD, 1Y, 5Y percentage returns for major equity and crypto benchmarks.

## `historyDays` (type: `integer`):

Number of daily historical sentiment records to output in the timeseries.

## Actor input object example

```json
{
  "includeStockSentiment": true,
  "includeCryptoSentiment": true,
  "includeCorrelationMatrix": true,
  "includeStablecoinSupply": true,
  "includeBenchmarkPerformance": true,
  "historyDays": 30
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset items and records produced by the Actor

## `overview` (type: `string`):

Summary report stored in Key-Value store

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("khnaami/cross-asset-market-sentiment-fear-greed-intelligence").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("khnaami/cross-asset-market-sentiment-fear-greed-intelligence").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call khnaami/cross-asset-market-sentiment-fear-greed-intelligence --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,khnaami/cross-asset-market-sentiment-fear-greed-intelligence"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/umaH4GWWfcrOct2jP/builds/cVeBBrnwmrsPYGHGz/openapi.json
