Filter Policy Configuration
Control which conditional orders are processed by the Watch Tower.
The filter policy allows you to manage which conditional orders are processed, ignored, or dropped by the Watch Tower. Each network has its own filter policy configuration.
Filter policy structure
The filter policy is configured within each network’s configuration:
{
"networks": [
{
"name": "mainnet",
"rpc": "https://mainnet.infura.io/v3/YOUR_API_KEY",
"deploymentBlock": 17883049,
"filterPolicy": {
"defaultAction": "ACCEPT",
"conditionalOrderIds": {},
"transactions": {},
"handlers": {},
"owners": {}
}
}
]
}
Filter actions
Three actions are available for filtering:
- ACCEPT - Process the conditional order normally
- DROP - Ignore the conditional order completely
- SKIP - Skip processing this time, but may process in the future
Default action
The defaultAction field defines the behavior when no specific filter rules match.
"filterPolicy": {
"defaultAction": "ACCEPT"
}
"filterPolicy": {
"defaultAction": "DROP"
}
Most configurations should use "defaultAction": "ACCEPT" and explicitly drop unwanted orders.
Filtering by conditional order IDs
Filter specific conditional orders by their ID (hash):
"filterPolicy": {
"defaultAction": "ACCEPT",
"conditionalOrderIds": {
"0x5b3cdb6ffa3c95507cbfc459162609007865c2e87340312d3cd469c4ffbfae81": "DROP"
}
}
This drops the specific conditional order with the given ID while accepting all others.
Filtering by transactions
Filter conditional orders created in specific transactions:
"filterPolicy": {
"defaultAction": "ACCEPT",
"transactions": {
"0x33ef06af308d1e4f94dd61fa8df43fe52b67e8a485f4e4fff75235080e663bfa": "DROP"
}
}
All conditional orders created in the specified transaction will be dropped.
Filtering by handlers
Filter conditional orders by their handler contract address:
"filterPolicy": {
"defaultAction": "ACCEPT",
"handlers": {
"0xd3338f21c89745e46af56aeaf553cf96ba9bc66f": "DROP"
}
}
Handler filtering is useful for disabling specific order types or problematic implementations.
Filtering by owners
Filter conditional orders by the owner (Safe) address:
"filterPolicy": {
"defaultAction": "ACCEPT",
"owners": {
"0xd3338f21c89745e46af56aeaf553cf96ba9bc66f": "DROP"
}
}
All conditional orders from the specified owner address will be dropped.
Filter evaluation order
When a conditional order is evaluated, the watch-tower checks filters in this order:
- Conditional order ID - Most specific
- Transaction hash
- Owner address
- Handler address
- Default action - Fallback if no rules match
The first matching rule determines the action taken.
Complete example
"filterPolicy": {
"defaultAction": "ACCEPT",
"conditionalOrderIds": {
"0x5b3cdb6ffa3c95507cbfc459162609007865c2e87340312d3cd469c4ffbfae81": "DROP"
},
"transactions": {
"0x33ef06af308d1e4f94dd61fa8df43fe52b67e8a485f4e4fff75235080e663bfa": "DROP"
},
"handlers": {
"0xd3338f21c89745e46af56aeaf553cf96ba9bc66f": "DROP"
},
"owners": {
"0xd3338f21c89745e46af56aeaf553cf96ba9bc66f": "DROP"
}
}
Allowlist mode
"filterPolicy": {
"defaultAction": "DROP",
"owners": {
"0x1234567890123456789012345678901234567890": "ACCEPT",
"0x0987654321098765432109876543210987654321": "ACCEPT"
}
}
Accept all
"filterPolicy": {
"defaultAction": "ACCEPT"
}
Multi-network example
Different networks can have different filter policies:
{
"networks": [
{
"name": "mainnet",
"rpc": "https://mainnet.infura.io/v3/YOUR_API_KEY",
"deploymentBlock": 17883049,
"filterPolicy": {
"defaultAction": "ACCEPT",
"handlers": {
"0xd3338f21c89745e46af56aeaf553cf96ba9bc66f": "DROP"
}
}
},
{
"name": "sepolia",
"rpc": "https://sepolia.drpc.org",
"deploymentBlock": 8468184,
"filterPolicy": {
"defaultAction": "ACCEPT"
}
}
]
}