Documentation
How it actually works
Stockprint turns an investment thesis into rules that a contract enforces. This page is the mechanism, including the parts that are inconvenient.
The trust model
A keeper watches your portfolio and proposes a route. The executor decides whether to carry it out. The keeper is untrusted: rebalance() is permissionless, so anyone may call it, and the caller chooses only how to trade — never whether to.
Before anything moves, the contract checks, on chain:
- the strategy exists, is not paused, and has not expired
- the interval you set has elapsed — a band breach may jump the schedule, but only after a cooldown of a tenth of it
- your trigger genuinely fired, recomputed from live prices rather than taken on trust
- every spot price is within
100ticks of a 30-second average, so a single-block price push cannot trigger a trade - each token being touched is a leg of your strategy
- Permit2 permits the exact amount being pulled
And after the trades, before the transaction is allowed to succeed:
- every leg is inside its drift band
- the portfolio has not lost more than your slippage ceiling
If any check fails the whole transaction reverts, which means nothing moved. A bad route costs the keeper gas and costs you nothing.
Custody
Your tokens never leave your wallet, not even for a block. Stockprint holds a Permit2 allowance — scoped to named tokens, capped, and expiring on its own. During a rebalance the executor pulls what the route needs, swaps it, and sweeps everything back to you inside the same transaction. It ends every call holding nothing.
Revoking calls permit2.lockdown() on Permit2 0x0000…8BA3 directly. It does not route through any Stockprint contract and works if Stockprint is offline.
Pricing
Assets are priced from their own Uniswap v3 pool against USDG. Three details on this chain make that less trivial than it sounds:
- Identity is the ABI, never the name. A dozen tokens here are called “NVIDIA · Robinhood Token”. Exactly one answers
uiMultiplier(). Admission tests the call. - USDG has six decimals and every stock has eighteen. The gap is undone on every quote.
- A token is not always one share. AAPL's multiplier is 1.000566, so the pool quote is divided by it to get a share price.
What the chain cannot do
Robinhood Chain keeps roughly twelve minutes of state. Ask it for a balance an hour old and it answers metadata is not found. That has one honest consequence: trailing returns cannot be read from history, so momentum has to record its own prices from the day it starts and says “warming up” until the lookback fills. It is not a placeholder for a number we have and are hiding — the number does not exist yet.
Fees
The protocol fee is zero. If it is ever switched on it is charged on notional moved, never on your portfolio, and each strategy stores its own cap that the contract refuses to exceed. You always pay the pool's trading fee and the gas for each rebalance.
Risk
- Unaudited. 38 tests pass, including a full round trip against the deployed bytecode on a fork of mainnet. Tests are not an audit.
- Liveness is centralised. If the keeper stops, strategies stop. Nothing is at risk, and anyone can run a keeper.
- Rebalancing is not free. A tighter band tracks your thesis more closely and trades more often, and every trade pays a pool fee.
- Tokenized equities carry their own risks — issuer, redemption, and the depth of a pool at the moment you need it.
Stockprint