Onchain Prices
Get comprehensive onchain prices, current and historical, for any token that has an onchain market across supported networks. Price ticks are also provided for price charts.
fungibleToken
Takes an address
and network
as input. Returns detailed token information including:
- Real-time onchain sourced price data
- Price history with customizable timeframes
- Total supply and holder stats
- Liquidity and market cap data
- Support for multiple price currencies (default: USD)
Example Use Case: Token Price Chart
Let's say you want to create a token page providing the price, historical graphs and relevant token information like holders, supply and the token's image:
Example Variables
{
"address": "0x0b3e328455c4059eeb9e3f84b5543f74e24e7e1b",
"network": "BASE_MAINNET",
"first": 3,
"currency": "USD",
"timeFrame": "DAY"
}
Example Query
query ($address: Address!, $network: Network!, $first: Float!, $currency: Currency!, $timeFrame: TimeFrame!) {
fungibleToken(address: $address, network: $network) {
address
decimals
holders(first: $first) {
edges {
node {
holderAddress
percentileShare
value
}
}
}
imageUrl
isVerified
name
onchainMarketData {
marketCap
price
priceChange1h
priceChange24h
priceChange5m
totalGasTokenLiquidity
totalLiquidity
priceTicks(currency: $currency, timeFrame: $timeFrame) {
open
close
timestamp
}
}
totalSupply
credibility
securityRisk {
reason
}
}
}
Example Response
{
"data": {
"fungibleToken": {
"address": "0x0b3e328455c4059eeb9e3f84b5543f74e24e7e1b",
"decimals": 18,
"holders": {
"edges": [
{
"node": {
"holderAddress": "0x33e34b8684565fcf6a9dd52a7e92c4e70211a045",
"percentileShare": 13.676185263198864,
"value": "50774461457002159101610000"
}
},
{
"node": {
"holderAddress": "0xbedaf4736c7bc4ec837b270956794804b51a8f15",
"percentileShare": 10.734552863561005,
"value": "39853301936153000000000000"
}
},
{
"node": {
"holderAddress": "0xf1c429b0ce94ef9893ef110d2cc100201dce71c8",
"percentileShare": 7.3448334665283745,
"value": "27268566239582812320742551"
}
}
]
},
"imageUrl": "https://storage.googleapis.com/zapper-fi-assets/tokens/base/0x0b3e328455c4059eeb9e3f84b5543f74e24e7e1b.png",
"isVerified": false,
"name": "Virtuals Protocol",
"onchainMarketData": {
"marketCap": 0,
"price": 1.6734657858256867,
"priceChange1h": -1.2189248852312207,
"priceChange24h": -0.1052080164544833,
"priceChange5m": -1.772950044856858,
"totalGasTokenLiquidity": 2086.377403161272,
"totalLiquidity": 8029017.21838576,
"priceTicks": [
{
"open": 1.7317099434546546,
"close": 1.713129470854715,
"timestamp": 1733266800000
},
{
"open": 1.7099732835315944,
"close": 1.6687759419061745,
"timestamp": 1733267400000
},
{
"open": 1.692603420681665,
"close": 1.6718833478924444,
"timestamp": 1733268000000
},
...
]
},
"totalSupply": "371261872.224199445718111888",
"credibility": null
"securityRisk": null
}
}
}
Arguments
Argument | Description | Type | Required |
---|---|---|---|
address | Token contract address | Address! | Yes |
network | Network where the token exists | Network! | Yes |
currency | Price currency (USD/ETH/BTC) | Currency! | Yes |
timeFrame | Time interval for price data | TimeFrame! | Yes |
first | Number of holders to fetch | Float! | Yes |
Fields
Field | Description | Type |
---|---|---|
id | Unique identifier for the token | ID! |
address | Contract address | Address! |
name | Token name | String! |
symbol | Token symbol | String! |
decimals | Number of decimals | Int! |
totalSupply | Total supply of the token | String |
credibility | Token credibility score | Float |
rank | Token rank | Int |
securityRisk | Security risk assessment | FungibleTokenSecurityRisk |
isHoldersSupported | Whether holder data is available | Boolean! |
imageUrl | Token logo URL | String! |
onchainMarketData | Detailed onchain market data | OnchainMarketData |
isVerified | Token verification status | Boolean! |
OnchainMarketData Fields
Field | Description | Type |
---|---|---|
price | Current token price | Float! |
marketCap | Market capitalization | Float |
totalLiquidity | Total liquidity across all pairs | Float! |
totalGasTokenLiquidity | Native token liquidity | Float! |
priceChange5m | 5-minute price change percentage | Float |
priceChange1h | 1-hour price change percentage | Float |
priceChange24h | 24-hour price change percentage | Float |
priceTicks | Historical price data points | [PriceTick!]! |
Enums
enum TimeFrame {
HOUR
DAY
WEEK
MONTH
YEAR
}
enum Currency {
USD
EUR
GBP
CAD
CNY
KRW
JPY
RUB
AUD
NZD
CHF
SGD
INR
BRL
ETH
BTC
HKD
SEK
NOK
MXN
TRY
}
fungibleTokensByAddresses
Takes an array of token inputs (address and network pairs). Returns an array of token data including:
- Token details for multiple tokens
- Real-time onchain sourced price data
- Price history with customizable timeframes
- Supports multiple price currencies (default: USD)
- Total supply and holder stats
- Tracks liquidity and market cap data
Example Use Case: Multi-Token Dashboard
Let's say you want to create a dashboard showing price information and market data for multiple tokens simultaneously:
Example Variables
{
"tokens": [
{
"address": "0x0b3e328455c4059eeb9e3f84b5543f74e24e7e1b",
"network": "BASE_MAINNET"
},
{
"address": "0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f",
"network": "ARBITRUM_MAINNET"
}
]
}
Example Query
query fungibleTokensByAddresses($tokens: [FungibleTokenInput!]!) {
fungibleTokensByAddresses(tokens: $tokens) {
id
address
name
symbol
decimals
totalSupply
networkId
credibility
rank
securityRisk {
reason
strategy
}
isHoldersSupported
network
imageUrl
onchainMarketData {
type
isExchangeable
price(currency: USD)
marketCap
totalLiquidity(currency: USD)
totalGasTokenLiquidity
priceChange5m
priceChange1h
priceChange24h
priceTicks(currency: USD, timeFrame: DAY) {
median
open
close
high
low
timestamp
}
}
isVerified
holders(first: 3) {
edges {
node {
holderAddress
value
percentileShare
}
}
totalCount
pageInfo {
hasNextPage
endCursor
}
}
}
}
Arguments
Argument | Description | Type | Required |
---|---|---|---|
tokens | Array of token inputs | [FungibleTokenInput!]! | Yes |
FungibleTokenInput
The FungibleTokenInput
type is used to specify a token's identifying information. Each input must include both the token's contract address and the network it exists on.
Structure
input FungibleTokenInput {
address: Address!
network: Network!
}
Examples
Single token input:
{
"tokens": [
{
"address": "0x0b3e328455c4059eeb9e3f84b5543f74e24e7e1b",
"network": "BASE_MAINNET"
}
]
}
Multiple tokens input:
{
"tokens": [
{
"address": "0x0b3e328455c4059eeb9e3f84b5543f74e24e7e1b",
"network": "BASE_MAINNET"
},
{
"address": "0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f",
"network": "ARBITRUM_MAINNET"
},
{
"address": "0x912CE59144191C1204E64559FE8253a0e49E6548",
"network": "ARBITRUM_MAINNET"
}
]
}
Return Fields
The query returns an array of FungibleToken objects, each containing the same fields as the single fungibleToken
query. Please refer to the Fields section above for detailed field descriptions.