Skip to main content

SandBox Info


caution

The following tables are indexed based on the columns mentioned with each table. The queries executed using those columns perform well as compared to something that is not indexed.

If you need to do analysis on any other column, reach out to us. Contact Us

TABLES:


NFT_BY_CHAIN_ID_AND_CREATOR_AND_DATE

The NFT_BY_CHAIN_ID_AND_CREATOR_AND_DATE contains the NFT transaction data by chain Id, creatorName and date.

Indexed on: chainId,contractName,timestamp

Sample Queries

1. Daily Transaction Count for all Creators

Query

SELECT
CAST(date as date) date,
count(1) as DailyTransactions,
creatorName
FROM
NFT_BY_CHAIN_ID_AND_CREATOR_AND_DATE
where
creatorName not in (null)
group by
date,
creatorName
order by
date,
DailyTransactions desc

Result

dateDailyTransactionscreatorName
2022-06-0119010Gary Vaynerchuk
2022-06-011181HENI
2022-06-011120Elftown King
2022-06-01872Anonymous
2022-06-01671Yuga Labs
2022-06-01291Proof Collective
2022-06-01251Takashi Murakami
2022-06-01216Prince Lail
2022-06-01175Otter Eth
2022-06-01159Timpers.eth

2.Count of Transactions grouped by Creator Name

Query

SELECT
count(1) as transactions,
creatorName
FROM
NFT_BY_CHAIN_ID_AND_CREATOR_AND_DATE
where
creatorName not in (null)
group by
creatorName
order by
transactions desc

Result

transactionscreatorName
359885Gary Vaynerchuk
81096Yuga Labs
22434Takashi Murakami
16422Proof Collective
13973Anonymous
9662Otter Eth
9631Yam Karkai
8129Augminted Labs

3.Sum of value of contracts grouped by Creator Name

Query

SELECT
sum(value) as total,
creatorName creatorName
FROM
NFT_BY_CHAIN_ID_AND_CREATOR_AND_DATE
where
creatorName not in (null)
group by
creatorName
order by
total desc

Result

totalcreatorName
282128308016571108932102Yuga Labs
25200000000000000000Gravity Game Link
2303733036530396548Gary Vaynerchuk
600000000000000000Yam Karkai
460000000000000000Aaron Chang
94000000000000000Elftown King
91000000000000000Otter Eth
80000000000000000Orange Comet
17000000000000Anonymous

DEFI_BY_CHAIN_ID_AND_CONTRACT_NAME_AND_DATE

The DEFI_BY_CHAIN_ID_AND_CONTRACT_NAME_AND_DATE contains the DeFi transaction data by chain Id, contract name and date.

Indexed on: chainId,contractName,timestamp

Sample Queries

1. Weekly Top Bridge Protocols

Query

select
contractName as ContractName,
count(*) as TransactionCount
from
default.DEFI_BY_CHAIN_ID_AND_CONTRACT_NAME_AND_DATE
group by
contractName
order by
TransactionCount desc

Result

ContractNameTransactionCount
Uniswap V3 Router 24750616
Wrapped Ether Token1933368
1Inch v4 Router818813
Uniswap Labs: NonfungiblePositionManager160199
Uniswap Labs: SwapRouter117891
Aave Lending PoolV295610
Compound: COMP37962
AAVE v2 Main Market: WETHGateway17379
Compound: cETH Token12721
Compound: cUSDC Token9015

2.Daily Top From Address Transactions by Contract

Query

select
date as Date,
from
as
From,
DailyTransactions as "Daily Transactions"
from
(
select
cast(date as date) date,
from,
contractName,
count(1) as DailyTransactions,
rank() over (
partition by date
order by
date,
DailyTransactions desc
) as rnk
from
default.DEFI_BY_CHAIN_ID_AND_CONTRACT_NAME_AND_DATE
group by
contractName,
date,
from
order by
date,
DailyTransactions desc
) tmp
WHERE
tmp.rnk < 11

Result

DateFromDaily Transactions
2022-06-010xe2e54270813c5c44a6f97d123120952a12b00000254
2022-06-010x839d4641f97153b0ff26ab837860c479e2bd0242215
2022-06-010xe2f266d1d65a42728a59131a92cee4727ab84024191
2022-06-010x167003a4b849f182e8baf0b10777c99f6e1222cb175
2022-06-010xa3b83d0e2f3d2c675439188ef1aa13d1c6abca16157
2022-06-010x67ddb2184f3429359dca8c9f9166a5020bb1603f132
2022-06-010x55961e9fc41c07c13ec0c7103b3d34c0ae32c2eb121
2022-06-010xf07704777d6bc182bf2c67fbda48913169b84983112
2022-06-010x8b9d1dda24014b1670c5dbc4df227387cdbb8aec108
2022-06-010xc37704a457b1ee87eb657cae584a34961e86acac101

BRIDGE_BY_CHAIN_ID_AND_CONTRACT_NAME_AND_DATE

The BRIDGE_BY_CHAIN_ID_AND_CONTRACT_NAME_AND_DATE contains the Bridge transaction data by chain Id, contract name and date.

Indexed on: chainId,contractName,timestamp

Sample Queries

1. Weekly Top Bridge Protocols

Query

select
week,
bridge.contractName as contractName,
count(bridge.contractName) as count
from
(
select
concat(
CAST(
CAST(
YEAR(CAST(FROM_UNIXTIME(bridge.timestamp) AS DATE)) AS integer
) as varchar
),
'-',
leftPad(
CAST(
CAST(
toWeek(CAST(FROM_UNIXTIME(bridge.timestamp) AS DATE)) AS integer
) as varchar
),
2,
'0'
)
) as week,
*
from
default.BRIDGE_BY_CHAIN_ID_AND_CONTRACT_NAME_AND_DATE as bridge
) as bridge
where
bridge.contractName = 'Wormhole Solana'
group by
week,
bridge.contractName
order by
week desc

Result

weekcontractNamecount
2022-34Wormhole Solana2
2022-28Wormhole Solana4
2022-26Wormhole Solana10
2022-24Wormhole Solana10
2022-23Wormhole Solana17

2.Weekly Bridge Transaction Count

Query

select
concat(
CAST(
CAST(
YEAR(CAST(FROM_UNIXTIME(bridge.timestamp) AS DATE)) AS integer
) as varchar
),
'-',
leftPad(
CAST(
CAST(
toWeek(CAST(FROM_UNIXTIME(bridge.timestamp) AS DATE)) AS integer
) as varchar
),
2,
'0'
)
) as week,
count(week) as count
from
default.BRIDGE_BY_CHAIN_ID_AND_CONTRACT_NAME_AND_DATE as bridge
group by
week

Result

weekcount
2022-3216822
2022-2319902
2022-399563
2022-2817677
2022-3416901
2022-2522399
2022-3516962

TOKEN_PAIRS

The TOKEN_PAIRS table contains the data of token pairs exchanges across a defined protocol.

Indexed on: timestamp

Sample Queries

1.Token Pairs Data

Query

select
_id,
chainId,
pairName,
fees,
protocolName
from
TOKEN_PAIRS tp

Result

_idchainIdpairNamefeesprotocolName
1-0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc1USDC-WETH3000Uniswap
1-0x0d4a11d5eeaac28ec3f61d100daf4d40471f18521WETH-USDT3000Uniswap
1-0x9cbfb60a09a9a33a10312da0f39977cbdb7fde231SAITAMA-WETH3000Uniswap
1-0x5281e311734869c64ca60ef047fd87759397efe61WETH-CULT3000Uniswap
1-0xdc00ba87cc2d99468f7f34bc04cbf72e111a32f71WETH-LOOKS3000Uniswap
1-0x453a43e2bf3080f7a23c9bb034ccdd869e3061021WETH-STRNGR3000Uniswap
1-0x63b61e73d3fa1fb96d51ce457cabe89fffa7a1f11SHINJA-WETH3000Uniswap
1-0x6033368e4a402605294c91cf5c03d72bd96e7d8d1X2Y2-WETH3000Uniswap

2.Top Token Pair Swap

Query

select
monthName,
pairName,
noOfPairs
from
(
select
monthName(cast(timestamp as date)) as monthName,
month(cast(timestamp as date)) as num,
pairName,
count(1) as noOfPairs,
rank() over (
partition by monthName
order by
num,
noOfPairs desc
) as rnk
from
(
select
dte.contractAddress as contractAddress,
dte.contractName as contractName,
dse.`timestamp` as timestamp,
dse.entrySignature as entrySignature,
dse.hash as transactionHash,
dse.tokenAddress as pairAddress,
tp.pairName as pairName,
dse.amount0In as amount0In,
dse.amount1In as amount1In,
dse.amount0Out as amount0Out,
dse.amount1Out as amount1Out,
tp.token0symbol as token0Symbol,
tp.token1symbol as token1Symbol
from
default.defi_transaction_events dte,
DEFI_SWAP_EVENTS dse,
TOKEN_PAIRS tp
where
dse.tokenAddress = tp.token1address
and dse.hash = dte.hash
)
group by
monthName,
pairName,
num
order by
num,
noOfPairs desc
) tmp
where
tmp.rnk <= 5

Result

monthNamepairNamenoOfPairs
JuneWETH-NIL12
JulyWETH-NIL10
AugustWETH-NIL8

TOKEN_PRICES

The TOKEN_PRICES table contains the data of token prices updated on an hourly basis.

Indexed on: timestamp

Sample Queries

1.Top Token Price Data

Query

select
*
from
TOKEN_PRICES tp
order by
tokenPriceInUSD desc

Result

tokenNametokenSymboltokenPriceInUSDtimestamp
Wrapped Gen-0 CryptoKittiesWG099.996530002022-09-18 07:40:00.000
COALMLB99.996190002022-09-21 05:40:00.000
3X Long Bitcoin TokenBULL99.993460002022-09-18 07:40:00.000
WhiteheartWHITE99.992850002022-09-19 13:40:00.000
COALMLB99.991620002022-09-16 11:40:00.000
Wrapped Gen-0 CryptoKittiesWG099.985400002022-09-17 19:40:00.000
Wrapped Gen-0 CryptoKittiesWG099.984660002022-09-18 02:40:00.000
Opyn SqueethOSQTH99.984010002022-09-18 03:41:00.000