Webhooks
Bridgfy uses webhooks to automatically detect deposits and trigger cross-chain transfers. As an integrator, you don’t need to implement webhooks - Bridgfy handles this automatically. This page explains how the webhook system works for informational purposes.How It Works
When a user sends funds to their deposit address:- Deposit occurs on the blockchain
- Blockchain monitoring service detects the transaction
- Webhook is sent to Bridgfy’s API
- Bridgfy processes the deposit automatically:
- Resolves the user’s Deposit Intent
- Requests routing quote
- Calculates fees
- Executes the cross-chain transfer
- Execution is created and tracked
Webhook Flow
Webhook Payload
For reference, here’s what a deposit detection webhook looks like:Alchemy ADDRESS_ACTIVITY Webhook
Endpoint:POST /api/webhooks/alchemy/address-activity
Headers:
network: Chain where deposit occurred (e.g., “BASE_MAINNET”, “ETH_MAINNET”)activity.toAddress: The deposit address (Modular Account)activity.rawContract.rawValue: Amount in atomic unitsactivity.rawContract.symbol: Token symbolactivity.rawContract.address: Token contract addressactivity.hash: Transaction hash
What Happens After Webhook
When Bridgfy receives a deposit webhook:1. Validation
- Verifies webhook signature
- Checks that the destination address is a known Modular Account
- Validates the transaction hasn’t been processed before (idempotency)
2. Intent Resolution
- Looks up the Deposit Intent for the user (based on deposit address)
- If no intent found, the deposit is held but not routed
- If intent found, proceeds to routing
3. Routing
- Queries cross-chain routing providers for the best route
- Applies routing policies (slippage, max hops, etc.)
- Verifies the route is viable
4. Fee Calculation
- Calculates protocol fee from deposit amount
- Estimates gas fee (if user pays gas)
- Verifies remaining amount is sufficient
5. Execution
- Creates an Execution record (status:
PENDING) - Submits the bridge transaction
- Updates status to
RUNNING - Tracks until completion (
SUCCESSorFAILED)
Timing
Typical timeline from deposit to execution:- User sends transaction: 0 seconds
- Transaction confirmed: 10-60 seconds (varies by chain)
- Webhook received: +1-5 seconds after confirmation
- Processing & routing: +5-15 seconds
- Bridge transaction submitted: +15-30 seconds from deposit
- Bridge completion: +1-10 minutes (varies by route)
Monitoring Deposits
As an integrator, you should not monitor for webhooks. Instead:Poll for Executions
After a user sends funds, poll the Executions API:Show Status to Users
Edge Cases
Deposit Without Intent
If a user sends funds to their deposit address before creating a Deposit Intent:- Funds are received by the Modular Account
- No execution is created (no routing configuration)
- Funds remain in the account
- When the user creates an intent later, a manual trigger may be needed
Multiple Deposits
If a user makes multiple deposits to the same address:- Each deposit triggers a separate webhook
- Each webhook creates a separate Execution
- All follow the same Deposit Intent configuration
- Executions are independent and tracked separately
Webhook Failures
If Bridgfy’s webhook endpoint is unavailable:- The monitoring service retries automatically
- Deposits are eventually detected and processed
- May cause delays in processing (minutes, not hours)
Duplicate Webhooks
The monitoring service may send the same webhook multiple times:- Bridgfy uses idempotency keys to prevent duplicate executions
- Only one Execution is created per deposit
- Safe to receive duplicate webhooks
Security
Webhook Validation
Bridgfy validates all incoming webhooks:- Signature verification: HMAC-SHA256 signature check
- Timestamp validation: Reject old webhooks (>5 min)
- Address verification: Confirm destination is a Modular Account
- Idempotency: Check for duplicate transaction hashes
What You Should Do
For security on your end:- Use HTTPS for all API calls
- Keep API keys secure (environment variables, secrets managers)
- Validate user inputs before creating Deposit Intents
- Poll, don’t push - Use the Executions API to check status
Debugging Deposits
If a user reports their deposit wasn’t processed:Check Transaction Confirmed
Verify the deposit transaction is confirmed on-chain:Check Deposit Address
Verify they sent to the correct address:Check for Execution
Look for an execution created after the deposit:Check Execution Status
If execution exists but failed:Best Practices
For Integrators
- Don’t implement webhooks - Bridgfy handles deposit detection
- Poll the Executions API - Check for new executions after users deposit
- Create intent before showing address - Ensure routing is configured
- Use simulation first - Verify routes work before users deposit
- Show clear instructions - Tell users exactly where to send funds
- Track execution status - Poll until terminal status reached
- Handle all error cases - Build UI for every execution status
For Users
Provide clear instructions:- Funds are automatically routed (no additional steps needed)
- Routing happens after blockchain confirmation
- Total time: typically 2-15 minutes
- Check execution status in the app
Next Steps
- Track transfers using Executions API
- Create routing configurations with Deposit Intents
- Handle errors using Error Codes reference