Vai al contenuto
GET /v1/compare

DCA vs lump-sum vs best/worst-case timing

Provalo dal vivo

10 chiamate gratuite al giorno — senza registrazione, senza chiave API. Passa dal gateway oanor.

Intestazioni personalizzate (facoltative)
api.oanor.com/dca-api

Funziona. Prendi una chiave API e usala nel tuo progetto.

Ottieni una chiave API

Frammenti di codice

curl "https://api.oanor.com/dca-api/v1/compare" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/dca-api/v1/compare", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/dca-api/v1/compare");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/dca-api/v1/compare",
    headers={"x-oanor-key": "oanor_test_..."}
)

Risposta di esempio

Una risposta reale di questo endpoint, acquisita dall'ultimo health check.

{
    "data": {
        "note": "best_case / worst_case = investing the whole sum at the lowest / highest price in the series (timing bounds).",
        "source": "DCA",
        "fee_pct": 0,
        "periods": 12,
        "ranking": [
            "best_case",
            "lump_sum",
            "dca",
            "worst_case"
        ],
        "strategies": {
            "dca": {
                "units": 10.75237033,
                "value": 1451.57,
                "profit": 251.57,
                "roi_pct": 20.9642,
                "avg_cost": 111.60329895
            },
            "lump_sum": {
                "units": 12,
                "value": 1620,
                "profit": 420,
                "roi_pct": 35,
                "buy_price": 100
            },
            "best_case": {
                "units": 13.33333333,
                "value": 1800,
                "profit": 600,
                "roi_pct": 50,
                "buy_price": 90
            },
            "worst_case": {
                "units": 8.57142857,
                "value": 1157.14,
                "profit": -42.86,
                "roi_pct": -3.5714,
                "buy_price": 140
            }
        },
        "current_price": 135,
        "total_invested": 1200
    },
    "meta": {
        "timestamp": "2026-06-11T07:49:30.292Z",
        "request_id": "25d5e019-c2c6-4b8a-af32-7d9e1a872a7d"
    },
    "status": "ok",
    "message": "Strategies compared",
    "success": true
}