@pear-protocol/types
Advanced tools
@@ -31,12 +31,25 @@ import { z } from 'zod'; | ||
| totalTrades: z.number(), | ||
| // The plain average of this account's per-position returns, as a ratio: "0.25" is +25%. | ||
| // Every position is weighted equally, so a small winner counts as much as a large one — | ||
| // this is a measure of the trader's decisions, not of the dollars those decisions moved. | ||
| // This account's return over the window, as a ratio: "0.25" is +25%. The measured | ||
| // positions' PnL divided by the capital that earned it, so each position weighs by the | ||
| // money it put at risk — a measure of how the account's dollars did, not of how its | ||
| // individual calls went. | ||
| // | ||
| // One formula on every position: (realized + unrealized - fees paid) over the size it | ||
| // opened with. A closed position holds nothing, so its unrealized half is zero and this | ||
| // reduces to what the trader kept; a partly reduced open position counts both the profit | ||
| // it banked and the worth of what it still holds. Only fees of fills that happened are | ||
| // charged, so a running position never pays for the exit it has not made. | ||
| // One formula on every position: (realized + unrealized - fees paid) over the most cash that | ||
| // position had committed at one time. A closed position holds nothing, so its unrealized half | ||
| // is zero and this reduces to what the trader kept; a partly reduced open position counts | ||
| // both the profit it banked and the worth of what it still holds. Only fees of fills that | ||
| // happened are charged, so a running position never pays for the exit it has not made. | ||
| // | ||
| // The denominator is cash committed, not market value: each opening fill adds what it paid, | ||
| // each closing fill releases the share of that commitment the quantity it closed was holding, | ||
| // and the peak of that running total is what the return is measured against. So it is not the | ||
| // size the position opened at — a position scaled up afterwards is measured against what it | ||
| // went on to risk — and not the sum of everything it ever opened either, since capital | ||
| // reduced and recommitted counts once rather than twice. | ||
| // | ||
| // Measuring cash rather than market value is deliberate. A market-value denominator can fall | ||
| // below the money actually put in when a position is averaged down, which inflates the | ||
| // return; and no historical price series is kept, so market value could only ever be sampled | ||
| // at the fills themselves. | ||
| // | ||
| // Measured only where the window holds both the position's open and the moment the | ||
@@ -50,4 +63,4 @@ // measurement is taken at: now for a running position, the closing fill for a finished | ||
| // when its only trading in the window closed positions opened before it, when a closed | ||
| // window left its open positions unpriced, when every position it opened in the window | ||
| // closed after it, or when a position recorded no opening size. | ||
| // window left its open positions unpriced, or when every position it opened in the window | ||
| // closed after it. | ||
| roi: z.string().optional(), | ||
@@ -54,0 +67,0 @@ // The trader's linked X account, published to every caller — the board names its traders |
+1
-1
| { | ||
| "name": "@pear-protocol/types", | ||
| "version": "1.30.1", | ||
| "version": "1.31.0", | ||
| "description": "Pear Protocol Types definitions", | ||
@@ -5,0 +5,0 @@ "private": false, |
Unstable ownership
Supply chain riskA new collaborator has begun publishing package versions. Package stability and security risk may be elevated.
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
874241
0.1%24968
0.05%1
Infinity%1
Infinity%