GET
/
v2
/
chains
/
{chainId}
/
rollingWindowMetrics
/
{metric}
import { AvaCloudSDK } from "@avalabs/avacloud-sdk";

const avaCloudSDK = new AvaCloudSDK({
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const result = await avaCloudSDK.metrics.chain.metrics.getEvmChainRollingWindowMetrics({
    metric: "txCount",
    chainId: "43114",
  });

  // Handle the result
  console.log(result);
}

run();
{
  "result": {
    "lastHour": 123,
    "lastDay": 123,
    "lastMonth": 123,
    "lastYear": 123,
    "allTime": 123
  }
}

Path Parameters

metric
enum<string>
required

Which chain level metric to fetch for the rolling window.

Available options:
gasUsed,
txCount,
avgGps,
maxGps,
avgTps,
maxTps,
avgGasPrice,
maxGasPrice,
feesPaid
chainId
string
required

A supported EVM chain ID or one of "total", "mainnet", or "testnet". Use the /chains endpoint to get a list of supported chain IDs.

Response

200
application/json
Successful response
result
object
required

Array of current metrics values for different windows.