universalsettle-api
The High-Velocity Settlement Standard for the Solana Agentic Economy.
universalsettle-api is the official Rust SDK for interacting with the UniversalSettle program on Solana. Designed for the machine-to-machine (M2M) economy, it enables autonomous agents to perform instant, trustless settlement for any SPL token or Native SOL.
🏗️ Architecture
UniversalSettle implements a Commission-First settlement model with two-tier fee structure:
- SplitVault PDAs: Every seller gets a unique vault (derived from their wallet address) that partitions revenue from protocol fees.
- Dual-Floor Minimum Fees: Independent minimum fee floors for SPL tokens (6-decimal standard) and Native SOL (9-decimal standard), preventing economic value drift across assets.
- Sovereign Path: Sellers who self-provision their vault pay a discounted fee rate (
discounted_fee_bps). Facilitator-provisioned vaults pay the standard rate (fee_bps) until provisioning costs are recovered. - Provisioning Recovery: When a facilitator creates a vault on behalf of a seller, the protocol automatically diverts a portion of initial sweep payouts to the fee destination until the one-time provisioning cost is recovered.
🚀 Quick Start
1. Add Dependency
[]
= "0.1.4"
= "^2.1"
2. Create a Vault
use sdk;
// Create a vault for a seller (payer covers rent)
let ix = create_vault;
3. Sweep Funds
use sdk;
let = split_vault_pda;
// SOL sweep — settle all available SOL from the vault
let ix = sweep;
// SPL sweep — settle USDC from the vault
let ix = sweep;
🛠️ Key Features
- SplitVault PDAs: Deterministic per-seller vaults with independent SOL storage accounts.
- Dual-Floor Architecture: Independent minimum fee floors for SPL (
min_fee_amount) and Native SOL (min_fee_amount_sol). - Sovereign Fee Tier: Self-provisioned sellers automatically receive the discounted fee rate.
- Provisioning Recovery: Facilitator-fronted vault creation costs are transparently recovered from initial sweeps.
- All Asset Support: Native SOL and all SPL Token / Token-2022 assets.
- Recommendation: We strongly recommend using USDC or USDT (stablecoins) for SPL transactions. While custom tokens are supported, the
min_fee_amountfloor is economically optimized for 6-decimal stable assets.
- Recommendation: We strongly recommend using USDC or USDT (stablecoins) for SPL transactions. While custom tokens are supported, the
- Comprehensive SDK: Helper functions for all instructions —
create_vault,sweep,initialize,update_authority,update_fee_rate,update_discounted_fee_rate,update_fee_destination,update_min_fee_amount,update_min_fee_amount_sol, andupdate_provisioning_fee.
📋 Instructions
| Instruction | Access | Description |
|---|---|---|
Sweep (0) |
Public | Settle funds from a vault — splits payout and fee |
CreateVault (1) |
Public | Create a SplitVault PDA for a seller |
Initialize (100) |
Admin | One-time program initialization |
UpdateAuthority (101) |
Admin | Transfer config authority |
UpdateFeeRate (102) |
Admin | Update standard fee basis points |
UpdateFeeDestination (103) |
Admin | Update fee destination wallet |
UpdateMinFeeAmount (104) |
Admin | Update SPL minimum fee floor |
UpdateMinFeeAmountSol (105) |
Admin | Update SOL minimum fee floor |
UpdateProvisioningFee (106) |
Admin | Update provisioning recovery targets |
UpdateDiscountedFeeRate (107) |
Admin | Update sovereign fee basis points |
📜 Standard Alignment
This crate is the reference implementation for the x402 Protocol. It works with the pr402 Facilitator and the spl-token-balance-serverless reference project.
⚖️ License
Licensed under the Apache License, Version 2.0.