Back

Documentation

A complete account of how the agent turns a standing order into a held position: the mathematics that sets the target, how trades execute, and every contract involved. Every method described here is implemented in the engine.

Overview

Metacentre is an asset manager agent for tokenized stocks on Robinhood Chain. A standing order written in plain English becomes a set of assets, a risk level, and any proportions stated explicitly. From that the agent computes target weights, measures them against what the wallet actually holds, and returns the orders that close the gap. Every step is verifiable on-chain.

Underneath the instruction sits a quantitative question: given a set of stocks, how much of each to hold. Mean-variance optimization answers it with the weights delivering the greatest expected return for a chosen level of risk, hardened with statistical safeguards for real-world use. Where that answer differs from the proportions requested, the agent blends the two and states the difference rather than silently overriding the instruction.

What is live

Metacentre is designed as a foundation for multiple on-chain strategies over tokenized equities:

  • Managed allocation (live). Standing order, target weights, drift measurement, and on-chain rebalancing, described in full below.
  • Risk signals (in development). Trend, momentum, and volatility per holding, with position levels sized from each asset’s own range.
  • Vault (in development). Deposit once and let the agent hold the standing order, so allocation and rebalancing run without a signature at every step.

The optimization model

For a portfolio of n stocks with weight vector w, expected return vector mu, and return covariance matrix Sigma, the portfolio's expected return and variance are:

E[Rp]  =  wμ\mathbb{E}[R_p] \;=\; \mathbf{w}^{\top}\boldsymbol{\mu}
Var(Rp)  =  wΣw\operatorname{Var}(R_p) \;=\; \mathbf{w}^{\top}\boldsymbol{\Sigma}\,\mathbf{w}

Metacentre selects weights by solving the risk-adjusted objective, where the risk-aversion parameter lambda is set by the risk slider:

maxw    wμ    λ2wΣw\max_{\mathbf{w}}\;\; \mathbf{w}^{\top}\boldsymbol{\mu}\;-\;\frac{\lambda}{2}\,\mathbf{w}^{\top}\boldsymbol{\Sigma}\,\mathbf{w}
subject toiwi=1,0wic\text{subject to}\quad \sum_{i} w_i = 1,\qquad 0 \le w_i \le c

A high value of lambda penalizes variance heavily and produces a conservative, low-volatility mix; a low value favors expected return and produces an aggressive mix. Sweeping lambda traces the entire efficient frontier. The problem is solved by projected gradient ascent, projecting each iterate onto the constraint set using an exact simplex projection.

Expected returns

Expected returns are estimated from multi-year daily price history of the underlying equities. Raw historical means are noisy, and unconstrained optimization amplifies that noise into extreme, unstable weights, a failure mode known as error maximization. Metacentre counters it by shrinking each stock's estimated mean toward the cross-sectional average, in the spirit of the James-Stein estimator:

μ^i  =  (1δ)μi  +  δμˉ\hat{\mu}_i \;=\; (1-\delta)\,\mu_i \;+\; \delta\,\bar{\mu}

where mu_i is the sample mean for stock i, mu-bar is the average across all selected stocks, and the intensity delta lies in the interval from 0 to 1. This pulls unreliable individual estimates toward a stable common value, materially improving out-of-sample behavior.

Risk and covariance

Risk is captured by the covariance matrix of returns, which encodes both how volatile each stock is and how the stocks move together. The sample covariance is:

Σij  =  1T1t=1T(ritrˉi)(rjtrˉj)\Sigma_{ij} \;=\; \frac{1}{T-1}\sum_{t=1}^{T}\left(r_{it}-\bar{r}_i\right)\left(r_{jt}-\bar{r}_j\right)

Sample covariance estimated from limited data is ill-conditioned and overstates spurious correlations. Metacentre applies shrinkage toward a diagonal target, damping the off-diagonal terms:

Σ^  =  (1α)Σ  +  αD\hat{\boldsymbol{\Sigma}} \;=\; (1-\alpha)\,\boldsymbol{\Sigma} \;+\; \alpha\,\mathbf{D}

where D retains the diagonal of individual variances and the intensity alpha lies between 0 and 1. The result is a better-conditioned matrix that yields stable, sensible weights rather than ones driven by noise in the correlations.

The efficient frontier

The efficient frontier is the set of portfolios offering the highest expected return at each level of risk. Every point on it solves the objective above for a particular lambda. The risk level carried by the standing order selects a single point along it, and the target weights are that point's coordinates.

Constraints

The position cap adapts to how many stocks are selected, so small baskets remain feasible while large ones stay diversified:

c  =  max ⁣(0.30,  1.5n)c \;=\; \max\!\left(0.30,\; \frac{1.5}{n}\right)
  • Long-only, fully invested. Weights are non-negative and sum to one. No shorting or leverage.
  • Position cap. Each weight is capped at c to force diversification, so no single stock dominates even at the aggressive end of the frontier.
  • Zero weights are expected. A selected stock can receive a weight of zero when it does not improve the portfolio at the chosen risk level, for example when it is dominated by, or highly correlated with, stocks already held. This is the optimizer working correctly, not a stock being dropped in error. The same stock may receive weight at a different point on the frontier, so moving the risk slider can bring it back into the allocation.

Execution

Purchases and sales route through the Uniswap v4 Universal Router on Robinhood Chain. Each leg is an exact-input swap carrying a minimum-output constraint, where s is the slippage tolerance:

amountOut    amountOutMin  =  quote×(1s)\text{amountOut} \;\ge\; \text{amountOutMin} \;=\; \text{quote}\,\times\,(1-s)

This bounds price impact per leg; if a pool cannot honor the minimum, that leg reverts and no funds are spent on it. A basket is executed leg by leg, with stock tokens settling directly into the user's wallet. Because on-chain liquidity varies by stock, each leg is quoted against live pool state at build time.

Custody and approvals

Metacentre holds no user assets at any point. Funds move directly between the user's wallet and on-chain liquidity. Before a first trade the user grants two standard approvals: an ERC-20 approval of the input token to the Permit2 contract, and a Permit2 allowance to the Universal Router. Both authorizations are to audited public infrastructure, never to Metacentre. No Metacentre contract sits in the path of user funds.

Performance accounting

Profit and loss is reconstructed entirely from on-chain data. Metacentre reads the wallet's historical swaps, identifying purchases (USDG out, stock in) and sales (stock out, USDG in), and applies average-cost accounting. For each stock, cost basis accumulates on purchases; a sale reduces the basis proportionally and books realized profit against the average unit cost:

realized  =  proceeds    costBasisqty×qtySold\text{realized} \;=\; \text{proceeds} \;-\; \frac{\text{costBasis}}{\text{qty}}\,\times\,\text{qtySold}

Current value uses live realizable sell quotes, the amount a holding would return if sold now, rather than a mark price, so the figure reflects what the user could actually obtain. No user data is stored off-chain.

Contracts

Metacentre builds on public infrastructure on Robinhood Chain (chain ID 4663). The tokenized stocks below are issued on-chain; Metacentre reads and trades them but does not issue them. Every address links to the chain explorer for independent verification.

Tokenized stocks

Contracts Metacentre interacts with

These are the on-chain contracts Metacentre calls directly when you build, buy, or sell a basket. Every trade settles through them; Metacentre adds no contract of its own between you and the market.

ContractRoleAddress
USDGSettlement stablecoin every basket is priced and funded in0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168
Universal Router (v2.1.1)Executes the swaps that acquire or unwind a basket, on your behalf0x8876789976decbfcbbbe364623c63652db8c0904
V4 QuoterPrices each leg before execution so allocations reflect live liquidity0x8dc178efb8111bb0973dd9d722ebeff267c98f94
Permit2Authorizes the router to move your tokens, without granting custody0x000000000022D473030F116dDEE9F6B43aC78BA3

Underlying infrastructure

Metacentre does not call this directly, but every trade ultimately routes through it. It is the core of Uniswap v4 on Robinhood Chain, listed here for full transparency.

ContractRoleAddress
Uniswap v4 PoolManagerHolds the pools and liquidity all baskets trade against0x8366a39cc670b4001a1121b8f6a443a643e40951

Metacentre-specific contracts, once introduced (the vault first), will be listed here with source references.

Roadmap

Managed allocation is live. Two layers follow it:

  • Risk signals. Trend state, momentum, and volatility per holding, with stop and target levels derived from each asset’s own range rather than fixed percentages.
  • Vault. Deposit once and let the agent stand the watch, so allocation and rebalancing run without a signature at every step. Contracts will be public before they hold anything.
  • Broader coverage. Additional tokenized stocks as on-chain liquidity for them develops.

Risk disclosure

Tokenized stocks carry market risk. Expected-return figures are estimates derived from historical behavior and are not forecasts or guarantees of future performance. On-chain liquidity for some stocks may be limited or absent, which can affect the ability to buy or sell at a given size. Optimization improves the risk-return profile of a basket but does not eliminate the risk of loss. Users are solely responsible for their own transactions, wallet security, and custody of assets. Nothing here is investment advice.

Open agent