Back to Docs

On-Chain Infrastructure

GateFlowSplitter

Atomic on-chain payment splits between API providers and the Obolo treasury. Non-custodial, transparent, and verifiable on any block explorer.

Pending Legal Review

The GateFlowSplitter contract is written and audited but not yet deployed. Deployment is blocked on a legal opinion confirming the non-custodial commission model. Obolo currently operates using the SaaS commission model (Path 1B) with monthly invoicing.

What It Does

The GateFlowSplitter is a Solidity smart contract that atomically splits every API payment between the provider and Obolo treasury in a single transaction. No intermediary holds funds — the split happens on-chain, verifiable by anyone.

Non-Custodial

Contract never holds a balance. Funds are forwarded immediately in the same transaction.

Transparent

Every split emits a PaymentSplit event. Providers and agents can verify exact amounts on Basescan.

Atomic

Provider and treasury payments happen in one transaction. Either both succeed or both revert.

Payment Flow

1

Agent approves USDC

Agent calls usdc.approve(splitter, amount) to allow the contract to pull funds.

2

Agent calls splitPayment()

Passes provider address, USDC amount, and endpoint slug hash. Contract pulls USDC from agent.

3

Atomic split: 88% provider, 12% treasury

Contract calculates commission (1200 bps default), transfers provider share and treasury share in the same transaction.

4

PaymentSplit event emitted

On-chain event includes provider, agent, gross amount, provider amount, treasury amount, and endpoint slug.

5

Proxy verifies and forwards

Agent sends tx hash as x402 payment proof. Obolo proxy verifies the PaymentSplit event, then forwards the API request upstream.

Contract Source (Simplified)

Full source at contracts/src/GateFlowSplitter.sol. Uses OpenZeppelin for SafeERC20, Ownable, and ReentrancyGuard.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

contract GateFlowSplitter is Ownable, ReentrancyGuard {
    using SafeERC20 for IERC20;

    IERC20 public immutable usdc;
    address public treasury;
    uint256 public commissionBps = 1200; // 12% = 1200 basis points

    function splitPayment(
        address provider,
        uint256 amount,
        bytes32 endpointSlug
    ) external nonReentrant {
        uint256 treasuryAmount = (amount * commissionBps) / 10000;
        uint256 providerAmount = amount - treasuryAmount;

        usdc.safeTransferFrom(msg.sender, address(this), amount);
        usdc.safeTransfer(provider, providerAmount);
        usdc.safeTransfer(treasury, treasuryAmount);

        emit PaymentSplit(provider, msg.sender, amount,
            providerAmount, treasuryAmount, endpointSlug);
    }
}

Owner Functions

FunctionDescriptionConstraint
setCommission(bps)Update commission rateCapped at 3000 bps (30%)
setTreasury(addr)Update treasury walletNon-zero address required
rescueTokens(token, amt)Recover accidentally sent tokensEmergency only

Agent Integration

Once deployed, agents will interact with the splitter through the Obolo SDK. The SDK handles approval, split payment, and proof submission automatically.

import { GateFlowClient } from '@gateflow/sdk';

// Agent calls an API endpoint through Obolo proxy.
// The proxy verifies the on-chain splitPayment() transaction
// before forwarding the request to the upstream API.

const gf = new GateFlowClient({
  walletKey: process.env.AGENT_WALLET_KEY,
  chain: 'base',      // Base L2 (primary)
  token: 'USDC',
});

// 1. Agent approves USDC spend to GateFlowSplitter contract
// 2. Agent calls splitPayment() — atomic 88/12 split
// 3. Agent sends tx hash as x402 payment proof
// 4. Proxy verifies PaymentSplit event, forwards request
const response = await gf.call('weather-api', { city: 'Tokyo' });

Supported Chains

Base L2 Primary

USDC at 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913. Low gas costs (typically under $0.01 per split).

Ethereum, Arbitrum, Optimism, Polygon, BSC Planned

Multi-chain deployment planned after Base mainnet launch and legal approval.

Commission Models

Current

SaaS Commission (Path 1B)

  • Agent pays provider directly on-chain
  • Obolo invoices providers monthly for commission
  • Tiered rates: 10% default, 7% at $10K/mo, 5% at $50K/mo

After Deployment

On-Chain Splitter (Path 1A)

  • Agent pays the splitter contract
  • Contract splits 88/12 atomically in one transaction
  • Non-custodial, transparent, no monthly invoicing