Skip to Content
Tables

Tables

Tables let you structure and explore your smart contract’s data.

For exampmple, use it view all your protocols:

  • loans
  • liquidity positions

Essentially, you convert contract state / actions into tables for analysis and monitoring.

Built-in tables

Four tables are available automatically:

Positions — DeFi positions held by your contracts, including supplied value, borrowed value and health.

Users — Addresses interacting with your contracts, with transaction activity and last-seen times.

Dependencies — Contracts your deployments interact with, including usage and oracle freshness.

Assets — Tokens held across your contracts, with balances and USD values.

Use contract groups to narrow these tables to a particular part of your protocol.

Custom tables

Create tables for items defined by your contracts.

For example, a lending protocol might have a Loans table showing every loan across its markets. A vault protocol might have a Withdrawal rounds table showing each round’s status, queued amount and available liquidity.

How to create a table

A table is defined in five parts.

PartDefinesExample
SourceWhich contracts the table reads.A group of 87 lending markets.
RowsHow each item is found.Every withdrawal round across those markets.
StateWhere each item is in its lifecycle.Queued, Expired, Paid.
FieldsThe values shown for each item.Requested, Paid, Outstanding.
MonitoringWhat raises an alert.A round Expired for over 24 hours.

1. Source

A table reads one contract or a group of contracts. A table on a group includes every contract in it, including contracts that join later.

2. Rows

Each row is one item. Items are found in one of three ways.

MethodFinds items byExample
EventAn event that announces each item.Each round from a WithdrawalQueued event.
ListA view function that returns the current items.getUnpaidBatchExpiries() returns the open rounds.
IndexedA count function, then a lookup by index for each item.poolLength(), then poolInfo(i).

3. State

Each item has a state. The states are named per table.

State
QueuedRequested, not yet processed.
WaitingIn its waiting period.
ExpiredPast its expiry, not yet paid.
Ready to payFunds available.
PaidPaid in full.
FinishedClosed out.

Each state has a trigger that moves an item into it.

TriggerExample
An event is emitted.BatchPaid moves the round to Paid.
A function returns a value.getWithdrawalBatch(id) returns a status of 2.
The item leaves a list.The round is no longer returned by getUnpaidBatchExpiries().

A lifecycle can branch. A governance proposal moves from Pending to Active, then to one of Succeeded, Defeated or Cancelled. An item can reach any state whose trigger fires; states are not required to follow a fixed sequence.

4. Fields

Fields are the table’s columns.

KindValueExample
ReadA view function called for each item.getWithdrawalBatch(id) → amount paid.
EventEvents for each item, combined: a count, sum, latest, earliest, minimum or maximum.Sum of amount over the round’s WithdrawalQueued events.
CalculatedA formula over the item’s other fields.Outstanding = Requested - Paid; Completion % = Paid / Requested × 100.

Token amounts can be shown in USD. A table across markets holding USDC, WETH and DAI then sorts, filters and monitors on one unit.

5. Monitoring

Monitors on a table judge each row, or the table as a whole.

Row monitors apply to every item and alert per item.

TypeAlerts whenExample
ValueA field crosses a threshold.A withdrawal has more than $100k outstanding.
StateAn item enters a state.A withdrawal enters Expired.
DurationAn item stays in a state longer than a set time.A withdrawal has been Expired for over 24 hours.

Table monitors judge a total across all rows.

Example
Total outstanding withdrawals across all 87 markets exceeds $5m.

Groups

A group is a tag on watched contracts. All contracts is every watched contract in the workspace. A contract can be in any number of groups.

Columns and monitors are added to a group, and every contract in the group gets them. A contract that joins the group later gets them too.

Add a group

Select Add + in the Contracts section of the rail.

Field
TagThe group’s name.
ContractsHow contracts join: A registry lists them, A factory announces them, or Picked by hand.

A registry lists them watches every address one view function on one contract returns.

Field
ChainThe registry’s chain.
RegistryThe registry’s address.
List readThe function that returns the list, as a signature: getRegisteredMarkets().

A factory announces them watches every address one event on one contract carries.

Field
ChainThe factory’s chain.
FactoryThe factory’s address.
EventThe event’s signature, or its topic hash.
Address inWhere the new contract’s address sits in the event: an indexed argument (topic 1 to 3) or a data word (from 0).

Creating the group runs the rule. Every address it finds is tagged, and watched where it was not already. The table shows Watching n of m contracts… until the last one is watched. A rule keeps running: new addresses the registry or factory produces are watched and tagged automatically, and Sync now in the group’s row menu runs it immediately.

Picked by hand opens the group’s contract picker instead. Search by name or address, select the contracts, and save.

Watching a contract with From a registry or factory in the Watch contract dialog creates a group the same way.

Manage a group

The row menu (…) on a group in the rail:

Action
Edit contracts…Add or remove contracts by hand. Contracts already in the group are listed first.
Sync nowRun the group’s rule. Shown for groups filled by a rule. The result reads 87 found · 87 watched.
Remove group…Remove the tag from its contracts, with the group’s columns, monitors and tables. The contracts stay watched.

Contracts table

The Contracts table lists the contracts in the selected group, on the selected chain.

Column
ContractName and address.
Chain
TypeThe contract’s detected type.
HeldValue held by the contract, USD.
Tx 24hState-changing transactions in the last 24 hours.
RevertedShare of those that reverted.
Reverted · count
ActivityTransactions per hour over the last 24 hours.
TagsThe groups the contract is in.

Chain, Held, Tx 24h, Reverted and Activity are shown by default, followed by the group’s own columns. Show the rest from + Column. Rows are sorted by Held.

Columns

A column is a value read from every contract in scope. There are two kinds.

Kind
MeasureA number, tracked on every row: it is read continuously, keeps history, draws a seven-day spark beside the value, and can be monitored. Each row’s reading is a metric.
AttributeA word read once per row: an address, a number, a flag, a string. The table can group by it.

Add a column

Select + Column, then Add column….

Field
Pick fromThe contract whose ABI the picker reads. The column applies to every contract in scope.
FunctionFrom the ABI lists the contract’s view functions. Typed takes a signature by hand (totalAssets()) and the return word to read; use it when no ABI is on file.
ReadThe function.
ArgumentsThe function’s arguments, comma separated, when it takes any.
FieldFor a function returning several values or a struct, which one.
ColumnThe column’s label. Filled from the function or field name; edit it.
Reads asa measure or an attribute. Functions returning an address, a flag or a string switch to attribute.
ScaleFor a measure: each row’s decimals() reads the scale from each contract, one for all uses one number of decimals.
UnitFor a measure: Asset units, Dollars, Count, Percent, Seconds or Rate · %. Decides how the value prints and which filters and monitors it takes.
TypeFor an attribute: address, uint, bool or string.

Preview reads the function once on every contract in scope and lists the first results with how many answered, before anything is tracked. Add column · tracks n adds it.

Column menu

Every column header opens a menu. Its title is the read behind the column.

Item
Sort high to low / Sort low to highA to Z for text columns. Unknown values sort last.
Group by …Attribute columns only.
Filter on …Opens the filter dialog on this column.
Add monitor…Tracked measures only. See Monitors below.
Hide columnTakes the column off the table. It stays in + Column.
Stop tracking…Stops reading a measure on every contract in scope and deletes its monitors. Remove column… for an attribute.

Hidden columns are listed under + Column by section: Built-in, Reads, Events, Attributes, and so on.

Filter

Select + Filter, or Filter on … from a column header.

Field
ColumnAny column except Activity.
Isabove or below for numbers; is or is not for text, chain and protocol columns.
ValueA number in the column’s unit (dollars, seconds, percent), or one of the values present in the table.

Filters combine; a row must pass every one. Each filter is a chip above the table with its own remove.

Group

Group in the header, or Group by … from an attribute column, folds the table into one row per value. A group row shows the number of rows under it and a figure per column: a sum, a maximum, a minimum, a ratio of sums, a count under a line, or the distinct values. Groups are ordered by the sort column’s figure.

The first group starts open. Select the chevron to open or close one. Select a group’s name to narrow the table to it; the narrowing appears as a Scope chip.

Select a column header to sort. Search matches names and addresses in the current table.

Monitors

A monitor on a column is one monitor per contract in scope. Each contract gets its own monitor, named after the rule and the contract, and its own alert episodes. A contract that joins the group later gets the monitor as well.

Select Add monitor… from a tracked column’s header.

Field
ColumnThe tracked measure to judge.
falls below / rises aboveThe direction.
a value / another columnWhat it is compared with. Another column must be a tracked measure of the same unit.
ValueThe threshold, in the column’s unit.
Warning margin · %Optional. A warning opens when the value is within this percentage of the threshold, on the healthy side.

Add monitor · n contracts creates them. They appear in Monitoring with the group’s other monitors; stopping the column’s tracking deletes them.

Monitors on the columns of a table in the Tables section are described under Monitoring.

Built-in tables

Four tables exist without setup. Each is listed in the rail only when it has rows. Their rows are not selectable and carry no menus.

DeFi positions

Every DeFi position held by a contract in the workspace, one row per position. Narrow to a group’s contracts with the Holder column.

Column
HolderThe contract holding the position.
Protocol, Market, Chain
Supplied, Borrowed, NetUSD.
HealthThe position’s health factor, where the protocol has one. Rose below 1.1.

Users

Every wallet that signed a transaction reaching a contract in scope over a trailing window. The window is in the column label (Tx 30d).

Column
UserName, where known, and address.
Chain
Viadirect when the wallet called a contract in scope itself, otherwise the contract its transactions most often entered through.
ContractsContracts in scope the wallet reached.
Tx, Reverted, Reverted · countOver the window.
First seen, Last seen

Dependencies

Every contract that the contracts in scope call, over a trailing window.

Column
DependencyName, where known, and address.
Kindprice feed, token, protocol, wallet or contract.
Chain
Watchedyes when the dependency is itself a watched contract.
Used byContracts in scope that call it.
Calls, Reverted, Reverted · countOver the window.
Last call
FreshnessFor a price feed, time since its last answer.

Assets

Every token held by the contracts in scope, one row per token per chain.

Column
AssetThe token.
Chain
Held inContracts in scope holding it.
AmountIn the token’s units.
ValueUSD.
ShareOf the scope’s total value.
PriceUSD.

Tables

A table lists the items a protocol creates inside its contracts: withdrawal rounds in a market, loans in a pool, requests in a queue. Each row is one item, with the contract it lives in, when it opened and closed, and columns read per item.

A table is drawn from a group or from one contract. The page header names the source.

Add a table

Select Add + in the Tables section of the rail.

Field
NameWhat the rows are: Withdrawal rounds. The rail counts in this noun.
ContractsA group, or One contract… with a search by name or address.
Pick fromFor a group, the contract whose ABI the picker reads.
ItemsHow items are found: Announced by an event, Listed by a read or Counted and indexed. A choice is disabled when the ABI has nothing of that shape.
Id reads asFor a numeric id: a date (a unix time: an expiry, a due time) or a number. Chosen from the field’s name; override it. Addresses and 32-byte ids print shortened.

Announced by an event reads the contract’s whole history for the event.

Field
EventAn event with an id-shaped field (an integer, an address or bytes32).
Identified byThe field that is the item’s id.
Closes withAnother event carrying the same field, or Never · stays open.

Listed by a read reads a view function that returns the ids as an array (getUnpaidBatchExpiries() → uint32[]).

Field
ReadThe function.
ClosesWhen it leaves the list or Never.

Counted and indexed reads a count and an index function together (poolLength() and poolInfo(uint256)).

Field
CountThe function returning how many.
Index readThe function taking an index.
Id fieldWhich value of its return is the id, when it returns several.
ClosesWhen it leaves the list or Never.

Create table opens the table and reads its items. The rail shows the open count with … while history is still being read. The table is kept up to date automatically; Sync now reads it immediately.

Table rows

Column
ItemThe id, as a date, a number, a short address or a short hash.
ContractThe contract the item lives in.
Chain
StatusThe item’s state.
IdThe id as a column, for sorting, filtering and grouping.
Opened / First seenWhen the item was announced, or first listed.
Closed
AgeTime since opened, or until closed.
Since idFor a dated id, time since that date.

A table drawn from a group also carries the group’s attribute columns, so items group by the contract’s borrower or asset.

Closed items are listed for 30 days. A closed item keeps its last readings and is no longer tracked. Event tables sort by Opened; list tables sort by Id.

Columns on a table

Select + Column, then Add column…. A column on a table is read for every open item.

Field
Froma read or the item’s events.
Read onFor a read: each item’s contract, or another contract by address (a lens, a reader, a router that answers for every item).
FunctionOnly functions that take the item’s id are offered. Typed takes a signature with the id’s type (getItem(uint32)).
Other argumentsArguments besides the id.
FieldWhich value of the return.
EventFor an event column: an event carrying the item’s id.
Item id inThe field holding the id, when the event has several of that type.
FoldHow the item’s events combine: How many, Sum of, Latest, Earliest, Least, Most.
FieldThe event field folded, for every fold but How many.
Column, Reads as, Scale, Unit, TypeAs for a contract column.

Preview reads the function on the first open items listed in the dialog. An event column reads the item’s whole event history when added, so it is right from the first row.

Manage a table

The row menu (…) on a table in the rail:

Action
Sync nowRead the items again. The result reads 3 opened · 1 closed.
Delete table…Delete the table, its items, their tracked values and columns.

A table that fails to read shows failed in the rail; its row menu shows the reason.

The URL holds the whole view. Copy link copies it.

Parameter
tabThe table: contracts (default), positions, users, dependencies, assets, or table:<id>.
tagThe group. Absent is All contracts.
chainThe chain id. Absent is every chain.
groupThe column grouped by.
sortcolumn:asc or column:desc.
colsThe visible columns, comma separated. Absent is the table’s default set plus the group’s own columns.
fA filter, column~op~value, where op is gt, lt, is or isnot. Repeat for each filter. A trailing ~s marks a scope set from a group row.
/console?tag=Markets&chain=1&group=borrower&sort=held:desc&f=status~is~open&f=held~lt~1000000

A link to a group the workspace does not have opens All contracts.

Export writes the rows that pass the filters, with the visible columns, as CSV or JSON. The file is named after the group and the table.

Last updated on