Skip to content

Solana: Add Account and Fee Payer Filtering #413

@antoineborg

Description

@antoineborg

Solana: Add Account and Fee Payer Filtering

Description

The Solana filter matches transactions by program IDs (required for the RPC method), then applies additional filtering via log/event matching. However, it lacks the ability to filter by accounts involved in the transaction or the fee payer.

Problems

  1. No fee payer filtering - Cannot filter transactions by who paid for them
  2. No account filtering - Cannot filter by specific accounts involved (signers, token accounts, etc.)
  3. Limited expression parameters - Only signature, slot, fee, is_success are available; no account-related fields

This limits monitoring use cases such as:

  • Monitoring program interactions only when initiated by a specific wallet
  • Filtering transactions where a particular account is the fee payer
  • Matching only when specific token accounts are involved

Proposed Solution

  1. Extend build_transaction_params() in filter.rs:169-199 to include:

    • fee_payer - First account in account_keys (Solana convention)
    • accounts - All accounts involved in the transaction
  2. Add account-based filtering as an alternative to log-based filtering (program ID matching remains required)

  3. Example expressions to support:

    fee_payer == "WaLLeT123..."
    accounts contains "TokenAccount456..."
    

Trade-offs to Consider

  • Performance: Checking all accounts increases matching complexity vs program-ID-only filtering
  • Configuration complexity: Need to decide if accounts filter in addresses array or via expressions only
  • Consistency with EVM: EVM uses from/to which maps cleanly to sender/recipient; Solana has N accounts per transaction with different roles

Related Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-clientsIssues related to blockchain clients (e.g., EVMClient, StellarClient)D-mediumIntermediate-level tasksP-mediumImportant but not urgentT-taskGeneral tasks or chores (e.g., refactoring, cleanup)cla: allowlistgood-first-issueBeginner-friendly, low-complexity issues to help new contributorshelp-wantedIssues where community contributions are welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions