Integration Overview
1
Choose Your Integration Pattern
Select the integration pattern that fits your custody setup
2
Deploy the Agent
Run the RebelFi agent alongside your custody infrastructure
3
Configure Authentication
Set up API keys and custody credentials
4
Start Polling
Agent begins polling for operations and executing them
Supported Custody Solutions
- Agent Polling
- Direct API Integration
- Custom Integration
Works with any custody solution through agent-based polling.Two Options:
- RebelFi Managed Agent: We run the agent with your custody credentials
- Your Own Agent: You run a polling service that integrates with your custody
- Tatum KMS
- Fireblocks
- BitGo
- Privy
- Custom/home-grown custody solutions
Agent Architecture
How the Agent Works
Agent Responsibilities
- Poll for Transactions: Check RebelFi API every 10-30 seconds for pending transactions
- Lease Management: Claim transactions with a time-bound lease
- Sign Transactions: Use custody solution’s signing mechanism to sign transaction payloads
- Submit to Blockchain: Broadcast signed transactions to the blockchain network
- Report Status: Update RebelFi with transaction hash and execution status
- Error Handling: Retry logic for transient failures, report permanent errors
The agent pattern ensures you always maintain signing authority. Whether you run the agent yourself or use
RebelFi’s managed agent, only your custody solution can sign transactions.
RebelFi Managed Agent vs. Your Own Agent
- RebelFi Managed Agent
- Your Own Agent
Simplest Option: RebelFi runs the agent infrastructure for you.
- No deployment or maintenance required
- RebelFi manages polling, retries, and error handling
- You provide custody credentials securely
- Monitor activity via dashboard
- Automatic updates and scaling
Integration Patterns by Provider
Pattern 1: Tatum KMS
Tatum KMS stores private keys and provides transaction signing via API. Installation:.env):
- Agent polls
/api/agent/transactions/poll - Receives unsigned transaction payload
- Calls Tatum KMS to sign:
POST https://api.tatum.io/v3/kms/{id}/sign - Submits signed transaction to blockchain
- Reports transaction hash to RebelFi:
POST /api/agent/transactions/{id}/report
Complete Tatum Integration Example
Complete Tatum Integration Example
Pattern 2: Fireblocks (Agent Mode)
Use the RebelFi agent with Fireblocks’ signing infrastructure. Configuration (.env):
- Transaction Authorization Policy (TAP): Ensure your TAP allows RebelFi destination addresses
- Whitelisting: Add RebelFi protocol addresses to your whitelist
- Vault Accounts: Specify which vault account the agent should use
- API Co-Signer: Configure if using Fireblocks’ API co-signer feature
For streamlined Fireblocks workflows, consider Direct API Integration where RebelFi submits transactions directly to
Fireblocks using an API key.
Pattern 3: Privy
Privy provides embedded wallet infrastructure with custodial and non-custodial options. Configuration (.env):
- Agent uses Privy’s server-side SDK to sign transactions
- Works with both custodial wallets (Privy-managed keys) and delegated wallets
- Supports Privy’s MFA and policy requirements
Pattern 4: Custom Custody
Build a custom adapter for your in-house or specialized custody solution. Requirements:- Transaction Signing: Ability to sign raw blockchain transactions
- Programmatic Access: API or SDK for automated signing
- Reliable Execution: Can handle polling loop (every 10-30 seconds)
1
Extend Base Adapter
Create a custom adapter implementing the
CustodyAdapter interface:2
Implement Signing Logic
3
Configure Agent
4
Test & Deploy
Test on devnet/testnet before production deployment
Agent Configuration Reference
Environment Variables
| Variable | Required | Description |
|---|---|---|
REBELFI_BASE_URL | Yes | RebelFi API URL (https://api.rebelfi.io) |
REBELFI_API_KEY | Yes | Your RebelFi API key |
CUSTODY_PROVIDER | Yes | Custody provider: tatum, fireblocks, privy, custom |
POLL_INTERVAL_MS | No | Polling frequency (default: 10000ms) |
LEASE_DURATION_MS | No | Transaction lease duration (default: 30000ms) |
LOG_LEVEL | No | Logging level: debug, info, warn, error (default: info) |
MAX_RETRIES | No | Max retry attempts for failed transactions (default: 3) |
Provider-Specific Variables
Tatum:TATUM_API_KEY- Tatum API keyTATUM_TESTNET- Use testnet (default: false)
FIREBLOCKS_API_KEY- Fireblocks API keyFIREBLOCKS_SECRET_KEY_PATH- Path to Fireblocks secret key fileFIREBLOCKS_VAULT_ACCOUNT_ID- Vault account ID
PRIVY_APP_ID- Privy application IDPRIVY_APP_SECRET- Privy application secret
Agent Deployment
Development
For local development and testing:Production
Option 1: DockerMonitoring & Operations
Health Checks
The agent exposes a health endpoint:Logging
Agent logs include:- Poll attempts and responses
- Transaction claims and leases
- Signing operations
- Blockchain submissions
- Errors and retries
Metrics
Key metrics to monitor:- Poll Frequency: Successful polls per minute
- Transaction Throughput: Transactions executed per hour
- Error Rate: Failed transactions / total attempts
- Lease Expiry Rate: Transactions that expired before completion
Security Best Practices
API Key Management
API Key Management
- Store API keys in secure secrets management (AWS Secrets Manager, HashiCorp Vault)
- Rotate API keys periodically (recommended: every 90 days)
- Use different API keys for dev/staging/production
- Never log API keys in plain text
Network Security
Network Security
- Run agent in a private network segment
- Restrict outbound traffic to only RebelFi API and blockchain RPC endpoints
- Use TLS for all API communications
- Consider using a VPN or private link for additional security
Custody Credentials
Custody Credentials
- Store custody credentials (Fireblocks keys, etc.) encrypted at rest
- Use hardware security modules (HSM) where possible
- Implement least-privilege access for agent service accounts
- Audit all signing operations
High Availability
High Availability
- Run agent with automatic restart (Docker
--restart, systemd, K8s liveness probes) - Monitor agent health and alert on failures
- Consider running multiple agents with lease-based coordination (built-in)
- Implement dead letter queues for failed transactions
Troubleshooting
Agent not polling
Agent not polling
Symptoms: No logs showing poll attemptsCheck:
- Agent process is running
- Network connectivity to
api.rebelfi.io - API key is valid
- Environment variables are loaded
Transactions not executing
Transactions not executing
Symptoms: Transactions appear in queue but never executeCheck:
- Agent is successfully polling
- Custody provider credentials are valid
- Operation is not
PENDING_APPROVAL(approve it first) - Agent has access to custody signing APIs
Lease expiry issues
Lease expiry issues
Symptoms: Transactions repeatedly claimed but never completedCheck:
LEASE_DURATION_MSis sufficient for signing + submission- Network latency to custody provider
- Custody provider response times
LEASE_DURATION_MS to 60000ms (60 seconds) or higher for slow custody providers.