81trust / 100

Portfolio History Invoke

by SolEnrich in Onchain & crypto

x402 APIPassing, checked 57 min ago

Daily portfolio snapshots (value, SOL balance, token count, risk score) for a wallet over 7/14/30 days, plus summary stats: peak, trough, max drawdown, average value, change vs period start. Designed for charting and PnL tracking; complements wallet-history which returns two-point deltas. Today's live point is appended automatically.

POST https://api.solenrich.com/entrypoints/portfolio-history/invoke

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
185 ms typical, 185 ms slowest 5%
Last check
57 min ago
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://api.solenrich.com/entrypoints/portfolio-history/invoke" \
  -H "content-type: application/json" \
  -d '{"address":"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg","format":"json","period":"30d"}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fapi.solenrich.com%2Fentrypoints%2Fportfolio-history%2Finvoke
const res = await pay("https://api.solenrich.com/entrypoints/portfolio-history/invoke", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"address":"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg","format":"json","period":"30d"}),
});
console.log(await res.json());

Example input

{
  "address": "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
  "format": "json",
  "period": "30d"
}

Example output

{
  "output": {
    "address": "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
    "current": {
      "portfolio_value_usd": 4.7307,
      "risk_level": "LOW",
      "risk_score": 0.15,
      "sol_balance": 0.039869,
      "token_count": 6
    },
    "last_updated": "2026-09-22T00:10:23.384Z",
    "series": [
      {
        "date": "2026-09-17",
        "defi_position_count": 0,
        "label_count": 1,
        "nft_count": 9,
        "portfolio_value_usd": 4.0217,
        "risk_level": "LOW",
        "risk_score": 0.15,
        "sol_balance": 0.039869,
        "token_count": 6,
        "top_holding_mints": [
          "FS66v5XYtJAFo14LiPz5HT93EUMAHmYipCfQhLpU4ss8",
          "Fxgdfsy1Z5Mvh53o69s2Ev6TGxtAJ1RQ5RJ5moCpKmQZ",
          "55USDUivJLe4L1kY64XK1nDPAqbphG6nRpTjk2iZ5PwG"
        ],
        "tx_count_30d": 0
      }
    ],
    "summary": {
      "average_portfolio_value_usd": 4.38,
      "change_vs_start_pct": 17.88,
      "data_points": 2,
      "lookback_days": 7,
      "max_drawdown_pct": 0,
      "peak": {
        "date": "2026-09-22",
        "portfolio_value_usd": 4.741
      },
      "period_end": "2026-09-22",
      "period_start": "2026-09-17",
      "trough": {
        "date": "2026-09-17",
        "portfolio_value_usd": 4.0217
      }
    }
  },
  "run_id": "uuid",
  "status": "succeeded"
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
57 min agoPassed402341 ms$0.006
6 h agoPassed402185 ms$0.006