@pear-protocol/utils 0.0.22 → 0.1.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.
- package/dist/asset/asset.types.d.ts +1 -0
- package/dist/asset/compute.d.ts +9 -1
- package/dist/asset/compute.test.d.ts +1 -0
- package/dist/fills/compute.test.d.ts +1 -0
- package/dist/fills/fill.types.d.ts +1 -0
- package/dist/fills/index.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1382 -308
- package/dist/math/decimal.d.ts +57 -0
- package/dist/math/decimal.test.d.ts +1 -0
- package/dist/math/index.d.ts +2 -0
- package/dist/position/compute.test.d.ts +1 -0
- package/dist/position/index.d.ts +1 -0
- package/dist/position/key.d.ts +15 -0
- package/dist/precise-price.d.ts +5 -0
- package/dist/precise-quantity.d.ts +4 -0
- package/dist/sync/applicables/basket.d.ts +42 -0
- package/dist/sync/applicables/basket.test.d.ts +1 -0
- package/dist/sync/applicables/constants.d.ts +19 -0
- package/dist/sync/applicables/exposure.d.ts +47 -0
- package/dist/sync/applicables/exposure.test.d.ts +1 -0
- package/dist/sync/applicables/fills.d.ts +16 -0
- package/dist/sync/applicables/fills.test.d.ts +1 -0
- package/dist/sync/applicables/index.d.ts +34 -0
- package/dist/sync/applicables/index.test.d.ts +1 -0
- package/dist/sync/applicables/matching.d.ts +17 -0
- package/dist/sync/applicables/matching.test.d.ts +1 -0
- package/dist/sync/applicables/position.d.ts +17 -0
- package/dist/sync/applicables/position.test.d.ts +1 -0
- package/dist/sync/applicables/snapshot.d.ts +41 -0
- package/dist/sync/applicables/synthetics.d.ts +52 -0
- package/dist/sync/applicables/synthetics.test.d.ts +1 -0
- package/dist/sync/applicables/types.d.ts +77 -0
- package/dist/sync/compute.d.ts +23 -9
- package/dist/sync/cutoff.d.ts +35 -0
- package/dist/sync/cutoff.test.d.ts +1 -0
- package/dist/sync/index.d.ts +1 -1
- package/dist/sync/types.d.ts +12 -13
- package/dist/validate-leverage.d.ts +3 -0
- package/dist/validate-quantity.d.ts +4 -0
- package/package.json +3 -2
package/dist/asset/compute.d.ts
CHANGED
|
@@ -20,9 +20,17 @@ export declare function computeAssetUnrealizedPnL(signedQuantity: BigNumber, cur
|
|
|
20
20
|
* Compute realized gross PnL for a SINGLE asset.
|
|
21
21
|
*
|
|
22
22
|
* Realized trading PnL is accumulated when a fill reduces an existing
|
|
23
|
-
* position (using FIFO-style average entry), excluding fees.
|
|
23
|
+
* position (using FIFO-style average entry), excluding fees. Quantity with an
|
|
24
|
+
* unpriced (0-price synthetic) entry or exit contributes 0 — its size is
|
|
25
|
+
* surfaced via computeAssetUndeterminedSizes.
|
|
24
26
|
*/
|
|
25
27
|
export declare function computeAssetGrossRealizedPnL(fills: Fill[]): BigNumber;
|
|
28
|
+
/**
|
|
29
|
+
* Per-asset quantity whose realized PnL is unpriceable — closed by a 0-price
|
|
30
|
+
* gone-close synthetic, or closed against a 0-price synthetic entry. For UI
|
|
31
|
+
* display alongside realized PnL. Symbols with no such quantity are omitted.
|
|
32
|
+
*/
|
|
33
|
+
export declare function computeAssetUndeterminedSizes(fills: Fill[]): Record<InstrumentId, BigNumber>;
|
|
26
34
|
/**
|
|
27
35
|
* Compute unrealized PnL for an entire position.
|
|
28
36
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/fills/index.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export * from './asset/index';
|
|
|
2
2
|
export * from './basket/index';
|
|
3
3
|
export * from './contract-size';
|
|
4
4
|
export * from './fills/index';
|
|
5
|
-
export
|
|
5
|
+
export * from './math/index';
|
|
6
6
|
export * from './position/index';
|
|
7
7
|
export * from './precise-price';
|
|
8
8
|
export * from './precise-quantity';
|