Subly
Pay for x402 APIs with yield from a Kamino USDC vault on Solana.
Subly includes a CLI/MCP client and a self-hosted relayer. Deposit USDC into a supported Kamino vault, let it earn yield, then use that yield to pay compatible APIs. Sellers use standard x402 and need no Subly integration.
Beta (0.8.7), no external security audit. Mainnet operations use real funds. Principal and yield are not guaranteed. Owner approvals and principal accounting are enforced by the relayer; an agent key can transact outside Subly. See the security model and validation status.
Try it locally
Requires Git, Node.js 24.22.1 and npm 11. Run these commands in macOS, Linux or Windows WSL:
git clone https://github.com/SublyFi/sublyfi-pay.git
cd sublyfi-pay
npm ci
HOST=127.0.0.1 npm run dev
Keep that terminal open. In a second terminal:
curl --fail http://127.0.0.1:3000/healthz
curl --fail http://127.0.0.1:3000/v1/vaults
Success: /healthz returns {"ok":true} and /v1/vaults returns a vault list. Stop the server with Ctrl+C.
With no RPC or sponsor environment variables set, this starts an in-memory API (mode: detached). No wallet, funds or database are needed. Deposits, withdrawals and payments are unavailable in this mode. npm run dev does not load .env automatically.
Use the client
Use Node.js 24.22.1, an operator's relayer URL, mainnet RPC and a dedicated agent wallet. See supported Node.js versions if you use another release. Obtain the relayer URL from your operator; this project does not provide a guaranteed public endpoint.
npx -y @subly_fi/[email protected] --help
Follow the client setup to configure the client, approve a spending policy, deposit and check your budget. No repository clone is needed. A fresh deposit must earn enough yield before it can pay an API.
Supported APIs must offer x402 Solana mainnet USDC exact with extra.feePayer. The default payment cap is 0.01 USDC. Amounts in commands use raw units: 1000000 = 1 USDC.
Operate a relayer
The operator guide covers Docker Compose, PostgreSQL, HTTPS, RPC and sponsor configuration. You need a domain and a sponsor wallet funded with SOL.
The relayer sponsors vault transactions; the seller's x402 facilitator handles API payment settlement. These are separate transactions. Sponsor gas and account rent are operator costs; recorded fee debt reduces the user's budget but does not reimburse the operator.
Development and documentation
See Contributing for tests and development setup, or the documentation index for API, architecture and troubleshooting guides.