SpiralStake
A non-custodial Morpho leverage-execution gateway behind x402 micropayments: discover and simulate leverage strategies, and build unsigned transactions for any agentic AI.
What is SpiralStake?
SpiralStake is an x402 micropayment gateway to Spiral Stake's non-custodial leverage execution layer on Morpho. It exposes the same seven tools as the Spiral Stake MCP server as plain HTTP endpoints, payable in USDC or EURC through the x402 two-round HTTP 402 handshake via the central facilitator. An agent reads live strategies, prices, and on-chain positions; runs a deterministic simulation of a leveraged position with no wallet; then builds an unsigned transaction bundle that a human reviews and signs locally. It serves two profiles: Leveraged Yield on correlated pairs, where leverage multiplies the spread between collateral yield and the borrow rate, and Leveraged Long on non-correlated pairs for directional exposure without selling the base asset. Positions are non-custodial and isolated per user, each in its own UserProxy clone; the gateway never holds or touches a private key. Contracts were audited by three independent firms.
Pay per call in USDC, EURC across Base, Arbitrum, Polygon and Avalanche via the x402 micropayment protocol — no subscriptions, no API keys, no wallets to configure for the caller.
Every agentic AI can GET /persona and adopt the machine-readable persona/SOUL as a temporary role.
Operations
Show all operations
assembly
| Method | Endpoint | Description | Tier |
|---|---|---|---|
POST | /v1/build/leverage-tx | Build the unsigned transaction to open a leveraged position — returns approvals, tx, and meta the user signs locally. | basic |
POST | /v1/build/manage-tx | Build the unsigned transaction to adjust or close an open position (actions: close, increase_leverage, add/remove_collateral, repay, borrow). | basic |
Workflows
- discover-best-yield — find the highest risk-adjusted leverage opportunity across strategies:
— Free reads only: list_strategies to enumerate, get_strategy to compare, get_prices for current token/loan prices, then simulate_leverage on shortlisted candidates. - research-strategy — understand a single strategy's market, risk, and expected outcome before any commitment:
— Free reads: get_strategy for detail on the Morpho market id, then simulate_leverage to preview outcomes at a chosen leverage. - open-position — prepare an unsigned transaction to open a leveraged-yield or leveraged-long position:
build_leverage_tx— Precede with free reads list_strategies -> get_strategy -> simulate_leverage; never build before simulating. Returns the unsigned bundle (approvals, tx, meta) for the human to sign. - manage-or-close — adjust an open position's leverage or collateral, or close it:
build_manage_tx— Locate the position index via the free get_positions read, then build_manage_tx with the action (close, increase_leverage, add/remove_collateral, repay, borrow).
Data sources
- Spiral Stake Integration REST API — Keyed partner API this gateway proxies. Authentication is server-side — agents never need a key. Live market data.
- Morpho markets — Strategy risk and APY facts are derived from Morpho market data. Live.
- On-chain position state — Read via get_positions; reflects a wallet's open/closed positions at the current chain state.
- Deterministic simulation — simulate_leverage derives results deterministically from current state, so repeat calls with the same inputs yield the same outcome.
Examples
open-position
Open a leveraged-yield position on USDC — find the best strategy, simulate at 3x, then build the open transaction
{
"strategyId": "0x...market-id",
"payToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": "1000",
"userAddress": "0x...signer",
"leverage": 3,
"chainId": 8453
}discover-best-yield
Simulate a 2x leveraged long on ETH/USDC and report the expected APY, LTV, and liquidation point
{
"strategyId": "0x...eth-usdc",
"payToken": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"amount": "1",
"leverage": 2,
"chainId": 1
}manage-or-close
Increase leverage on an open wstETH/WETH position and rebuild the manage transaction for signing
{
"userAddress": "0x...signer",
"id": 3,
"action": "increase_leverage",
"leverage": 4,
"desiredLtv": "75",
"chainId": 1
}research-strategy
Understand a single strategy's market, risk, and expected outcome before any commitment
{
"strategyId": "0x...wstETH-weth",
"chainId": 1
}