Compute trade P&L statistics from caller-supplied realized P&L values: win rate, profit…
Compute trade P&L statistics from caller-supplied realized P&L values: win rate, profit factor, max drawdown, and rolling-window statistics. No market data or account access -- purely a function of the numbers supplied.
by api.edifiedlab.com · discovered, not yet claimed by its owner · updated 2026-09-19
Mirrored from Coinbase's public x402 Bazaar. The description is the provider's own text and has not been reviewed here; the payment requirements are copied as published.
What it does
Compute trade P&L statistics from caller-supplied realized P&L values: win rate, profit factor, max drawdown, and rolling-window statistics. No market data or account access -- purely a function of the numbers supplied.
Tags: finance · statistics · pnl · risk · x402 · bazaar
Call contract
- Method
- POST
- Input
- json
- Output
- json
- Last paid call
- 2026-09-19
{
"pnls": [
120.5,
-45,
300.25
],
"rolling_window": 20
}{
"action": "calculate",
"avg_loss": 1,
"avg_win": 2.5,
"expectancy": 1.333333,
"expectancy_pvalue": 0.133629,
"expectancy_pvalue_method": "student_t_two_sided",
"expectancy_pvalue_sample_size": 3,
"kelly": 0.533333,
"longest_loss_streak": 1,
"max_drawdown": 1,
"n": 3,
"payload": "pnl_stats",
"profit_factor": 5,
"rolling_expectancy": 1,
"rolling_kelly": 0.333333,
"rolling_n": 2,
"rolling_win_rate": 0.5,
"trailing_loss_streak": 0,
"win_rate": 0.667
}Use with an agent
- Discover. Agents find this listing with
GET https://bazaar.saylorinnovations.com/discovery/search?query=…, the MCP toolsearch_resources, or/discovery/resources. - Inspect. Fetch
/resources/33405.jsonfor the price and payment options. - Pay. Call
GET https://api.edifiedlab.com/v1/market/pnl-stats. The provider answers402with its payment requirements. An x402 client signs one of the options below and retries withPAYMENT-SIGNATURE. - Execute. The provider returns
200with the data. Agent Bazaar is not in the request path and never sees your payment.
For humans
You don't need an account or an API key; you need a wallet holding a small amount of USDC on Base, and an x402-capable client (see the examples below). Call the endpoint unpaid first to see exactly what it asks for.
Pricing & payment
- Price
- $0.011 / request
- Protocol
- x402 v2
- Auth
- No account or API key. Pay per request.
- Networks
- Base
- Demand
- 1 calls · 1 unique payers in 30d (public x402 Bazaar data)
x402 payment requirements
| Scheme | Network | Asset | Amount | Pay to | Timeout |
|---|---|---|---|---|---|
| exact | Base eip155:8453 | USDC | $0.011 | 0x5037546753d64F77A6fA95B6f85659B6a4A7F6FD | 600s |
accepts[] (raw JSON)
[
{
"scheme": "exact",
"network": "eip155:8453",
"payTo": "0x5037546753d64F77A6fA95B6f85659B6a4A7F6FD",
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": "11000",
"amountUsd": 0.011,
"maxTimeoutSeconds": 600
}
]Schemas
Output schema (JSON Schema)
{
"properties": {
"example": {
"additionalProperties": false,
"properties": {
"action": {
"const": "calculate",
"type": "string"
},
"avg_loss": {
"type": "number"
},
"avg_win": {
"type": "number"
},
"expectancy": {
"type": "number"
},
"expectancy_pvalue": {
"type": "number"
},
"expectancy_pvalue_method": {
"const": "student_t_two_sided",
"type": "string"
},
"expectancy_pvalue_sample_size": {
"minimum": 1,
"type": "integer"
},
"kelly": {
"type": "number"
},
"longest_loss_streak": {
"type": "integer"
},
"max_drawdown": {
"type": "number"
},
"n": {
"type": "integer"
},
"payload": {
"const": "pnl_stats",
"type": "string"
},
"profit_factor": {
"type": [
"number",
"null"
]
},
"rolling_expectancy": {
"type": "number"
},
"rolling_kelly": {
"type": "number"
},
"rolling_n": {
"type": "integer"
},
"rolling_win_rate": {
"type": "number"
},
"trailing_loss_streak": {
"type": "integer"
},
"win_rate": {
"type": "number"
}
},
"required": [
"payload",
"action",
"n",
"win_rate",
"avg_win",
"avg_loss",
"expectancy",
"profit_factor",
"max_drawdown",
"longest_loss_streak",
"trailing_loss_streak",
"kelly",
"rolling_n",
"rolling_expectancy",
"rolling_win_rate",
"rolling_kelly",
"expectancy_pvalue",
"expectancy_pvalue_sample_size",
"expectancy_pvalue_method"
],
"type": "object"
},
"type": {
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
}Example shape — generated from the schema, not a captured live response
{
"example": {
"action": "string",
"avg_loss": 0,
"avg_win": 0,
"expectancy": 0,
"expectancy_pvalue": 0,
"expectancy_pvalue_method": "string",
"expectancy_pvalue_sample_size": 0,
"kelly": 0,
"longest_loss_streak": 0,
"max_drawdown": 0,
"n": 0,
"payload": "string",
"profit_factor": 0,
"rolling_expectancy": 0,
"rolling_kelly": 0,
"rolling_n": 0,
"rolling_win_rate": 0,
"trailing_loss_streak": 0,
"win_rate": 0
},
"type": "string"
}Examples
curl -X POST 'https://api.edifiedlab.com/v1/market/pnl-stats' -H 'Content-Type: application/json' --data '{"pnls":[120.5,-45,300.25],"rolling_window":20}'
# -> 402 Payment Required; read PAYMENT-REQUIRED
# retry the identical request with PAYMENT-SIGNATUREconst res = await fetch("https://api.edifiedlab.com/v1/market/pnl-stats", {
"method": "POST",
"headers": {
"content-type": "application/json"
},
"body": "{\"pnls\":[120.5,-45,300.25],\"rolling_window\":20}"
});
if (res.status === 402) {
const { accepts } = await res.json();
// pay one of accepts[] via an x402 client, then retry with the payment header
}import httpx
import json
res = httpx.request("POST", "https://api.edifiedlab.com/v1/market/pnl-stats", json=json.loads("{\"pnls\":[120.5,-45,300.25],\"rolling_window\":20}"))
if res.status_code == 402:
accepts = res.json()["accepts"]
# pay one of accepts[] via an x402 client, then retry with the payment headerDetails
- Provider
- api.edifiedlab.com
- Endpoint
- https://api.edifiedlab.com/v1/market/pnl-stats
- Machine-readable
/resources/33405.json