The vault architecture in one minute
The SohoPay vault is an ERC-4626 tokenized yield vault deployed on Base. When you deposit USDC, the vault issues non-transferable accounting shares that track your collateral position.Key principles
- Vault balance = borrowing capacity: The sum of all active agent credit lines provisioned under your account cannot exceed what your vault collateral backs.
- Earn LP yield: While your collateral sits in the vault, it earns passive yield. The 3% LP slice of the 5% transaction fee is distributed directly to vault depositors.
- Non-custodial design: The SohoPay API never holds or takes custody of your funds. The API prepares the transaction calldata, and you sign and broadcast the deposit from your own wallet.
Supported networks & USDC contracts
Deposit USDC collateral
Depositing is a two-step flow: prepare the transaction via API, then submit it on-chain from your operator wallet.Step 1: Prepare the deposit calldata
POST /api/v1/vault/deposit generates the required contract parameters:
Response (200 OK):
Step 2: Broadcast on-chain
Submit the transaction from your connected wallet (e.g. using Viem or MetaMask). Ensure your wallet has approved the vault address to spend the required USDC. Once confirmed on Base (~1s), your borrowing capacity expands immediately.Withdraw USDC & gating rules
Withdrawals follow the same prepare-and-submit pattern viaPOST /api/v1/vault/withdraw.
However, withdrawals are strictly gated by outstanding agent debt: you can only withdraw collateral that is not currently backing unsettled agent balances.
Gated withdrawal error (409 Conflict)
If you attempt to withdraw more than your unencumbered balance, the gateway rejects the request:
How to unwind collateral before withdrawal:
- Pause active agents: Call
POST /api/v1/agents/{id}/pauseto prevent new payments from drawing on credit. - Settle balances: Allow in-flight orders to finalize and execute repayment.
- Check withdrawable funds: Verify that
withdrawableequals the desired amount. - Initiate withdrawal: Submit the withdrawal transaction.
Check vault balance & health
PollGET /api/v1/vault/balance/{merchant_id} to inspect your current collateral utilization:
Response (200 OK):
vault_balance— Total collateral deposited (sets total credit ceiling).credit_in_use— Amount actively backing outstanding agent balances.withdrawable— Collateral free to be withdrawn immediately (vault_balance - credit_in_use).
Sandbox testing
In the staging environment (Base Sepolia), test accounts include pre-allocated sandbox collateral. You can test agent creation and x402 payments without depositing any funds. If you want to test the full on-chain deposit flow in the sandbox:- Claim test USDC from faucet.circle.com on Base Sepolia.
- Run
POST /api/v1/vault/depositwith your test key. - Submit the deposit transaction on Base Sepolia.
Next steps
ERC-4626 Vault Protocol
Explore share accounting formulas, liquidity pools, and yield logic.
Agent Setup
Provision operational agents backed by your vault collateral.
Payment Flow
Learn how payments sign, authorize, and settle against your credit lines.

