Skip to main content

Aptos GraphQL and Analytics

Raw blockchain data can be difficult for developers to work with for a number of reasons.

  1. It is often stored in a proprietary format that is not easily accessible or readable by external systems or tools.
  2. It can be voluminous and complex, making it difficult to extract and analyze the specific information that is needed for a particular application or use case
  3. It may be distributed across multiple nodes in the blockchain network, requiring developers to devise complex strategies for accessing and integrating the data from multiple sources

BlockEden.xyz solves this by indexing blockchain data in real-time and presents the result to you with an analytics web portal and indexer GraphQL.

How BlockEden.xyz Analytics and GraphQL works?

Analytics web portal​

BlockEden.xyz Analytics is a metabase web portal for exploring and analyzing blockchain data. It allows users to easily query, visualize, and share data from Aptos and Sui blockchains.

Quick start

SQL examples​

Aptos User Tx Per Day

select date(timestamp) as date, count(*) as user_tx_count from user_transactions group by 1;

Aptos NFT swap volume last 14 days

SELECT date(inserted_at) AS date,
sum(((DATA #>> '{coin_amount}')::bigint / pow(10, 8))) AS coin_amount
FROM EVENTS
WHERE TYPE like '%::token_coin_swap::TokenSwapEvent'
AND inserted_at BETWEEN NOW() - INTERVAL '14 DAYS' AND NOW()
GROUP BY 1;

Indexer GraphQL​

GraphQL is a query language and runtime for building APIs that allows clients to request and receive only the data they need, in a predictable and flexible format. It provides a way for clients to specify the shape of the data they need, and for the server to describe the data it can provide, enabling more efficient and flexible communication between the client and the server. GraphQL is often used as an alternative to REST APIs, and is particularly well-suited for modern, data-driven applications that need to be flexible and easily extended.

You may create an api key at the dashboard to get transaction, block, coin, NFT, and events data from our GraphQL API.

Indexer database schema​

block_metadata_transactions​

FieldTypeDescription
versionInt8A version is the sequence id of a transaction.
block_heightInt8height of the block where the transactions are recorded
idVarcharidentifier of the block
roundInt8A round consists of achieving consensus on a block of transactions and their execution results.
epochInt8An epoch is a fixed duration of time, currently defined as two hours on mainnet.
previous_block_votes_bitvecJsonbbitvector of previous block votes
proposerVarcharaddress of the block proposer
failed_proposer_indicesJsonblist of failed proposer indices
timestampTimestampTimestamp is the machine timestamp of when the block is committed.
inserted_atTimestampinserted_at is when the row is inserted into the database.

coin_activities​

The coin_activities table contains all the coin transfter activity history.

FieldTypeDescription
transaction_versionInt8version of the transaction
event_account_addressVarcharaccount address where event is recorded
event_creation_numberInt8block creation number of the event
event_sequence_numberInt8unique identifier of the event
owner_addressVarcharaddress of the owner of the coin
coin_typeVarcharCoin type or symbol. Get all registered coin types.
amountNumericamount of the coin
activity_typeVarcharThe type of the activity among 0x1::coin::DepositEvent, 0x1::aptos_coin::GasFeeEvent, 0x1::coin::WithdrawEvent
is_gas_feeBoolindicates if the transaction is a gas fee or not
is_transaction_successBoolindicates if the transaction is successful or not
entry_function_id_strNullable<Varchar>entry function identifier of the transaction
block_heightInt8height of the block where the transaction is recorded
transaction_timestampTimestampwhen is the transaction minted
inserted_atTimestamptime when the transaction was inserted into the database

Example

List 10 most recent USDC coin activities for deposits into a specific address after a date.

Query:

query CoinActivities($owner_address: String, $limit: Int, $offset: Int, $coin_type: String, $after_at: timestamp) {
coin_activities(
where: {owner_address: {_eq: $owner_address}, activity_type: {_eq: "0x1::coin::DepositEvent"}, coin_type: {_eq: $coin_type}, transaction_timestamp: {_gte: $after_at}}
order_by: {transaction_version: desc}
limit: $limit
offset: $offset
) {
inserted_at
activity_type
amount
block_height
coin_type
entry_function_id_str
event_account_address
event_creation_number
event_sequence_number
is_gas_fee
is_transaction_success
owner_address
transaction_timestamp
transaction_version
}
}

Variables:

{
"owner_address": "0x8304621d9c0f6f20b3b5d1bcf44def4ac5c8bf7c11a1ce80b53778532396312b",
"limit": 10,
"offset": 0,
"coin_type": "0x5e156f1207d0ebfa19a9eeff00d62a282278fb8719f4fab3a586a0a2c0fffbea::coin::T",
"after_at": "2021-01-07T19:15:58.268388"
}

coin_balances​

FieldTypeDescription
transaction_versionInt8version of the transaction
owner_addressVarcharaddress of the owner
coin_type_hashVarcharhash of the coin type
coin_typeVarcharsymbol or name of the coin type
amountNumericamount of the transaction
transaction_timestampTimestampwhen the transaction was initiated
inserted_atTimestampwhen the row was inserted into the database

coin_infos​

FieldTypeDescription
coin_type_hashVarcharHash of the coin type metadata.
coin_typeVarcharThe type or symbol of the coin.
transaction_version_createdInt8Version of the transaction that created the coin type.
creator_addressVarcharThe address of the transaction creator.
nameVarcharThe name of the coin.
symbolVarcharThe symbol used to represent the coin.
decimalsInt4The number of decimal places used to represent the coin value.
transaction_created_timestampTimestampThe timestamp of when the transaction was created.
inserted_atTimestampThe timestamp of when the row was inserted into the database.
supply_aggregator_table_handleNullable<Varchar>Handle to the table that contains the supply aggregation data for the coin.
supply_aggregator_table_keyNullable<Text>Key used to identify the supply aggregation data for the coin.

coin_supply​

FieldTypeDescription
transaction_versionInt8Transaction version
coin_type_hashVarcharHash of the coin type
coin_typeVarcharType of coin
supplyNumericTotal supply of the coin
transaction_timestampTimestampTimestamp of the transaction
transaction_epochInt8Epoch of the transaction
inserted_atTimestampTimestamp of when the data was inserted

collection_datas​

FieldTypeDescription
collection_data_id_hashVarcharHash of the collection data ID
transaction_versionInt8Transaction version
creator_addressVarcharAddress of the creator
collection_nameVarcharName of the collection
descriptionTextDescription of the collection
metadata_uriVarcharURI of the metadata
supplyNumericTotal supply of the collection
maximumNumericMaximum supply of the collection
maximum_mutableBoolFlag indicating if the maximum supply is mutable
uri_mutableBoolFlag indicating if the metadata URI is mutable
description_mutableBoolFlag indicating if the description is mutable
inserted_atTimestampTimestamp of when the data was inserted
table_handleVarcharHandle of the table
transaction_timestampTimestampTimestamp of the transaction

current_ans_lookup​

FieldTypeDescription
domainVarcharDomain name
subdomainVarcharSubdomain name
registered_addressNullable<Varchar>Address that is registered
expiration_timestampTimestampTimestamp of when the registration expires
last_transaction_versionInt8Last transaction version
inserted_atTimestampTimestamp of when the data was inserted

current_coin_balances​

FieldTypeDescription
owner_addressVarcharAddress of the owner
coin_type_hashVarcharHash of the coin type
coin_typeVarcharType of coin
amountNumericAmount of coins
last_transaction_versionInt8Last transaction version
last_transaction_timestampTimestampTimestamp of the last transaction
inserted_atTimestampTimestamp of when the data was inserted

current_collection_datas​

FieldTypeDescription
collection_data_id_hashVarcharUnique identifier of the collection
creator_addressVarcharAddress of the creator of the collection
collection_nameVarcharName of the collection
descriptionTextDescription of the collection
metadata_uriVarcharURI of the metadata of the collection
supplyNumericCurrent supply of the collection
maximumNumericMaximum supply of the collection
maximum_mutableBoolIndicates if the maximum supply can be changed
uri_mutableBoolIndicates if the URI of the collection can be changed
description_mutableBoolIndicates if the description of the collection can be changed
last_transaction_versionInt8Version of the last transaction
inserted_atTimestampTimestamp of when the collection was created
table_handleVarcharHandle of the table where the collection data is stored
last_transaction_timestampTimestampTimestamp of the last transaction

current_staking_pool_voter​

FieldTypeDescription
staking_pool_addressVarcharAddress of the staking pool
voter_addressVarcharAddress of the voter
last_transaction_versionInt8Version of the last transaction
inserted_atTimestampTimestamp of when the voting relationship was created

current_token_datas​

FieldTypeDescription
token_data_id_hashVarcharUnique identifier for the token data
creator_addressVarcharAddress of the creator of the token
collection_nameVarcharName of the collection the token belongs to
nameVarcharName of the token
maximumNumericMaximum number of tokens allowed to exist
supplyNumericCurrent number of tokens in existence
largest_property_versionNumericLargest property version of the token
metadata_uriVarcharURI for the token metadata
payee_addressVarcharAddress of the payee for the token
royalty_points_numeratorNumericNumerator for the token's royalty points
royalty_points_denominatorNumericDenominator for the token's royalty points
maximum_mutableBoolIndicates if the maximum number of tokens can be changed
uri_mutableBoolIndicates if the metadata URI can be changed
description_mutableBoolIndicates if the description of the token can be changed
properties_mutableBoolIndicates if the properties of the token can be changed
royalty_mutableBoolIndicates if the royalty points of the token can be changed
default_propertiesJsonbDefault properties for the token
last_transaction_versionInt8Version of the last transaction for the token
inserted_atTimestampTimestamp of when the token data was inserted
collection_data_id_hashVarcharUnique identifier for the collection the token belongs to
last_transaction_timestampTimestampTimestamp of the last transaction for the token
descriptionTextDescription of the token

current_token_ownerships​

FieldTypeDescription
token_data_id_hashVarcharUnique identifier for token data
property_versionNumericVersion of token properties
owner_addressVarcharAddress of token owner
creator_addressVarcharAddress of token creator
collection_nameVarcharName of token collection
nameVarcharName of the token
amountNumericAmount of the token
token_propertiesJsonbToken properties in JSON format
last_transaction_versionInt8Version of the last transaction
inserted_atTimestampTimestamp of data insertion
collection_data_id_hashVarcharUnique identifier for collection data
table_typeTextType of the table
last_transaction_timestampTimestampTimestamp of the last transaction

current_token_pending_claims​

FieldTypeDescription
token_data_id_hashVarcharUnique identifier for token data
property_versionNumericVersion of token property
from_addressVarcharAddress of the sender
to_addressVarcharAddress of the receiver
collection_data_id_hashVarcharUnique identifier for collection data
creator_addressVarcharAddress of token creator
collection_nameVarcharName of token collection
nameVarcharName of the token
amountNumericAmount of the token
table_handleVarcharHandle of the table
last_transaction_versionInt8Version of the last transaction
inserted_atTimestampTimestamp of data insertion
last_transaction_timestampTimestampTimestamp of the last transaction

events​

FieldTypeDescription
sequence_numberInt8Unique sequence number of the event
creation_numberInt8Creation number of the event
account_addressVarcharAddress of the account
transaction_versionInt8Version of the transaction
transaction_block_heightInt8Height of the block in which the event was included
type_TextType of the event
dataJsonbData related to the event
inserted_atTimestampTimestamp of when the event was inserted into the database

indexer_status​

FieldTypeDescription
dbVarcharName of the database
is_indexer_upBoolWhether the indexer is up or down
inserted_atTimestampTimestamp when the indexer status was recorded

ledger_infos​

FieldTypeDescription
chain_idInt8Chain ID of the ledger

move_modules​

FieldTypeDescription
transaction_versionInt8Version number of the transaction
write_set_change_indexInt8Index of the change made in the write set
transaction_block_heightInt8Block height of the transaction
nameTextName of the module
addressVarcharAddress of the module
bytecodeNullable<Bytea>Bytecode of the module
friendsNullable<Jsonb>Friends of the module
exposed_functionsNullable<Jsonb>List of functions exposed by the module
structsNullable<Jsonb>Structs defined in the module
is_deletedBoolIndicates whether the module has been deleted
inserted_atTimestampTimestamp of when the module was inserted

move_resources​

FieldTypeDescription
transaction_versionInt8Version of the transaction
write_set_change_indexInt8The index of the change in the write set
transaction_block_heightInt8Block height in which the transaction was processed
nameTextName of the resource
addressVarcharAddress of the resource
typeTextType of the resource
moduleTextModule where the resource belongs to
generic_type_paramsNullable<Jsonb>Generic type parameters for the resource
dataNullable<Jsonb>Data stored in the resource
is_deletedBoolIndicates if the resource has been deleted
inserted_atTimestampTimestamp of when the resource was inserted

Examples

List all the move resources for a specific account by address, time and type.

Query:

query AccountTransactionsData($address: String, $limit: Int, $offset: Int, $after_at: timestamp, $type: String) {
move_resources(
where: {address: {_eq: $address}, inserted_at: {_gte: $after_at}, type: {_eq: $type}}
order_by: {transaction_version: desc}
distinct_on: transaction_version
limit: $limit
offset: $offset
) {
type
transaction_version
data
inserted_at
}
}

Variables:

{
"address": "0x8304621d9c0f6f20b3b5d1bcf44def4ac5c8bf7c11a1ce80b53778532396312b",
"limit": 100,
"offset": 0,
"after_at": "2022-01-07T19:15:58.268388",
"type": "0x1::coin::CoinStore<0x5e156f1207d0ebfa19a9eeff00d62a282278fb8719f4fab3a586a0a2c0fffbea::coin::T>"
}

processor_status​

FieldTypeDescription
processorVarcharName of the processor
last_success_versionInt8Version of the last successful transaction processed by the processor
last_updatedTimestampTimestamp of when the processor was last updated

processor_statuses​

FieldTypeDescription
nameVarcharName of the object
versionInt8Version number of the object
successBoolFlag indicating the success of the operation
detailsNullable<Text>Detailed information about the operation
last_updatedTimestampTimestamp of the last update made to the object

signatures​

FieldTypeDescription
transaction_versionInt8Version of the transaction
multi_agent_indexInt8Index of the multi-agent involved in the transaction
multi_sig_indexInt8Index of the multi-signature involved in the transaction
transaction_block_heightInt8Block height at which the transaction was included
signerVarcharThe signer of the transaction
is_sender_primaryBoolFlag indicating if the signer is the primary sender
typeVarcharType of the transaction
public_keyVarcharPublic key of the signer
signatureVarcharSignature of the transaction
thresholdInt8Threshold required for the transaction to be valid
public_key_indicesJsonbIndices of the public keys involved in the transaction
inserted_atTimestampTimestamp of when the transaction was inserted

table_items​

FieldTypeDescription
keyTextKey identifying the object in the database
transaction_versionInt8Version of the transaction that wrote to the object
write_set_change_indexInt8Index of the change made to the write set of the object
transaction_block_heightInt8Block height at which the transaction was included
table_handleVarcharHandle of the table that the object belongs to
decoded_keyJsonbDecoded key of the object
decoded_valueNullable<Jsonb>Decoded value of the object
is_deletedBoolFlag indicating if the object has been deleted
inserted_atTimestampTimestamp of when the object was inserted

table_metadatas​

FieldTypeDescription
handleVarcharUnique identifier for the metadata
key_typeTextType of the key for the metadata
value_typeTextType of the value for the metadata
inserted_atTimestampTimestamp when the metadata was inserted

token_activities​

FieldTypeDescription
transaction_versionInt8Version of the transaction
event_account_addressVarcharAddress of the event account
event_creation_numberInt8Creation number of the event
event_sequence_numberInt8Sequence number of the event
collection_data_id_hashVarcharHash of the collection data id
token_data_id_hashVarcharHash of the token data id
property_versionNumericVersion of the property
creator_addressVarcharAddress of the creator
collection_nameVarcharName of the collection
nameVarcharName of the token
transfer_typeVarcharType of transfer of the token
from_addressNullable<Varchar>Address the token was transferred from, if applicable
to_addressNullable<Varchar>Address the token was transferred to, if applicable
token_amountNumericAmount of tokens involved in the transfer
coin_typeNullable<Text>Type of the coin involved in the transfer, if applicable
coin_amountNullable<Numeric>Amount of the coin involved in the transfer, if applicable
inserted_atTimestampTimestamp when the activity was inserted into the table
transaction_timestampTimestampTimestamp of the transaction

token_datas​

FieldTypeDescription
token_data_id_hashVarcharUnique identifier of the token data
transaction_versionInt8Version of the transaction
creator_addressVarcharAddress of the creator of the token
collection_nameVarcharName of the token collection
nameVarcharName of the token
maximumNumericMaximum number of tokens in circulation
supplyNumericCurrent number of tokens in circulation
largest_property_versionNumericLargest version of the token properties
metadata_uriVarcharURI containing the metadata of the token
payee_addressVarcharAddress of the payee
royalty_points_numeratorNumericNumerator of the royalty points
royalty_points_denominatorNumericDenominator of the royalty points
maximum_mutableBoolFlag indicating if the maximum number of tokens is mutable
uri_mutableBoolFlag indicating if the metadata URI is mutable
description_mutableBoolFlag indicating if the description of the token is mutable
properties_mutableBoolFlag indicating if the properties of the token are mutable
royalty_mutableBoolFlag indicating if the royalty of the token is mutable
default_propertiesJsonbDefault properties of the token
inserted_atTimestampTimestamp when the record was inserted
collection_data_id_hashVarcharUnique identifier of the collection data
transaction_timestampTimestampTimestamp of the transaction
descriptionTextDescription of the token

token_ownerships​

FieldTypeDescription
token_data_id_hashVarcharUnique identifier of the token data
property_versionNumericVersion of the token properties
transaction_versionInt8Version of the transaction
table_handleVarcharUnique identifier of the table
creator_addressVarcharAddress of the creator of the token
collection_nameVarcharName of the token collection
nameVarcharName of the token
owner_addressNullable<Varchar>Address of the token owner, can be NULL
amountNumericNumber of tokens owned by the owner
table_typeNullable<Text>Type of the table, can be NULL
inserted_atTimestampTimestamp when the record was inserted
collection_data_id_hashVarcharUnique identifier of the collection data
transaction_timestampTimestampTimestamp of the transaction

tokens​

FieldTypeDescription
token_data_id_hashVarcharThe unique identifier of the token data
property_versionNumericThe version of the token properties
transaction_versionInt8The version of the transaction that created the token
creator_addressVarcharThe address of the creator of the token
collection_nameVarcharThe name of the collection the token belongs to
nameVarcharThe name of the token
token_propertiesJsonbThe properties of the token
inserted_atTimestampThe time the token was inserted into the database
collection_data_id_hashVarcharThe unique identifier of the collection data
transaction_timestampTimestampThe time the transaction that created the token was executed

transactions​

FieldTypeDescription
versionInt8version is the sequence id of the transaction
block_heightInt8The block height of the transaction
hashVarcharThe unique identifier of the transaction
typeVarcharThe type of the transaction (e.g. function call, contract creation)
payloadNullable<Jsonb>The payload contains arguments, code, function, type, type arguments if it is a function call
state_change_hashVarcharThe hash representing the state changes of the transaction
event_root_hashVarcharThe root hash of all events produced by the transaction
state_checkpoint_hashNullable<Varchar>The hash of the state checkpoint at the time of the transaction
gas_usedNumericThe amount of gas used by the transaction
successBoolWhether the transaction was successful or not
vm_statusTextThe status of the virtual machine after executing the transaction
accumulator_root_hashVarcharThe root hash of the accumulator after executing the transaction
num_eventsInt8The number of events produced by the transaction
num_write_set_changesInt8The number of write set changes made by the transaction
inserted_atTimestampThe time the transaction was inserted into the database
epochInt8The epoch of the transaction

user_transactions​

FieldTypeDescription
versionInt8version of the user transaction
block_heightInt8block height at which the transaction was confirmed
parent_signature_typeVarcharsignature type used for the transaction
senderVarcharaddress of the sender of the transaction
sequence_numberInt8sequence number of the transaction
max_gas_amountNumericmaximum gas amount allowed for the transaction to be executed
expiration_timestamp_secsTimestampexpiration time of the transaction in seconds
gas_unit_priceNumericgas unit price in smallest unit of the currency
timestampTimestamptime at which the transaction was confirmed
entry_function_id_strTextstring representation of the ID of the entry function of the smart contract being executed
inserted_atTimestamptime at which the transaction was inserted in the user_transactions table
epochInt8epoch of the transaction

write_set_changes​

FieldTypeDescription
transaction_versionInt8version of the transaction
indexInt8index of the change in the write set
hashVarcharhash of the transaction
transaction_block_heightInt8block height at which the transaction was confirmed
type_Texttype of write set change, among delete_resource, delete_table_item, write_module, write_resource, write_table_item
addressVarcharaddress of the change in the write set
inserted_atTimestamptime at which the change was inserted in the write_set_changes table