π A implementation of TradingView's Advanced Charts powered by Bitquery's real-time OHLC streaming data. Plot DEX trading data with live price updates across multiple blockchains.
This project integrates TradingView's Advanced Charts with Bitquery's Trading API to display real-time OHLC (Open, High, Low, Close) candlestick charts for cryptocurrency trading pairs. Stream live price data from DEXs on Solana, Ethereum, BSC, and other blockchains directly into TradingView charts.
- Real-time OHLC candlestick charts using TradingView
- Support for multiple blockchains (Solana, Ethereum, BSC, Base, Polygon, Tron)
- Live price streaming via WebSocket subscriptions
- Support for DEX-specific data (Pump.fun, Raydium, Uniswap, PancakeSwap, etc.)
- Customizable base and quote token pairs
- USD or quote currency pricing
- Volume and moving averages (SMA, EMA)
git clone https://github.com/bitquery/tradingview-subscription-realtime.git
cd tradingview-subscription-realtime
npm installGet your Bitquery Access Token here
npm startPass the base and quote token addresses as URL parameters:
http://localhost:3000/?base=So11111111111111111111111111111111111111112"e=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
Example Parameters:
base: SOL token address (So11111111111111111111111111111111111111112)quote: USDC token address (EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v)
Follow the complete step-by-step tutorial here
Stream live OHLC price and volume data for all tokens on Solana, quoted directly in USD.
subscription {
Trading {
Pairs(
where: {
Interval: {Time: {Duration: {eq: 1}}}
Price: {IsQuotedInUsd: true}
Market: {Network: {is: "Solana"}}
Volume: {Usd: {gt: 5}}
}
) {
Token {
Name
Symbol
Address
}
Market {
Protocol
Program
Network
Name
Address
}
Block {
Date
Time
Timestamp
}
Interval {
Time {
Start
Duration
End
}
}
Volume {
Base
Quote
Usd
}
Price {
Ohlc {
Close
High
Low
Open
}
}
}
}
}Stream real-time OHLC and volume data for Solana tokens specifically paired against SOL or WSOL.
subscription {
Trading {
Pairs(
where: {
Interval: {Time: {Duration: {eq: 1}}}
Price: {IsQuotedInUsd: false}
QuoteToken: {
Address: {
in: [
"So11111111111111111111111111111111111111112"
"11111111111111111111111111111111"
]
}
}
Market: {Network: {is: "Solana"}}
Volume: {Usd: {gt: 5}}
}
) {
Token {
Name
Symbol
Address
}
QuoteToken {
Name
Symbol
Address
}
Market {
Protocol
Program
Network
Name
Address
}
Volume {
Base
Quote
Usd
}
Price {
Ohlc {
Close
High
Low
Open
}
}
}
}
}Real-time (1-second interval) price, OHLC, volume, and moving averages for Pump.fun AMM tokens on Solana.
subscription {
Trading {
Pairs(
where: {
Interval: {Time: {Duration: {eq: 1}}}
Price: {IsQuotedInUsd: true}
Market: {
Network: {is: "Solana"}
Program: {is: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"}
}
Volume: {Usd: {gt: 5}}
}
) {
Market {
Protocol
Program
Network
Name
Address
}
Block {
Date
Time
Timestamp
}
Interval {
Time {
Start
Duration
End
}
}
Volume {
Base
Quote
Usd
}
Price {
Ohlc {
Close
High
Low
Open
}
IsQuotedInUsd
}
Currency {
Symbol
Name
Id
}
Token {
Name
Symbol
Address
Id
}
QuoteToken {
Name
Symbol
Id
Address
}
}
}
}1-second OHLC and volume stream for tokens traded on Uniswap v3 (Ethereum).
subscription {
Trading {
Pairs(
where: {
Interval: {Time: {Duration: {eq: 1}}}
Price: {IsQuotedInUsd: true}
Market: {
Network: {is: "Ethereum"}
Address: {is: "0x1f98431c8ad98523631ae4a59f267346ea31f984"}
}
Volume: {Usd: {gt: 5}}
}
) {
Market {
Protocol
Program
Network
Name
Address
}
Volume {
Base
Quote
Usd
}
Price {
Ohlc {
Close
High
Low
Open
}
}
Token {
Name
Symbol
Address
}
}
}
}- Pump.fun AMM -
pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA - Raydium Launchlab -
LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj - Heaven DEX -
HEAVENoP2qxoeuF8Dj2oT1GHEnu49U5mJYkdeC8BAX2o - Meteora DBC - Supported
- Uniswap v3 -
0x1f98431c8ad98523631ae4a59f267346ea31f984 - Sushiswap -
0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac - PancakeSwap v3 -
0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865
- FourMeme -
0x5c952063c7fc8610ffdb798152d69f0b9550762b
You can choose between two price quotation modes:
-
USD Pricing (
IsQuotedInUsd: true)- OHLC values are in USD
- Useful for fiat-based trading bots and dashboards
-
Quote Currency Pricing (
IsQuotedInUsd: false)- OHLC values are in the quote token (e.g., USDC, SOL)
- Useful for analyzing token behavior relative to trading pairs
Available duration intervals:
- 1 second (
Duration: {eq: 1}) - 5 minutes (
Duration: {eq: 300}) - 1 hour (
Duration: {eq: 3600}) - Full list of intervals
Filter out low-volume or outlier trades:
Volume: {Usd: {gt: 5}} # Minimum $5 USD volume- Fork this repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License. Free to use and modify.
- Telegram: Join our community
- Form: Request API access or enterprise support
- Documentation: Bitquery Docs
- Crypto Price API - NPM package for token price feeds
- Bitquery IDE - Interactive GraphQL playground
- Streaming Data Platform - Kafka streams for blockchain data
Built with β€οΈ by Bitquery