RPCX Method Language Reference

Every step, function, operator, param type, and rule of the RPCX method language, each with its syntax and an example on the live tables.

This page lists everything the RPCX method language accepts, so you can write a method without a coding agent. Each step and function has its syntax, what it does, and an example. Every full method on this page reads the live tables and takes a list of wallets, so one call covers many addresses.

For a shorter introduction and the rules for live tables, see Writing methods. To find tables and columns, see Live tables and All tables. For one example per table, see Examples by table.

The shape of a method

A method is a header followed by a body in braces.

RPCX methodtext
# Transactions of many wallets in a time window, newest first.method walletTxs(  wallets: pubkey[] "Wallet addresses",  from: time "Start (UTC)",  to: time "End (UTC)",  limit: uint64 = 100 "Max rows",) {from live_transactionsfilter (address | in wallets) && ts >= from && ts < toselect {address, ts, sig, success, fee}sort {-ts}take limit}
  • Header: method <name>(<params>) {. The name is 1 to 64 letters, digits, or underscores. You call the method as rpcx_<name>. Use () for a method with no params.
  • Body: a pipeline, one step per line. It starts with from and ends before the closing }. Each step works on the rows from the step before.
  • Comments: a # starts a comment that runs to the end of the line, in the header or the body.
  • The last } in the text closes the method. Nothing may follow it except blank lines.

Params

Params go between the parentheses, separated by commas. They may span several lines, and a trailing comma is allowed.

name: typename: type = defaultname: type = default "Description"name?: type
  • A param name starts with a letter or _, then letters, digits, or _. Each name is used once.
  • A param is required unless it has a default.
  • A default is a number, a double-quoted string, true, or false. It must fit the type: a uint64 default is a whole number of 0 or more, and a time default is a string such as "2026-11-15".
  • The description is a double-quoted string and always comes last. It is saved with the method.
  • name?: type marks a param as optional with no default. A call that leaves it out, or passes null, gets null for it. See Optional filters.

Param types

TypeAcceptsExample value
pubkeyA base58 Solana address (32 bytes)"ARu4n5mFdZogZAravu7CcizaojWnS6oqka37gdLT5SZn"
signatureA base58 transaction signature (64 bytes)"2bZ38WCx2c6kyf7GFpnviH8TtbBJbGwvscaUiojjLYk6THFg2aNA6fh2cPDgyGdK8uwUQc6iFgk4VMUKtPTbRRVm"
stringAny text"pump"
uint64An integer from 0 to 2^64 - 1100
int64A signed 64-bit integer-5
float64A number0.5
booltrue or falsetrue
timeA UTC time, as RFC 3339 or YYYY-MM-DD. datetime and timestamp are other names for this type."2026-11-15 00:00:00", "2026-11-15T00:00:00Z", "2026-11-15"
pubkey[]A list of addresses["ARu4n5mFdZogZAravu7CcizaojWnS6oqka37gdLT5SZn", "EKmzDJWkajsqLMkY5WLWts9iUgqHCQny6hhd77fcQGN"]
signature[]A list of transaction signatures["2bZ38WCx2c6kyf7GFpnviH8TtbBJbGwvscaUiojjLYk6THFg2aNA6fh2cPDgyGdK8uwUQc6iFgk4VMUKtPTbRRVm"]
string[]A list of texts["a", "b"]
uint64[]A list of integers from 0 to 2^64 - 1[1, 2, 3]

pubkey and signature values are checked when the method runs, also inside lists. A value, or a default, that is not valid base58 of the right length is refused. An empty string is not a valid pubkey.

List params

A list param holds many values in one param. A call passes it as a JSON array, with up to 1,000 values. Use it with in:

filter (address | in wallets)

This is how a method reads many addresses at once. RPCX reads every address in the list in the same run, so pass all of them in one call instead of calling the method once per wallet. filter address in wallets, without the pipe, means the same.

Using params in the body

There are three ways to refer to params and columns:

WriteMeans
walletThe param wallet, when a param has that name. Otherwise the column.
$walletAlways the param wallet. The check fails if no param has that name.
this.ownerAlways the column owner, even when a param is also named owner.

In filter address == wallet, address is a column and wallet is the param. live_token_balance_changes has a column named owner, so a method on it that also has an owner param writes this.owner for the column:

RPCX methodtext
method tokenMovesOfOwner(wallets: pubkey[], owner: pubkey, from: time, to: time) {from live_token_balance_changesfilter (address | in wallets) && ts >= from && ts < tofilter this.owner == ownerselect {address, ts, sig, mint, change}}

A let may not have the same name as a param.

Params the dashboard adds for you

In the dashboard Code tab you can use a name before you declare it. When the code uses a name that is not a param, a column of a table in from or join, a name made in the code, or a function, the Params tab adds a row for it, marked from code. When the code stops using the name, the row goes away again, unless you edited it.

The type is a guess. Check it before you save:

Where or how the name is usedGuessed type
take <name>uint64
The right side of in, against an address column, as in (address | in wallets)pubkey[]
Compared with a column, as in address == wallet or ts >= startThe column's type: a String address column gives pubkey, sig gives signature, DateTime gives time, UInt* gives uint64, Int* gives int64, Float* gives float64
Named from, to, start, end, since, until, after, before, or ending in _time, _at, _ts, _datetime
Named limit, count, n, offset, or starting with min_ or max_uint64
Named like an address, such as wallet, owner, mint, pool, user, authority, programpubkey
Named sig, signature, or ending in _sig or _signaturesignature
Anything elsestring

Params from code are always required. Add a default in the Params tab to make one optional.

Optional filters

To let callers skip a filter, mark the param with ? and test it for null:

RPCX methodtext
method tokenMoves(  wallets: pubkey[] "Wallets",  token?: pubkey "Token mint. Leave it out for all tokens.",  from: time "Start (UTC)",  to: time "End (UTC)",) {from live_token_balance_changesfilter (address | in wallets) && ts >= from && ts < tofilter (token == null || mint == token)group {address} (aggregate {moves = count this})}

A call without token counts the token balance changes of every mint. A call with token counts only that mint, and the address is still checked as a pubkey.

Two places need a value, so they do not take an optional param:

  • take. Give the param a default instead, such as limit: uint64 = 100.
  • The key or range of a live table, such as (address | in wallets) or ts >= from && ts < to. Use required params there.

Steps

A step takes the rows from the step before it and returns new rows. The body starts with from.

from

Start the pipeline from a table, or from a relation made with let.

from <table>from <alias> = <table>

The alias gives the table a short name, which you need with join. Table names come from list_tables, from Live tables, or from the Code tab, which lists them when you type from .

Every read of a live table needs a key or a bounded range in the filter right after from: a key such as address, sig, program on live_instructions, or owner on live_token_accounts, or on a chain table a ts or slot range. Add a ts range to every read by address. See Keys and ranges.

RPCX methodtext
method firstTxs(wallets: pubkey[], from: time, to: time) {from t = live_signaturesfilter (t.address | in wallets) && t.ts >= from && t.ts < toselect {t.address, t.ts, t.sig}take 10}

filter

Keep the rows where the condition is true.

filter <condition>

Join conditions with && (and) and || (or). Several filter lines in a row act like one filter joined with &&.

RPCX methodtext
method costlyTxs(wallets: pubkey[], from: time, to: time, min_fee: uint64 = 100000) {from live_transactionsfilter (address | in wallets) && ts >= from && ts < tofilter fee >= min_fee && successselect {address, ts, sig, fee, compute_units}}

Put the key or range in the first filter, right after from.

derive

Add computed columns and keep all the others.

derive {<name> = <expression>, ...}

A new column can be used by the steps after it, including later columns in the same derive.

RPCX methodtext
method feePerCompute(wallets: pubkey[], from: time, to: time) {from live_transactionsfilter (address | in wallets) && ts >= from && ts < tofilter compute_units > 0derive {  fee_sol = fee / 1000000000,  lamports_per_cu = fee / compute_units}select {ts, sig, fee_sol, lamports_per_cu}take 20}

select

Keep only the listed columns, in that order. A column can be renamed or computed.

select {<column>, <new_name> = <expression>, ...}
RPCX methodtext
method txsShort(wallets: pubkey[], from: time, to: time) {from live_transactionsfilter (address | in wallets) && ts >= from && ts < toselect {ts, sig, payer = signer, ok = success}take 20}

After a select, only the selected columns exist. Put filters on other columns before it.

sort

Order the rows. A leading - sorts in descending order. List several columns to break ties.

sort {<column>, -<column>, ...}
RPCX methodtext
method newestTxs(wallets: pubkey[], from: time, to: time) {from live_signaturesfilter (address | in wallets) && ts >= from && ts < tosort {-ts, sig}select {address, ts, sig, success}take 20}

Rows have no set order unless you sort. The order also matters for window.

take

Keep the first rows.

take <n>take <start>..<end>take <param>

take 10 keeps the first 10 rows. take 11..20 keeps rows 11 to 20: the count starts at 1 and both ends are included. take limit uses a param, which must be uint64 or int64.

RPCX methodtext
method secondPageOfTxs(wallets: pubkey[], from: time, to: time) {from live_signaturesfilter (address | in wallets) && ts >= from && ts < tosort {-ts}select {address, ts, sig}take 21..40}

Use one take with a param per method. Use sort before take to choose which rows you get.

group and aggregate

aggregate reduces rows to one row. group runs a short pipeline once for each distinct value of its columns, and is almost always used with aggregate.

aggregate {<name> = <aggregate function>, ...}group {<column>, ...} (<pipeline>)

Without group, aggregate returns one row for all rows:

RPCX methodtext
method txStats(wallets: pubkey[], from: time, to: time) {from live_transactionsfilter (address | in wallets) && ts >= from && ts < toaggregate {  txs = count_distinct sig,  payers = count_distinct signer,  fees = sum fee}}

With group, you get one row per group, with the group columns first:

RPCX methodtext
method txsPerWallet(wallets: pubkey[], from: time, to: time, limit: uint64 = 20) {from live_transactionsfilter (address | in wallets) && ts >= from && ts < togroup {address} (  aggregate {    txs = count this,    fees = sum fee  })filter txs >= 10sort {-txs}take limit}
  • A filter after the group filters the grouped rows, for example filter txs >= 10.
  • group can also hold sort and window. See window.
  • group {<column>} (take 1) keeps one row per value. See One row per value.
  • group {<column>} (sort {...} | take 3) keeps the top 3 rows per value. See Top rows per group.
  • The aggregate functions are listed in Aggregate functions.

join

Add the columns of a second table to each row, where a condition matches.

join <alias> = <table> (==<column>)join <alias> = <table> (<condition>)join side:<inner|left|right|full> <alias> = <table> (<condition>)
  • (==sig) joins rows where the column sig is equal on both sides.
  • A condition can compare any columns, for example (c.sig == t.sig). In a condition, this is the table before the join and that is the joined table: (this.sig == that.sig).
  • side sets which rows are kept. inner, the default, keeps rows that match on both sides. left keeps every row from the first table. right keeps every row from the joined table. full keeps every row from both.
  • Give both tables an alias and use it for the columns, such as c.ts. Columns with the same name in both tables are ambiguous without one.

Each live table in a join needs its own key or range. Read the second table in a let, or in a pipeline in parentheses, with its own filter, then join it. This adds the fee and fee payer of the transaction to each token balance change:

RPCX methodtext
method tokenMovesWithFee(wallets: pubkey[], from: time, to: time) {let txs = (  from live_transactions  filter (address | in wallets) && ts >= from && ts < to  select {address, sig, fee, signer})from c = live_token_balance_changesfilter (c.address | in wallets) && c.ts >= from && c.ts < tojoin side:left t = txs (c.sig == t.sig && c.address == t.address)select {c.address, c.ts, c.sig, c.mint, c.change, t.fee, t.signer}}

c.address == t.address in the condition matters: a transaction that touches two of your wallets has one row for each of them in both tables.

When a row has no match, the columns from the other table are null. To find rows without a match, test for null, for example filter t.sig == null.

window

Compute columns over a frame of nearby rows, in the current sort order. The row count stays the same.

window (<pipeline>)window rows:<a>..<b> (<pipeline>)window range:<a>..<b> (<pipeline>)window rolling:<n> (<pipeline>)window expanding:true (<pipeline>)

The pipeline inside is a derive that uses window functions or aggregate functions. Sort first. Inside group, the window restarts for each group.

A moving average of the fee over the current row and the two before it:

RPCX methodtext
method movingAverageFee(wallet: pubkey, from: time, to: time) {from live_transactionsfilter address == wallet && ts >= from && ts < tosort {ts}window rows:-2..0 (derive {avg3 = average fee})select {ts, sig, fee, avg3}take 50}

The frame forms:

FrameRows in the frameExample
noneThe whole group or result, for row_number, rank, and rank_densewindow (derive {n = row_number this})
rows:<a>..<b>From a rows before to b rows after the current row. 0 is the current row, negative numbers are before it.window rows:-2..0 (derive {avg3 = average fee})
range:<a>..<b>Rows whose sort value is between the current value plus a and plus b. Sort by one number column, such as slot.window range:-1..0 (derive {near = count this})
rolling:<n>The current row and the n - 1 rows before itwindow rolling:3 (derive {avg3 = average fee})
expanding:trueEvery row from the first to the current one: a running totalwindow expanding:true (derive {running = sum change})

A running SOL balance change per wallet, with expanding:true inside group:

RPCX methodtext
method runningSol(wallets: pubkey[], from: time, to: time) {from live_sol_balance_changesfilter (address | in wallets) && ts >= from && ts < tofilter account == addressgroup {address} (  sort {ts}  window expanding:true (derive {running = sum change}))select {address, ts, sig, change, running}sort {address, ts}}

A filter after window can use the new column.

One row per value

There is no distinct step. To keep one row per value, group by the columns and take one row:

group {<column>, ...} (take 1)
RPCX methodtext
method mintsMoved(wallets: pubkey[], from: time, to: time) {from live_token_balance_changesfilter (address | in wallets) && ts >= from && ts < toselect {mint}group {mint} (take 1)}

Steps after it, such as sort and take, work on the rows it keeps. To keep more than one row per value, use a larger take inside the group. See Top rows per group.

To count the rows of each value as well, group with aggregate:

RPCX methodtext
method mintList(wallets: pubkey[], from: time, to: time, limit: uint64 = 100) {from live_token_balance_changesfilter (address | in wallets) && ts >= from && ts < togroup {mint} (aggregate {moves = count this})sort {-moves}take limit}

let

let names a relation or a function, before the main pipeline. Use it to keep a long method readable.

let <name> = (<pipeline>)let <name> = <param> -> <expression>

Use a relation with from <name>. A relation that reads a live table needs its key or range inside the let, right after its from.

RPCX methodtext
method failedTxCount(wallets: pubkey[], from: time, to: time) {let failed = (  from live_signatures  filter (address | in wallets) && ts >= from && ts < to  filter success == false  select {address, sig})from failedgroup {address} (aggregate {failures = count this})}

A function names its argument before ->:

RPCX methodtext
method feesInSol(wallets: pubkey[], from: time, to: time) {let sol = x -> x / 1000000000from live_transactionsfilter (address | in wallets) && ts >= from && ts < toselect {ts, sig, fee_sol = sol fee}take 20}

Functions

Arguments follow the function name, separated by spaces, with no parentheses or commas: math.round 2 x. When an argument is itself an expression, put it in parentheses: math.round 2 (fee / amount_in).

The examples below are expressions on the columns of live_transactions and live_token_balance_changes.

Aggregate functions

Use these inside aggregate, or inside window for a value over the frame.

FunctionSyntaxWhat it doesExample
countcount thisNumber of rowscount this
count_distinctcount_distinct <column>Number of distinct valuescount_distinct sig
sumsum <column>Sum of the valuessum fee
averageaverage <column>Mean of the valuesaverage fee
minmin <column>Smallest valuemin ts
maxmax <column>Largest valuemax fee
firstfirst <column>A value from one row of the group. Which row is not guaranteed: a sort before group does not set it.first sig
lastlast <column>A value from one row of the group. As with first, which row is not guaranteed.last sig

To get the time of the first or last transaction, use min ts or max ts.

Window functions

Use these inside window (derive {...}), after a sort.

FunctionSyntaxWhat it doesExample
row_numberrow_number thisRow number in the window, starting at 1row_number this
rankrank <column>Rank in sort order. Ties share a rank, and the next rank skips: 1, 1, 3.rank ts
rank_denserank_dense <column>Rank in sort order without gaps after ties: 1, 1, 2.rank_dense ts

Math functions

FunctionSyntaxWhat it doesExample
math.roundmath.round <digits> <x>Round to the given number of decimal digitsmath.round 2 (fee / 1000000000)
math.absmath.abs <x>Absolute valuemath.abs change
math.floormath.floor <x>Round down to an integermath.floor (change / 1000000)
math.ceilmath.ceil <x>Round up to an integermath.ceil (change / 1000000)
math.powmath.pow <exponent> <x>x to the power of exponentmath.pow 2 fee
math.sqrtmath.sqrt <x>Square rootmath.sqrt fee
math.expmath.exp <x>e to the power of xmath.exp 1
math.lnmath.ln <x>Natural logarithmmath.ln fee
math.log10math.log10 <x>Base 10 logarithmmath.log10 fee
math.logmath.log <base> <x>Logarithm in the given basemath.log 2 fee

Text functions

The text to work on is always the last argument.

FunctionSyntaxWhat it doesExample
text.lowertext.lower <s>Lower casetext.lower signer
text.uppertext.upper <s>Upper casetext.upper signer
text.trimtext.trim <s>Remove spaces at both endstext.trim " pump "
text.ltrimtext.ltrim <s>Remove spaces at the starttext.ltrim " pump"
text.rtrimtext.rtrim <s>Remove spaces at the endtext.rtrim "pump "
text.lengthtext.length <s>Number of characterstext.length signer
text.extracttext.extract <start> <length> <s>Part of the text, from start (counting from 1), length characters longtext.extract 1 4 signer
text.replacetext.replace <pattern> <replacement> <s>Replace every occurrence of pattern. The pattern is plain text.text.replace "pump" "" mint
text.starts_withtext.starts_with <prefix> <s>True if s starts with prefixtext.starts_with "So1" mint
text.containstext.contains <part> <s>True if s contains parttext.contains "pump" mint
text.ends_withtext.ends_with <suffix> <s>True if s ends with suffixtext.ends_with "pump" mint

Date functions

FunctionSyntaxWhat it doesExample
date.truncdate.trunc <unit> <time>Round a time down to the start of its "minute", "hour", "day", "week", "month", or "year". The unit is a string.date.trunc "hour" ts
date.diffdate.diff <unit> <start> <end>Whole units from start to end. The unit is a bare word: second, minute, hour, day, week, month, or year.date.diff second from ts
date.to_textdate.to_text <format> <time>Format a time as text with strftime codes, such as %Y, %m, %d, %H, %M, %Sdate.to_text "%Y-%m-%d %H:%M" ts

Other functions

These two are used with a pipe, |. Inside {...}, such as in derive or select, put the whole expression in parentheses.

FunctionSyntaxWhat it doesExample
in<x> | in <a>..<b> or <x> | in [<v>, ...]True if x is in the range, both ends included, or in the list(fee | in 5000..100000)
as<x> | as <type>Convert to a type: DOUBLE, BIGINT, UBIGINT, HUGEINT, VARCHAR, or BOOLEAN. Float64, Int64, UInt64, Int128, and String also work.(fee | as Float64)

In a filter, in takes a list param, a literal list, or a range:

RPCX methodtext
method txsOfTwoWallets(from: time, to: time) {from live_signaturesfilter (address | in [  "ARu4n5mFdZogZAravu7CcizaojWnS6oqka37gdLT5SZn",  "EKmzDJWkajsqLMkY5WLWts9iUgqHCQny6hhd77fcQGN",]) && ts >= from && ts < toselect {address, ts, sig}}

With a list param, the same filter is filter (address | in wallets), and the caller passes the addresses.

Operators and literals

Operators

The examples are expressions on live_transactions and live_token_balance_changes.

OperatorMeaningExample
==Equalsigner == "ARu4n5mFdZogZAravu7CcizaojWnS6oqka37gdLT5SZn"
!=Not equalmint != "So11111111111111111111111111111111111111112"
>Greater thanfee > 0
>=Greater than or equalfee >= 10000
<Less thanfee < 10000
<=Less than or equalts <= @2026-11-15T12:00:00
&&Andsuccess && fee > 5000
||Orfee == 0 || compute_units == 0
!Not!(fee > 5000)
+Addpre_amount + change
-Subtract, or negatepost_amount - pre_amount
*Multiplyfee * 2
/Divide. The result is always a decimal number, even for two integers.fee / 1000000000
//Integer division: the whole part of the resultslot // 1000
%Remainderslot % 4
??The right side when the left side is nullnull ?? 0
~=Regular expression matchsigner ~= "^So1"

Use parentheses when in doubt about the order: (a + b) * c.

Literals

KindFormExample
IntegerDigits. _ may separate groups.1_000_000
Decimal numberDigits with a ., or with an exponent1.5e3
StringDouble quotes"So11111111111111111111111111111111111111112"
Booleantrue or falsetrue
Nullnullnull
Date@ and YYYY-MM-DD@2026-11-15
Date and time@ and YYYY-MM-DDTHH:MM:SS, in UTC@2026-11-15T12:30:00
Range<a>..<b>, both ends included. Used by in, take, and window.(slot | in 380000000..380000100)
List[<v>, ...]. Used by in.(slot % 4 | in [0, 1])

A date literal can replace a time param, for example filter ts >= @2026-11-15 && ts < @2026-11-16. The method then always reads the same range, and returns nothing once that range is older than the live data. Use time params instead.

case

case picks the value of the first condition that is true. End with true => for a default.

case [<condition> => <value>, ..., true => <default>]
RPCX methodtext
method feeSizes(wallets: pubkey[], from: time, to: time) {from live_transactionsfilter (address | in wallets) && ts >= from && ts < toderive {  size = case [    fee >= 1000000 => "large",    fee >= 10000 => "medium",    true => "small",  ],}select {ts, sig, fee, size}take 20}

To count the rows for each case value, group by the new column:

RPCX methodtext
method feeSizeCounts(wallets: pubkey[], from: time, to: time) {from live_transactionsfilter (address | in wallets) && ts >= from && ts < toderive {  size = case [    fee >= 1000000 => "large",    fee >= 10000 => "medium",    true => "small",  ],}group {size} (aggregate {txs = count this})}

Names and columns

  • Strings use double quotes.
  • A column with the same name as a param needs this.: this.owner. See Using params in the body.
  • After a join, write <alias>.<column>. Give an output column a clear name when both tables have it, for example tx_ts = t.ts.
  • A new column named like a function, such as sum, min, count, or neg, cannot be used by a later step: the check fails with Ambiguous name. Pick another name, such as total or txs.
  • Amounts are raw integers. SOL amounts are in lamports. Token amounts are in base units: divide by 10^decimals yourself.

The time range

The chain tables hold the latest Solana data, up to the newest blocks. On a read by address, add a ts range:

filter (address | in wallets) && ts >= from && ts < to
  • With a key, the range only narrows the read. RPCX reads only the transactions in it, so the run is faster and costs less.
  • Without a range, RPCX reads every transaction of each address that it has. For busy addresses, such as programs, the USDC mint, or the System Program, that is a lot of data, and the run can reach the 30-second limit.
  • Without a key, a range alone reads every block in it, so it may cover at most 3,000 slots. slot >= start && slot < stop works the same way.
  • Older history is not available. A range that starts earlier returns only the rows RPCX still has.
  • Use time params for the bounds. A date literal, such as @2026-11-15, always reads the same range, so the method returns nothing once it is older than the live data.
  • live_accounts and live_token_accounts have no ts column. They hold the state at the time the method runs.

Not allowed

These are refused by Validate:

WhatCode
SQL, including s-strings such as s"..."dsl_raw_sql_not_allowed. A line of plain SQL fails with dsl_compile.
A prql header linedsl_not_allowed
module, import, and type definitionsdsl_not_allowed
Annotations, @{...}dsl_not_allowed
A let with the same name as a paramdsl_not_allowed
read_csv, read_json, read_parquet, from_text, and loopdsl_not_allowed. A method reads only the live tables.
A live table read without a key or a bounded range in the filter right after fromlive_key_missing
take with a param that is not uint64 or int64dsl_type_mismatch
$name for a param that is not in the headerdsl_unknown_param
A body with no stepsdsl_empty_body
distinctdsl_compile. Use group {...} (take 1).

Recipes

Each recipe is a complete method. Paste it into the Code tab of a new method, fill in Params, select Save, and then Run. For wallets, enter one address per line. Start with a short, recent time range.

Activity of many wallets

RPCX methodtext
# Transactions, failures, and fees per wallet in a window.method walletActivity(  wallets: pubkey[] "Wallet addresses",  from: time "Start (UTC)",  to: time "End (UTC)",) {from live_transactionsfilter (address | in wallets) && ts >= from && ts < toderive {  failed = case [success == false => 1, true => 0],  own_fee = case [signer == address => fee, true => 0],}group {address} (  aggregate {    txs = count this,    failures = sum failed,    first_tx = min ts,    last_tx = max ts,    fees_paid = sum own_fee  })sort {-txs}}

For the single transactions, see the walletTxs method at the top of this page.

Who pays for your wallets' transactions

RPCX methodtext
# Fee payers other than the wallet itself, per wallet.method feePayers(  wallets: pubkey[] "Wallet addresses",  from: time "Start (UTC)",  to: time "End (UTC)",  limit: uint64 = 50 "Max rows",) {from live_transactionsfilter (address | in wallets) && ts >= from && ts < tofilter signer != addressgroup {address, signer} (  aggregate {    txs = count this,    fees = sum fee  })sort {-txs}take limit}

Net SOL flow per hour

RPCX methodtext
# Net SOL change per wallet and hour, in SOL.method solPerHour(  wallets: pubkey[] "Wallet addresses",  from: time "Start (UTC)",  to: time "End (UTC)",) {from live_sol_balance_changesfilter (address | in wallets) && ts >= from && ts < tofilter account == addressderive {hour = date.trunc "hour" ts}group {address, hour} (  aggregate {    txs = count_distinct sig,    net_lamports = sum change  })derive {net_sol = net_lamports / 1000000000}sort {address, hour}}

Token inflows of many wallets

RPCX methodtext
# Tokens each wallet received, by mint.method tokenInflows(  wallets: pubkey[] "Wallet addresses",  from: time "Start (UTC)",  to: time "End (UTC)",) {from live_token_balance_changesfilter (address | in wallets) && ts >= from && ts < tofilter owner == address && change > 0group {address, mint} (  aggregate {    receipts = count this,    received = sum change,    last_receipt = max ts  })sort {address, -receipts}}

Balances and holdings now

RPCX methodtext
# SOL balance and number of token holdings per wallet, right now.method walletSnapshot(wallets: pubkey[] "Wallet addresses") {let holdings = (  from live_token_accounts  filter (owner | in wallets)  filter amount > 0  group {owner} (aggregate {tokens = count this}))from a = live_accountsfilter (a.address | in wallets)join side:left h = holdings (a.address == h.owner)select {a.address, sol = a.lamports / 1000000000, tokens = h.tokens ?? 0}sort {-sol}}

A wallet with no token holdings gets tokens = 0. An address with no account on chain returns no row.

Number each wallet's transactions

RPCX methodtext
# Each wallet's transactions in a window, numbered in time order.method txsNumberedPerWallet(  wallets: pubkey[] "Wallet addresses",  from: time "Start (UTC)",  to: time "End (UTC)",  limit: uint64 = 200 "Max rows",) {from live_signaturesfilter (address | in wallets) && ts >= from && ts < togroup {address} (  sort {ts}  window (derive {nth = row_number this}))select {address, nth, ts, sig}sort {address, nth}take limit}

Top rows per group

RPCX methodtext
# Each wallet's three most expensive transactions in a window.method topFeesPerWallet(  wallets: pubkey[] "Wallet addresses",  from: time "Start (UTC)",  to: time "End (UTC)",  limit: uint64 = 300 "Max rows",) {from live_transactionsfilter (address | in wallets) && ts >= from && ts < togroup {address} (  sort {-fee}  take 3)select {address, ts, sig, fee}sort {address, -fee}take limit}

take 3 inside group keeps the first 3 rows of each wallet, in the order of the sort before it. Change 3 to keep more or fewer rows per wallet.