Skip to main content

Custody Integration

RebelFi is non-custodial — we never hold your keys or funds. Instead, we integrate with your existing custody solution through a Custody Adapter.

How It Works

Custody integration flow: RebelFi API, Agent, Custody Solution, Blockchain
  1. RebelFi generates operations — supply, unwind, rebalance
  2. The Agent polls for pending transactions — a lightweight service you deploy
  3. The Custody Adapter signs transactions — interfaces with your custody provider (Fireblocks, Anchorage, etc.)
  4. Transactions are submitted on-chain — either by the adapter or returned to RebelFi

The Agent

The Agent is a service that runs in your infrastructure and handles communication between RebelFi and your custody solution. What it does:
  • Polls RebelFi for pending transactions and actions
  • Passes signing requests to your Custody Adapter
  • Reports results back to RebelFi

Agent API Endpoints

MethodEndpointDescription
POST/api/agent/transactions/pollPoll for pending transactions to sign
POST/api/agent/transactions/reportReport transaction execution result
POST/api/agent/actions/pollPoll for pending custody actions
POST/api/agent/actions/reportReport action outcome

Agent Polling Flow

// Basic polling loop
async function pollAndExecute() {
  const response = await fetch('https://midas.rebelfi.io/api/agent/transactions/poll', {
    method: 'POST',
    headers: {
      'x-api-key': process.env.REBELFI_API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ leaseDurationMs: 30000 })
  });

  const { data } = await response.json();

  if (data.transaction) {
    // Sign with your custody solution
    const signedTx = await custodySolution.sign(data.transaction.unsignedTx);

    // Submit to blockchain
    const txHash = await blockchain.submit(signedTx);

    // Report back to RebelFi
    await fetch(`https://midas.rebelfi.io/api/agent/transactions/${data.transaction.id}/report`, {
      method: 'POST',
      headers: {
        'x-api-key': process.env.REBELFI_API_KEY,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({ status: 'SUBMITTED', txHash })
    });
  }
}

// Poll every 10-30 seconds
setInterval(pollAndExecute, 10000);

Custody Adapters

A Custody Adapter is the integration layer between the Agent and your specific custody provider. We build adapters for you. Tell us which custody provider you use, and we’ll create the adapter as part of your onboarding.

Supported Providers

Contact us to discuss integration with:
  • Fireblocks
  • BitGo
  • Anchorage
  • Copper
  • Tatum
  • Privy
  • Custom/in-house custody

Integration Options

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
Best for: Teams who want to focus on business logic, not infrastructure management

Comparison Table

FeatureRebelFi Managed AgentYour Own Agent
InfrastructureRebelFi hostsYou host
Setup Time5 minutes1-2 days
Custody IntegrationProvide credentialsBuild adapter
MonitoringRebelFi dashboardYour systems
CustomizationLimitedFull control
UpdatesAutomaticYou manage

Security Model

Agent Security

  • Store API keys in secure secrets management
  • Rotate API keys periodically (recommended: every 90 days)
  • Use different API keys for dev/staging/production
  • Never log API keys in plain text
  • 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
  • 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

Transaction Safety

RebelFi operations include safety mechanisms:
  • Lease-based claiming: Transactions are leased to prevent duplicate execution
  • Timeout handling: Expired leases release transactions for retry
  • Idempotency: Operations can be safely retried without duplicate effects
  • Audit trail: All transactions and reports are logged

Getting Started

  1. Tell us your custody provider — during onboarding
  2. We configure your adapter — typically 1-2 days
  3. Choose agent option — managed or self-hosted
  4. Configure credentials — connect to your custody provider
  5. Start earning yield — operations flow automatically

Ready to integrate?

Contact us to discuss your custody setup

Troubleshooting

Symptoms: No logs showing poll attemptsCheck:
  • Agent process is running
  • Network connectivity to midas.rebelfi.io
  • API key is valid
  • Environment variables are loaded
Test API connectivity:
curl -X POST "https://midas.rebelfi.io/api/agent/transactions/poll" \
  -H "x-api-key: $REBELFI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"leaseDurationMs": 30000}'
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
Symptoms: Transactions repeatedly claimed but never completedCheck:
  • leaseDurationMs is sufficient for signing + submission
  • Network latency to custody provider
  • Custody provider response times
Solution: Increase lease duration to 60000ms (60 seconds) or higher

Next Steps