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.
| Part | Defines | Example |
|---|---|---|
| Source | Which contracts the table reads. | A group of 87 lending markets. |
| Rows | How each item is found. | Every withdrawal round across those markets. |
| State | Where each item is in its lifecycle. | Queued, Expired, Paid. |
| Fields | The values shown for each item. | Requested, Paid, Outstanding. |
| Monitoring | What 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.
| Method | Finds items by | Example |
|---|---|---|
| Event | An event that announces each item. | Each round from a WithdrawalQueued event. |
| List | A view function that returns the current items. | getUnpaidBatchExpiries() returns the open rounds. |
| Indexed | A 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 | |
|---|---|
| Queued | Requested, not yet processed. |
| Waiting | In its waiting period. |
| Expired | Past its expiry, not yet paid. |
| Ready to pay | Funds available. |
| Paid | Paid in full. |
| Finished | Closed out. |
Each state has a trigger that moves an item into it.
| Trigger | Example |
|---|---|
| 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.
| Kind | Value | Example |
|---|---|---|
| Read | A view function called for each item. | getWithdrawalBatch(id) → amount paid. |
| Event | Events for each item, combined: a count, sum, latest, earliest, minimum or maximum. | Sum of amount over the round’s WithdrawalQueued events. |
| Calculated | A 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.
| Type | Alerts when | Example |
|---|---|---|
| Value | A field crosses a threshold. | A withdrawal has more than $100k outstanding. |
| State | An item enters a state. | A withdrawal enters Expired. |
| Duration | An 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 | |
|---|---|
| Tag | The group’s name. |
| Contracts | How 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 | |
|---|---|
| Chain | The registry’s chain. |
| Registry | The registry’s address. |
| List read | The function that returns the list, as a signature: getRegisteredMarkets(). |
A factory announces them watches every address one event on one contract carries.
| Field | |
|---|---|
| Chain | The factory’s chain. |
| Factory | The factory’s address. |
| Event | The event’s signature, or its topic hash. |
| Address in | Where 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 now | Run 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 | |
|---|---|
| Contract | Name and address. |
| Chain | |
| Type | The contract’s detected type. |
| Held | Value held by the contract, USD. |
| Tx 24h | State-changing transactions in the last 24 hours. |
| Reverted | Share of those that reverted. |
| Reverted · count | |
| Activity | Transactions per hour over the last 24 hours. |
| Tags | The 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 | |
|---|---|
| Measure | A 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. |
| Attribute | A 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 from | The contract whose ABI the picker reads. The column applies to every contract in scope. |
| Function | From 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. |
| Read | The function. |
| Arguments | The function’s arguments, comma separated, when it takes any. |
| Field | For a function returning several values or a struct, which one. |
| Column | The column’s label. Filled from the function or field name; edit it. |
| Reads as | a measure or an attribute. Functions returning an address, a flag or a string switch to attribute. |
| Scale | For a measure: each row’s decimals() reads the scale from each contract, one for all uses one number of decimals. |
| Unit | For a measure: Asset units, Dollars, Count, Percent, Seconds or Rate · %. Decides how the value prints and which filters and monitors it takes. |
| Type | For 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 high | A 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 column | Takes 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, group, sort and search
Filter
Select + Filter, or Filter on … from a column header.
| Field | |
|---|---|
| Column | Any column except Activity. |
| Is | above or below for numbers; is or is not for text, chain and protocol columns. |
| Value | A 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.
Sort and search
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 | |
|---|---|
| Column | The tracked measure to judge. |
| falls below / rises above | The direction. |
| a value / another column | What it is compared with. Another column must be a tracked measure of the same unit. |
| Value | The 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 | |
|---|---|
| Holder | The contract holding the position. |
| Protocol, Market, Chain | |
| Supplied, Borrowed, Net | USD. |
| Health | The 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 | |
|---|---|
| User | Name, where known, and address. |
| Chain | |
| Via | direct when the wallet called a contract in scope itself, otherwise the contract its transactions most often entered through. |
| Contracts | Contracts in scope the wallet reached. |
| Tx, Reverted, Reverted · count | Over the window. |
| First seen, Last seen |
Dependencies
Every contract that the contracts in scope call, over a trailing window.
| Column | |
|---|---|
| Dependency | Name, where known, and address. |
| Kind | price feed, token, protocol, wallet or contract. |
| Chain | |
| Watched | yes when the dependency is itself a watched contract. |
| Used by | Contracts in scope that call it. |
| Calls, Reverted, Reverted · count | Over the window. |
| Last call | |
| Freshness | For a price feed, time since its last answer. |
Assets
Every token held by the contracts in scope, one row per token per chain.
| Column | |
|---|---|
| Asset | The token. |
| Chain | |
| Held in | Contracts in scope holding it. |
| Amount | In the token’s units. |
| Value | USD. |
| Share | Of the scope’s total value. |
| Price | USD. |
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 | |
|---|---|
| Name | What the rows are: Withdrawal rounds. The rail counts in this noun. |
| Contracts | A group, or One contract… with a search by name or address. |
| Pick from | For a group, the contract whose ABI the picker reads. |
| Items | How 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 as | For 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 | |
|---|---|
| Event | An event with an id-shaped field (an integer, an address or bytes32). |
| Identified by | The field that is the item’s id. |
| Closes with | Another 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 | |
|---|---|
| Read | The function. |
| Closes | When it leaves the list or Never. |
Counted and indexed reads a count and an index function together (poolLength() and poolInfo(uint256)).
| Field | |
|---|---|
| Count | The function returning how many. |
| Index read | The function taking an index. |
| Id field | Which value of its return is the id, when it returns several. |
| Closes | When 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 | |
|---|---|
| Item | The id, as a date, a number, a short address or a short hash. |
| Contract | The contract the item lives in. |
| Chain | |
| Status | The item’s state. |
| Id | The id as a column, for sorting, filtering and grouping. |
| Opened / First seen | When the item was announced, or first listed. |
| Closed | |
| Age | Time since opened, or until closed. |
| Since id | For 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 | |
|---|---|
| From | a read or the item’s events. |
| Read on | For a read: each item’s contract, or another contract by address (a lens, a reader, a router that answers for every item). |
| Function | Only functions that take the item’s id are offered. Typed takes a signature with the id’s type (getItem(uint32)). |
| Other arguments | Arguments besides the id. |
| Field | Which value of the return. |
| Event | For an event column: an event carrying the item’s id. |
| Item id in | The field holding the id, when the event has several of that type. |
| Fold | How the item’s events combine: How many, Sum of, Latest, Earliest, Least, Most. |
| Field | The event field folded, for every fold but How many. |
| Column, Reads as, Scale, Unit, Type | As 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 now | Read 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.
Link and export
The URL holds the whole view. Copy link copies it.
| Parameter | |
|---|---|
tab | The table: contracts (default), positions, users, dependencies, assets, or table:<id>. |
tag | The group. Absent is All contracts. |
chain | The chain id. Absent is every chain. |
group | The column grouped by. |
sort | column:asc or column:desc. |
cols | The visible columns, comma separated. Absent is the table’s default set plus the group’s own columns. |
f | A 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~1000000A 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.