Skip to content

Contracts Module

The Contracts module contains approximately 44 models that provide protocol-specific decoded event and function call data. Unlike the Execution module which handles raw EVM data, the Contracts module uses ABI decoding to transform opaque log topics and calldata into human-readable, typed columns for specific protocols deployed on Gnosis Chain.

Data Sources

The Contracts module draws from two sources:

  1. execution database -- Raw logs and traces containing encoded event/function data
  2. contracts_whitelist / contracts_abi -- ABI registry that maps contract addresses to their interface definitions, enabling automatic decoding

The ABI decoding system matches log topics and function selectors against known ABIs to produce decoded columns with meaningful names (e.g., sender, amount, pool_id) rather than raw hex data.

ABI Decoding System

The decoding pipeline works as follows:

  1. Contracts are registered in a whitelist with their addresses, names, and protocol tags
  2. ABI JSON is stored and indexed by contract address
  3. During dbt model execution, logs and traces are joined with ABI data
  4. Event topics and function selectors are matched to decode parameters into typed columns

This approach avoids the need to write custom parsers for each contract -- any contract with a registered ABI is automatically decoded.

Raw Logs (execution.logs)
    |
    +-- JOIN contracts_whitelist (by address)
    +-- JOIN contracts_abi (by address + event signature)
    |
    v
Decoded Events (typed columns: sender, amount, pool_id, ...)
    |
    v
Protocol-Specific Models (int_contracts_balancer_swaps_daily, etc.)

Model Categories

Atoken

Model Layer Description
contracts_aaveV3_AToken_events CONTRACTS Decoded event logs from Aave V3 aToken contracts on Gnosis (aGnoGNO, aGnoWXDAI, aGnosDAI, aGnoUSDC, aGnoEURe, aGnoUSD...
contracts_spark_AToken_events CONTRACTS Decoded event logs from SparkLend aToken contracts on Gnosis (spGNO, spWETH, spwstETH, spWXDAI, spsDAI, spUSDC, spUSD...

Cowswapethflow

Model Layer Description
contracts_CowProtocol_CoWSwapEthFlow_events CONTRACTS --

Factory

Model Layer Description
contracts_UniswapV3_Factory_events CONTRACTS --

Gpv2Allowlistauthentication

Model Layer Description
contracts_CowProtocol_GPv2AllowListAuthentication_events CONTRACTS Proxy contract — implementation ABI (GPv2AllowListAuthentication) was
fetched and stored under the proxy address by f...

Gpv2Settlement

Model Layer Description
contracts_CowProtocol_GPv2Settlement_events CONTRACTS --

Gpv2Vaultrelayer

Model Layer Description
contracts_CowProtocol_GPv2VaultRelayer_events CONTRACTS --

Lendingpool

Model Layer Description
contracts_agave_LendingPool_events CONTRACTS The contracts_agave_LendingPool_events model captures and processes event logs from Agave Protocol's LendingPool co...

Marketfactory

Model Layer Description
contracts_Seer_MarketFactory_calls CONTRACTS The 'contracts_Seer_MarketFactory_calls' model captures and processes call data related to the Seer MarketFactory con...
contracts_Seer_MarketFactory_events CONTRACTS The contracts_Seer_MarketFactory_events model captures and stores event logs related to the Seer MarketFactory cont...

Pool

Model Layer Description
contracts_UniswapV3_Pool_events CONTRACTS Pool addresses are dynamically selected from contracts_whitelist seed
based on whitelisted tokens (both token0 and to...
contracts_spark_Pool_events CONTRACTS The contracts_spark_Pool_events model captures and processes event logs from Spark Protocol's Pool contract, enabli...

Poolconfigurator

Model Layer Description
contracts_aaveV3_PoolConfigurator_events CONTRACTS The contracts_aaveV3_PoolConfigurator_events model captures and processes event logs related to the Aave V3 Pool Co...
contracts_spark_PoolConfigurator_events CONTRACTS The contracts_spark_PoolConfigurator_events model captures event logs from SparkLend's PoolConfigurator contract on...

Poolinstance

Model Layer Description
contracts_aaveV3_PoolInstance_events CONTRACTS The contracts_aaveV3_PoolInstance_events model captures and processes event logs related to Aave V3 pool instances,...

Tslax

Model Layer Description
contracts_backedfi_TSLAx_Oracle_events CONTRACTS The contracts_backedfi_TSLAx_Oracle_events model captures and processes blockchain event logs related to the TSLAx ...

Vault

Model Layer Description
contracts_BalancerV2_Vault_events CONTRACTS --
contracts_BalancerV3_Vault_events CONTRACTS --

Wrapped1155Factory

Model Layer Description
contracts_Seer_Wrapped1155Factory_calls CONTRACTS The contracts_Seer_Wrapped1155Factory_calls model captures and decodes call data related to the Wrapped1155Factory ...
contracts_Seer_Wrapped1155Factory_events CONTRACTS The contracts_Seer_Wrapped1155Factory_events model captures and processes event logs related to the Wrapped1155Fact...

Bc3M

Model Layer Description
contracts_backedfi_bC3M_Oracle_events CONTRACTS This model captures and processes blockchain event logs related to the BackedFi contracts from the Oracle source, ena...

Bcoin

Model Layer Description
contracts_backedfi_bCOIN_Oracle_events CONTRACTS This model captures and stores Oracle event logs related to the BackedFi platform, enabling analysis of contract inte...

Bcspx

Model Layer Description
contracts_backedfi_bCSPX_Oracle_events CONTRACTS The contracts_backedfi_bCSPX_Oracle_events model captures and processes blockchain event logs related to the Backed...

Bhigh

Model Layer Description
contracts_backedfi_bHIGH_Oracle_events CONTRACTS The contracts_backedfi_bHIGH_Oracle_events model captures and processes blockchain event logs related to the Backed...

Bib01

Model Layer Description
contracts_backedfi_bIB01_Oracle_events CONTRACTS The contracts_backedfi_bIB01_Oracle_events model captures and processes blockchain event logs related to the Backed...

Bibta

Model Layer Description
contracts_backedfi_bIBTA_Oracle_events CONTRACTS The contracts_backedfi_bIBTA_Oracle_events model captures and processes blockchain event logs related to the Backed...

Bmstr

Model Layer Description
contracts_backedfi_bMSTR_Oracle_events CONTRACTS The contracts_backedfi_bMSTR_Oracle_events model captures and processes blockchain event logs related to BackedFi's...

Bnvda

Model Layer Description
contracts_backedfi_bNVDA_Oracle_events CONTRACTS This model captures and processes Oracle event logs related to the BackedFi protocol, enabling analysis of contract i...

Calls

Model Layer Description
contracts_AgentResultMapping_calls CONTRACTS The contracts_AgentResultMapping_calls model captures and decodes call interactions related to a specific smart con...
contracts_ConditionalTokens_calls CONTRACTS The contracts_ConditionalTokens_calls model captures and decodes call transactions related to a specific Conditiona...
contracts_FPMMDeterministicFactory_calls CONTRACTS The contracts_FPMMDeterministicFactory_calls model captures and decodes call data related to a specific smart contr...
contracts_GBCDeposit_calls CONTRACTS The contracts_GBCDeposit_calls model captures and decodes call data related to GBCDeposit contract interactions, fa...
contracts_OmenAgentResultMapping_calls CONTRACTS The contracts_OmenAgentResultMapping_calls model captures and processes call data related to the Omen Agent contrac...
contracts_wxdai_calls CONTRACTS The contracts_wxdai_calls model captures and decodes call interactions with the specified wxDai contract, providing...

Events

Model Layer Description
contracts_AgentResultMapping_events CONTRACTS The contracts_AgentResultMapping_events model captures and processes blockchain event logs related to agent result ma...
contracts_ConditionalTokens_events CONTRACTS The contracts_ConditionalTokens_events model captures and stores event logs related to Conditional Tokens contracts...
contracts_FPMMDeterministicFactory_events CONTRACTS The contracts_FPMMDeterministicFactory_events model captures and processes event logs related to FPMM deterministic f...
contracts_GBCDeposit_events CONTRACTS The contracts_GBCDeposit_events model captures and processes deposit event logs related to the GBC Deposit contract, ...
contracts_OmenAgentResultMapping_events CONTRACTS The contracts_OmenAgentResultMapping_events model captures and processes event logs related to Omen Agent Result Ma...
contracts_sdai_events CONTRACTS The contracts_sdai_events model captures and processes event logs related to the specified smart contract, enabling...
contracts_wxdai_events CONTRACTS The contracts_wxdai_events model captures and processes event logs related to the specified contract address, enabl...

Registry

Model Layer Description
contracts_circles_registry CONTRACTS Registry of all Circles protocol contracts. Unions the static
contracts_circles_registry_static seed (lower-cased add...

V1

Model Layer Description
contracts_circles_v1_Hub_calls CONTRACTS Decoded function calls for the Circles v1 Hub contract.
contracts_circles_v1_Hub_events CONTRACTS Decoded event logs for the Circles v1 Hub contract.

V2

Model Layer Description
contracts_Realitio_v2_1_calls CONTRACTS The contracts_Realitio_v2_1_calls model captures and processes call interactions from the Realitio v2.1 smart contrac...
contracts_Realitio_v2_1_events CONTRACTS The contracts_Realitio_v2_1_events model captures and processes event logs related to Realitio V2.1 contract intera...
contracts_circles_v2_AffiliateGroupRegistry_calls CONTRACTS Decoded function calls for the Circles v2 AffiliateGroupRegistry contract.
contracts_circles_v2_AffiliateGroupRegistry_events CONTRACTS Decoded event logs for the Circles v2 AffiliateGroupRegistry contract.
contracts_circles_v2_BaseGroupFactory_calls CONTRACTS Decoded function calls for the Circles v2 BaseGroupFactory contract.
contracts_circles_v2_BaseGroupFactory_events CONTRACTS Decoded event logs for the Circles v2 BaseGroupFactory contract.
contracts_circles_v2_BaseGroupMintRouter_calls CONTRACTS Decoded function calls for the Circles v2 BaseGroupMintRouter contract.
contracts_circles_v2_BaseGroup_events CONTRACTS Decoded event logs for dynamically discovered Circles v2 BaseGroup runtime contracts.
contracts_circles_v2_BaseMintPolicy_calls CONTRACTS Decoded function calls for the Circles v2 BaseMintPolicy contract.
contracts_circles_v2_CMGroupDeployer_calls CONTRACTS Decoded function calls for the Circles v2 CMGroupDeployer contract.
contracts_circles_v2_CMGroupDeployer_events CONTRACTS Decoded event logs for the Circles v2 CMGroupDeployer contract.
contracts_circles_v2_CirclesBackingCondition_calls CONTRACTS Decoded function calls for the Circles v2 CirclesBackingCondition contract.
contracts_circles_v2_CirclesBackingFactory_calls CONTRACTS Decoded function calls for the Circles v2 CirclesBackingFactory contract.
contracts_circles_v2_CirclesBackingFactory_events CONTRACTS Decoded event logs for the Circles v2 CirclesBackingFactory contract.
contracts_circles_v2_ERC20Lift_calls CONTRACTS Decoded function calls for the Circles v2 ERC20Lift contract.
contracts_circles_v2_ERC20Lift_events CONTRACTS Decoded event logs for the Circles v2 ERC20Lift contract (wrapper factory).
contracts_circles_v2_ERC20TokenOfferCycle_calls CONTRACTS Decoded function calls for the Circles v2 ERC20TokenOfferCycle contracts (v1, v2, v3).
contracts_circles_v2_ERC20TokenOfferCycle_events CONTRACTS Decoded event logs for the Circles v2 ERC20TokenOfferCycle contracts (v1, v2, v3).
contracts_circles_v2_ERC20TokenOfferFactory_calls CONTRACTS Decoded function calls for the Circles v2 ERC20TokenOfferFactory contract.
contracts_circles_v2_ERC20TokenOfferFactory_events CONTRACTS Decoded event logs for the Circles v2 ERC20TokenOfferFactory contract.
contracts_circles_v2_ERC20TokenOffer_calls CONTRACTS Decoded function calls for dynamically discovered Circles v2 ERC20TokenOffer runtime contracts.
contracts_circles_v2_ERC20TokenOffer_events CONTRACTS Decoded event logs for dynamically discovered Circles v2 ERC20TokenOffer runtime contracts.
contracts_circles_v2_GroupLBPFactory_calls CONTRACTS Decoded function calls for the Circles v2 GroupLBPFactory contracts (old and new).
contracts_circles_v2_GroupLBPFactory_events CONTRACTS Decoded event logs for the Circles v2 GroupLBPFactory contracts (old and new).
contracts_circles_v2_Hub_calls CONTRACTS Decoded function calls for the Circles v2 Hub contract.
contracts_circles_v2_Hub_events CONTRACTS Decoded event logs for the Circles v2 Hub contract.
contracts_circles_v2_InvitationEscrow_calls CONTRACTS Decoded function calls for the Circles v2 InvitationEscrow contract.
contracts_circles_v2_InvitationEscrow_events CONTRACTS Decoded event logs for the Circles v2 InvitationEscrow contract.
contracts_circles_v2_InvitationFarm_calls CONTRACTS Decoded function calls for the Circles v2 InvitationFarm contract.
contracts_circles_v2_InvitationFarm_events CONTRACTS Decoded event logs for the Circles v2 InvitationFarm contract.
contracts_circles_v2_InvitationModule_calls CONTRACTS Decoded function calls for the Circles v2 InvitationModule contract.
contracts_circles_v2_InvitationModule_events CONTRACTS Decoded event logs for the Circles v2 InvitationModule contract.
contracts_circles_v2_InvitationQuotaGrantModule_calls CONTRACTS Decoded function calls for the Circles v2 InvitationQuotaGrantModule contract.
contracts_circles_v2_InvitationQuotaGrantModule_events CONTRACTS Decoded event logs for the Circles v2 InvitationQuotaGrantModule contract.
contracts_circles_v2_NameRegistry_calls CONTRACTS Decoded function calls for the Circles v2 NameRegistry contract.
contracts_circles_v2_NameRegistry_events CONTRACTS Decoded event logs for the Circles v2 NameRegistry contract.
contracts_circles_v2_PaymentGatewayFactory_calls CONTRACTS Decoded function calls for the Circles v2 PaymentGatewayFactory
contract. This model is decoded from `execution.trace...
contracts_circles_v2_PaymentGatewayFactory_events CONTRACTS Decoded event logs for the Circles v2 PaymentGatewayFactory contract.
contracts_circles_v2_PaymentGateway_calls CONTRACTS Decoded function calls for dynamically discovered Circles v2 PaymentGateway runtime contracts.
contracts_circles_v2_PaymentGateway_events CONTRACTS Decoded event logs for dynamically discovered Circles v2 PaymentGateway runtime contracts.
contracts_circles_v2_ReferralsModule_calls CONTRACTS Decoded function calls for the Circles v2 ReferralsModule contract.
contracts_circles_v2_ReferralsModule_events CONTRACTS Decoded event logs for the Circles v2 ReferralsModule contract.
contracts_circles_v2_StandardTreasury_calls CONTRACTS Decoded function calls for the Circles v2 StandardTreasury contract.
contracts_circles_v2_StandardTreasury_events CONTRACTS Decoded event logs for the Circles v2 StandardTreasury contract.

V3

Model Layer Description
contracts_Swapr_v3_AlgebraFactory_calls CONTRACTS The contracts_Swapr_v3_AlgebraFactory_calls model captures and decodes call data related to the Swapr v3 AlgebraFac...
contracts_Swapr_v3_AlgebraFactory_events CONTRACTS The contracts_Swapr_v3_AlgebraFactory_events model captures and processes event logs related to the Swapr v3 Algebr...
contracts_Swapr_v3_AlgebraPool_calls CONTRACTS The contracts_Swapr_v3_AlgebraPool_calls model captures and processes call interactions related to the Swapr v3 Alg...
contracts_Swapr_v3_AlgebraPool_events CONTRACTS The contracts_Swapr_v3_AlgebraPool_events model captures and processes event logs related to Swapr's Algebra Pool s...

Covered Protocols

The following protocols have dedicated decoded models:

DEX Protocols

Protocol Type Key Events Key Contracts
Balancer Batch swap DEX Swap, Join, Exit, FlashLoan Vault (0xBA12...), WeightedPool, StablePool
CoW Protocol Batch auction DEX Trade, Settlement, Interaction Settlement contract, GPv2AllowanceManager
SushiSwap AMM DEX Swap, Mint, Burn, Sync SushiSwap Router, Factory, Pair contracts
Curve Stableswap DEX TokenExchange, AddLiquidity, RemoveLiquidity StableSwap pools, CryptoSwap pools
Uniswap Concentrated liquidity DEX Swap, Mint, Burn, Collect UniswapV3Factory, UniswapV3Pool

Lending Protocols

Protocol Type Key Events Key Contracts
Aave / Agave Lending pool Supply, Borrow, Repay, Liquidation, FlashLoan LendingPool, aTokens, VariableDebtToken
Spark Lending pool (MakerDAO) Supply, Borrow, Repay, Liquidation SparkLend Pool, spTokens

Other Protocols

Protocol Type Key Events Key Contracts
Circles UBI / Social currency Trust, Transfer, Signup, OrganizationSignup Hub, Token contracts
Gnosis Pay Payments Card transactions, settlements Payment processor contracts
Gnosis Safe Multisig wallet ExecTransaction, AddOwner, RemoveOwner, EnableModule Safe proxy, SafeModuleTransaction

Adding New Protocols

To add decoded event data for a new protocol, register its contract addresses in the whitelist and upload the ABI JSON. The decoding pipeline will automatically produce typed columns for all matching events. See the Contract ABI Decoding guide for details.

Using search_models_by_address

The MCP server provides a dedicated tool to find dbt models related to a specific contract address:

search_models_by_address("0xba12222222228d8ba445958a75a0704d566bf2c8")

This searches the contracts whitelist, ABI registry, and model SQL to find all models that reference the given address. It is the fastest way to discover what decoded data is available for a specific contract.

Key Models Reference

Model Description Key Columns
api_contracts_protocol_activity_daily Cross-protocol daily activity dt, protocol, event_count, unique_users
api_contracts_events_daily Decoded event volume dt, protocol, event_name, count
int_contracts_balancer_swaps_daily Balancer swap data dt, pool_name, swap_count, volume_usd
int_contracts_cow_settlements_daily CoW Protocol batches dt, settlement_count, trade_count, volume_usd
int_contracts_aave_events_daily Aave/Agave lending dt, event_type, asset, amount_usd

Query Examples

Get daily Balancer swap volume:

SELECT dt, pool_name, swap_count, volume_usd
FROM dbt.int_contracts_balancer_swaps_daily
WHERE dt >= today() - 7
ORDER BY dt, volume_usd DESC

Check Circles protocol growth:

SELECT dt, new_signups, total_users
FROM dbt.int_contracts_circles_signups_daily
WHERE dt >= today() - 30
ORDER BY dt

Compare DEX volume across protocols:

SELECT
    protocol,
    sum(volume_usd) AS total_volume,
    sum(swap_count) AS total_swaps
FROM dbt.api_contracts_protocol_activity_daily
WHERE dt >= today() - 30
  AND protocol IN ('Balancer', 'CoW Protocol', 'SushiSwap', 'Curve', 'Uniswap')
GROUP BY protocol
ORDER BY total_volume DESC

Track Gnosis Safe module transactions:

SELECT dt, module_type, tx_count
FROM dbt.int_contracts_safe_module_txs_daily
WHERE dt >= today() - 30
ORDER BY dt
  • Execution -- Raw logs and traces that serve as input to ABI decoding
  • Bridges -- Bridge contracts are a subset of decoded contract data
  • Crawlers -- Dune labels provide additional contract name resolution