Skip to content
Fourohtwo

Portfolio optimization (QAOA + classical)

ellimist.trade/v1/skills/quantum.portfolio.optimize

Portfolio optimization (QAOA + classical): Use this to compute mean-variance portfolio weights from your own returns or covariance, optionally limited to a maximum number of assets; QAOA asset selection next to an exact classical baseline.

BasePolygonArbitrumAnswering
POSThttps://ellimist.trade/v1/skills/quantum.portfolio.optimize

Uptime100% of 1 check in 30 days

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

// npm install fourohtwo
import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain, inside your spending rules.
const pay = createPayer({ privateKey: process.env.AGENT_KEY, maxPerCallUsd: "0.05" });
const res = await pay("https://ellimist.trade/v1/skills/quantum.portfolio.optimize", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"assets":["A","B","C"],"backend":"classical","max_assets":2,"returns":[[0.012,-0.004,0.006],[-0.008,0.01,0.002],[0.015,0.003,-0.005],[-0.002,-0.007,0.009],[0.006,0.012,0.001],[0.009,-0.003,0.004],[-0.011,0.005,-0.002],[0.004,0.008,0.007],[0.013,-0.006,0.003],[-0.005,0.002,-0.008],[0.007,0.009,0.005],[0.002,-0.001,0.006]]}),
});
console.log(await res.json());

Example input

{
  "assets": [
    "A",
    "B",
    "C"
  ],
  "backend": "classical",
  "max_assets": 2,
  "returns": [
    [
      0.012,
      -0.004,
      0.006
    ],
    [
      -0.008,
      0.01,
      0.002
    ],
    [
      0.015,
      0.003,
      -0.005
    ],
    [
      -0.002,
      -0.007,
      0.009
    ],
    [
      0.006,
      0.012,
      0.001
    ],
    [
      0.009,
      -0.003,
      0.004
    ],
    [
      -0.011,
      0.005,
      -0.002
    ],
    [
      0.004,
      0.008,
      0.007
    ],
    [
      0.013,
      -0.006,
      0.003
    ],
    [
      -0.005,
      0.002,
      -0.008
    ],
    [
      0.007,
      0.009,
      0.005
    ],
    [
      0.002,
      -0.001,
      0.006
    ]
  ]
}

More from EllimistProvider status