@pear-protocol/types 1.30.1 → 1.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,15 +28,28 @@ const LeaderboardRow = z.object({
28
28
  pearFee: z.string(),
29
29
  tradeFee: z.string(),
30
30
  totalTrades: z.number(),
31
- // The plain average of this account's per-position returns, as a ratio: "0.25" is +25%.
32
- // Every position is weighted equally, so a small winner counts as much as a large one —
33
- // this is a measure of the trader's decisions, not of the dollars those decisions moved.
31
+ // This account's return over the window, as a ratio: "0.25" is +25%. The measured
32
+ // positions' PnL divided by the capital that earned it, so each position weighs by the
33
+ // money it put at risk — a measure of how the account's dollars did, not of how its
34
+ // individual calls went.
34
35
  //
35
- // One formula on every position: (realized + unrealized - fees paid) over the size it
36
- // opened with. A closed position holds nothing, so its unrealized half is zero and this
37
- // reduces to what the trader kept; a partly reduced open position counts both the profit
38
- // it banked and the worth of what it still holds. Only fees of fills that happened are
39
- // charged, so a running position never pays for the exit it has not made.
36
+ // One formula on every position: (realized + unrealized - fees paid) over the most cash that
37
+ // position had committed at one time. A closed position holds nothing, so its unrealized half
38
+ // is zero and this reduces to what the trader kept; a partly reduced open position counts
39
+ // both the profit it banked and the worth of what it still holds. Only fees of fills that
40
+ // happened are charged, so a running position never pays for the exit it has not made.
41
+ //
42
+ // The denominator is cash committed, not market value: each opening fill adds what it paid,
43
+ // each closing fill releases the share of that commitment the quantity it closed was holding,
44
+ // and the peak of that running total is what the return is measured against. So it is not the
45
+ // size the position opened at — a position scaled up afterwards is measured against what it
46
+ // went on to risk — and not the sum of everything it ever opened either, since capital
47
+ // reduced and recommitted counts once rather than twice.
48
+ //
49
+ // Measuring cash rather than market value is deliberate. A market-value denominator can fall
50
+ // below the money actually put in when a position is averaged down, which inflates the
51
+ // return; and no historical price series is kept, so market value could only ever be sampled
52
+ // at the fills themselves.
40
53
  //
41
54
  // Measured only where the window holds both the position's open and the moment the
42
55
  // measurement is taken at: now for a running position, the closing fill for a finished
@@ -46,8 +59,8 @@ const LeaderboardRow = z.object({
46
59
  // Absent when the board could measure none of the account's positions — never "0", which
47
60
  // would claim a break-even trader. An account reaches the board with nothing measurable
48
61
  // when its only trading in the window closed positions opened before it, when a closed
49
- // window left its open positions unpriced, when every position it opened in the window
50
- // closed after it, or when a position recorded no opening size.
62
+ // window left its open positions unpriced, or when every position it opened in the window
63
+ // closed after it.
51
64
  roi: z.string().optional(),
52
65
  // The trader's linked X account, published to every caller — the board names its traders
53
66
  // on the open internet, signed in or not. Absent for an account whose owner has connected
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/types",
3
- "version": "1.30.1",
3
+ "version": "1.31.0",
4
4
  "description": "Pear Protocol Types definitions",
5
5
  "private": false,
6
6
  "type": "module",