Skip to main content

Legacy Queries & Mutations

Note

The following queries have been deprecated and may become inaccessible in the future. For guidance on which alternative queries to use instead, please refer to each deprecated query's deprecation description in the API Schema or Sandbox.

Balance Computation

Legacy portfolio query only

Token and app balances no longer require prior computation on the new portfolioV2 query. This updated endpoint eliminates the need for separate balance computation jobs and provides enhanced functionality. The original portfolio query will continue to require computation jobs but we recommend migrating to portfolioV2.

computeTokenBalances

Initiates a job to compute token balances for a wallet.

The input type for both mutations is PortfolioInput:

input PortfolioInput {
"""The wallet addresses for which to fetch balances"""
addresses: [Address!]!
"""The networks for which to fetch balances"""
networks: [Network!]
"""The app slugs for which to fetch balances"""
appIds: [String!]
flagAsStale: Boolean
}

Example Variables

{
"input": {
"addresses": ["Habp5bncMSsBC3vkChyebepym5dcTNRYeg2LVG464E96"],
"networks": ["BITCOIN_MAINNET", "SOLANA_MAINNET"]
}
}

Example Mutation

mutation ComputeTokenBalances($input: PortfolioInput!) {
computeTokenBalances(input: $input) {
jobId
}
}

Example Response

{
"data": {
"computeTokenBalances": {
"jobId": "38b53084-9e84-46fd-a5fc-e7463baba936"
}
}
}

computeAppBalances

Initiates a job to compute app balances for a wallet.

Example Variables

{
"input": {
"addresses": [
"0x123...", // EVM address being tracked for first time
"Habp5bncMSsBC3vkChyebepym5dcTNRYeg2LVG464E96" // Solana address
],
"networks": ["ETHEREUM_MAINNET", "SOLANA_MAINNET"]
}
}

Example Mutation

mutation ComputeAppBalances($input: PortfolioInput!) {
computeAppBalances(input: $input) {
jobId
}
}

Example Response

{
"data": {
"computeAppBalances": {
"jobId": "176d50a0-c42b-49b1-a263-c1c4a63d8a3c"
}
}
}

balanceJobStatus

Query the status of a balance computation job.

Example Variables

{
"jobId": "176d50a0-c42b-49b1-a263-c1c4a63d8a3c"
}

Example Query

query BalanceJobStatus($jobId: String!) {
balanceJobStatus(jobId: $jobId) {
jobId
status
}
}

Example Response

{
"data": {
"balanceJobStatus": {
"jobId": "176d50a0-c42b-49b1-a263-c1c4a63d8a3c",
"status": "completed"
}
}
}

Response Fields

FieldDescriptionType
jobIdUnique identifier for the computation jobID!
statusCurrent status of the jobString!

fungibleTokenBatch

Takes an array of token inputs (address and network pairs) and returns detailed information for multiple tokens in a single request. Returns the same data structure as fungibleToken but for multiple tokens at once.

Example Variables

{
"tokens": [
{
"address": "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf",
"network": "BASE_MAINNET"
},
{
"address": "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9",
"network": "ETHEREUM_MAINNET"
},
{
"address": "0x00ef6220b7e28e890a5a265d82589e072564cc57",
"network": "BASE_MAINNET"
}
]
}

Arguments

ArgumentDescriptionTypeRequired
addressToken contract addressAddress!Yes
networkNetwork where the token existsNetwork!Yes
currencyPrice currency (USD/ETH/BTC)Currency!Yes
timeFrameTime interval for price dataTimeFrame!Yes
firstNumber of holders to fetchFloat!Yes

Fields

FieldDescriptionType
idUnique identifier for the tokenID!
addressContract addressAddress!
nameToken nameString!
symbolToken symbolString!
decimalsNumber of decimalsInt!
totalSupplyTotal supply of the tokenString
credibilityToken credibility scoreFloat
rankToken rankInt
securityRiskSecurity risk assessmentFungibleTokenSecurityRisk
isHoldersSupportedWhether holder data is availableBoolean!
imageUrlToken logo URLString!
priceDataDetailed onchain market dataPriceData
isVerifiedToken verification statusBoolean!

priceData Fields

FieldDescriptionType
priceCurrent token priceFloat!
marketCapMarket capitalizationFloat
totalLiquidityTotal liquidity across all pairsFloat!
totalGasTokenLiquidityNative token liquidityFloat!
priceChange5m5-minute price change percentageFloat
priceChange1h1-hour price change percentageFloat
priceChange24h24-hour price change percentageFloat
priceTicksHistorical price data points[PriceTick!]!
historicalPricePrice at a given timestamp[HistoricalPrice!]!

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
}