@clear-street/studio-sdk 0.1.0-alpha.4
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/CHANGELOG.md +47 -0
- package/LICENSE +201 -0
- package/README.md +288 -0
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/_shims/auto/runtime-bun.d.ts +5 -0
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +101 -0
- package/_shims/auto/types.js +3 -0
- package/_shims/auto/types.mjs +3 -0
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +81 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +90 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +56 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +37 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +41 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +37 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +78 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +71 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +83 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +239 -0
- package/core.d.ts.map +1 -0
- package/core.js +881 -0
- package/core.js.map +1 -0
- package/core.mjs +850 -0
- package/core.mjs.map +1 -0
- package/error.d.ts +53 -0
- package/error.d.ts.map +1 -0
- package/error.js +143 -0
- package/error.js.map +1 -0
- package/error.mjs +127 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +128 -0
- package/index.d.ts +128 -0
- package/index.d.ts.map +1 -0
- package/index.js +112 -0
- package/index.js.map +1 -0
- package/index.mjs +84 -0
- package/index.mjs.map +1 -0
- package/package.json +104 -0
- package/resource.d.ts +6 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +11 -0
- package/resource.js.map +1 -0
- package/resource.mjs +7 -0
- package/resource.mjs.map +1 -0
- package/resources/accounts/accounts.d.ts +74 -0
- package/resources/accounts/accounts.d.ts.map +1 -0
- package/resources/accounts/accounts.js +73 -0
- package/resources/accounts/accounts.js.map +1 -0
- package/resources/accounts/accounts.mjs +46 -0
- package/resources/accounts/accounts.mjs.map +1 -0
- package/resources/accounts/bulk-orders.d.ts +137 -0
- package/resources/accounts/bulk-orders.d.ts.map +1 -0
- package/resources/accounts/bulk-orders.js +29 -0
- package/resources/accounts/bulk-orders.js.map +1 -0
- package/resources/accounts/bulk-orders.mjs +25 -0
- package/resources/accounts/bulk-orders.mjs.map +1 -0
- package/resources/accounts/easy-borrows.d.ts +17 -0
- package/resources/accounts/easy-borrows.d.ts.map +1 -0
- package/resources/accounts/easy-borrows.js +18 -0
- package/resources/accounts/easy-borrows.js.map +1 -0
- package/resources/accounts/easy-borrows.mjs +14 -0
- package/resources/accounts/easy-borrows.mjs.map +1 -0
- package/resources/accounts/index.d.ts +10 -0
- package/resources/accounts/index.d.ts.map +1 -0
- package/resources/accounts/index.js +23 -0
- package/resources/accounts/index.js.map +1 -0
- package/resources/accounts/index.mjs +11 -0
- package/resources/accounts/index.mjs.map +1 -0
- package/resources/accounts/locate-orders.d.ts +56 -0
- package/resources/accounts/locate-orders.d.ts.map +1 -0
- package/resources/accounts/locate-orders.js +39 -0
- package/resources/accounts/locate-orders.js.map +1 -0
- package/resources/accounts/locate-orders.mjs +35 -0
- package/resources/accounts/locate-orders.mjs.map +1 -0
- package/resources/accounts/orders.d.ts +168 -0
- package/resources/accounts/orders.d.ts.map +1 -0
- package/resources/accounts/orders.js +53 -0
- package/resources/accounts/orders.js.map +1 -0
- package/resources/accounts/orders.mjs +49 -0
- package/resources/accounts/orders.mjs.map +1 -0
- package/resources/accounts/pnl-details.d.ts +113 -0
- package/resources/accounts/pnl-details.d.ts.map +1 -0
- package/resources/accounts/pnl-details.js +17 -0
- package/resources/accounts/pnl-details.js.map +1 -0
- package/resources/accounts/pnl-details.mjs +13 -0
- package/resources/accounts/pnl-details.mjs.map +1 -0
- package/resources/accounts/pnl-summary.d.ts +10 -0
- package/resources/accounts/pnl-summary.d.ts.map +1 -0
- package/resources/accounts/pnl-summary.js +15 -0
- package/resources/accounts/pnl-summary.js.map +1 -0
- package/resources/accounts/pnl-summary.mjs +11 -0
- package/resources/accounts/pnl-summary.mjs.map +1 -0
- package/resources/accounts/positions.d.ts +37 -0
- package/resources/accounts/positions.d.ts.map +1 -0
- package/resources/accounts/positions.js +24 -0
- package/resources/accounts/positions.js.map +1 -0
- package/resources/accounts/positions.mjs +20 -0
- package/resources/accounts/positions.mjs.map +1 -0
- package/resources/accounts/trades.d.ts +37 -0
- package/resources/accounts/trades.d.ts.map +1 -0
- package/resources/accounts/trades.js +24 -0
- package/resources/accounts/trades.js.map +1 -0
- package/resources/accounts/trades.mjs +20 -0
- package/resources/accounts/trades.mjs.map +1 -0
- package/resources/entities/entities.d.ts +458 -0
- package/resources/entities/entities.d.ts.map +1 -0
- package/resources/entities/entities.js +61 -0
- package/resources/entities/entities.js.map +1 -0
- package/resources/entities/entities.mjs +34 -0
- package/resources/entities/entities.mjs.map +1 -0
- package/resources/entities/index.d.ts +6 -0
- package/resources/entities/index.d.ts.map +1 -0
- package/resources/entities/index.js +15 -0
- package/resources/entities/index.js.map +1 -0
- package/resources/entities/index.mjs +7 -0
- package/resources/entities/index.mjs.map +1 -0
- package/resources/entities/pnl-summaries.d.ts +10 -0
- package/resources/entities/pnl-summaries.d.ts.map +1 -0
- package/resources/entities/pnl-summaries.js +15 -0
- package/resources/entities/pnl-summaries.js.map +1 -0
- package/resources/entities/pnl-summaries.mjs +11 -0
- package/resources/entities/pnl-summaries.mjs.map +1 -0
- package/resources/entities/portfolio-margins.d.ts +10 -0
- package/resources/entities/portfolio-margins.d.ts.map +1 -0
- package/resources/entities/portfolio-margins.js +15 -0
- package/resources/entities/portfolio-margins.js.map +1 -0
- package/resources/entities/portfolio-margins.mjs +11 -0
- package/resources/entities/portfolio-margins.mjs.map +1 -0
- package/resources/entities/regt-margin-simulations.d.ts +97 -0
- package/resources/entities/regt-margin-simulations.d.ts.map +1 -0
- package/resources/entities/regt-margin-simulations.js +30 -0
- package/resources/entities/regt-margin-simulations.js.map +1 -0
- package/resources/entities/regt-margin-simulations.mjs +26 -0
- package/resources/entities/regt-margin-simulations.mjs.map +1 -0
- package/resources/entities/regt-margins.d.ts +10 -0
- package/resources/entities/regt-margins.d.ts.map +1 -0
- package/resources/entities/regt-margins.js +15 -0
- package/resources/entities/regt-margins.js.map +1 -0
- package/resources/entities/regt-margins.mjs +11 -0
- package/resources/entities/regt-margins.mjs.map +1 -0
- package/resources/index.d.ts +5 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +26 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +6 -0
- package/resources/index.mjs.map +1 -0
- package/resources/instruments.d.ts +45 -0
- package/resources/instruments.d.ts.map +1 -0
- package/resources/instruments.js +18 -0
- package/resources/instruments.js.map +1 -0
- package/resources/instruments.mjs +14 -0
- package/resources/instruments.mjs.map +1 -0
- package/resources/shared.d.ts +251 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +4 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +3 -0
- package/resources/shared.mjs.map +1 -0
- package/shims/node.d.ts +29 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +101 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +81 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +83 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +67 -0
- package/src/_shims/web-runtime.ts +103 -0
- package/src/_shims/web-types.d.ts +83 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +1165 -0
- package/src/error.ts +146 -0
- package/src/index.ts +206 -0
- package/src/lib/.keep +4 -0
- package/src/resource.ts +11 -0
- package/src/resources/accounts/accounts.ts +87 -0
- package/src/resources/accounts/bulk-orders.ts +163 -0
- package/src/resources/accounts/easy-borrows.ts +23 -0
- package/src/resources/accounts/index.ts +25 -0
- package/src/resources/accounts/locate-orders.ts +94 -0
- package/src/resources/accounts/orders.ts +246 -0
- package/src/resources/accounts/pnl-details.ts +143 -0
- package/src/resources/accounts/pnl-summary.ts +14 -0
- package/src/resources/accounts/positions.ts +66 -0
- package/src/resources/accounts/trades.ts +62 -0
- package/src/resources/entities/entities.ts +562 -0
- package/src/resources/entities/index.ts +12 -0
- package/src/resources/entities/pnl-summaries.ts +14 -0
- package/src/resources/entities/portfolio-margins.ts +14 -0
- package/src/resources/entities/regt-margin-simulations.ts +127 -0
- package/src/resources/entities/regt-margins.ts +14 -0
- package/src/resources/index.ts +13 -0
- package/src/resources/instruments.ts +70 -0
- package/src/resources/shared.ts +320 -0
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +248 -0
- package/src/version.ts +1 -0
- package/uploads.d.ts +75 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +165 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +152 -0
- package/uploads.mjs.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from "../../resource";
|
|
4
|
+
import * as Core from "../../core";
|
|
5
|
+
import * as EntitiesAPI from "./entities";
|
|
6
|
+
import * as PnlSummariesAPI from "./pnl-summaries";
|
|
7
|
+
import * as PortfolioMarginsAPI from "./portfolio-margins";
|
|
8
|
+
import * as RegtMarginSimulationsAPI from "./regt-margin-simulations";
|
|
9
|
+
import * as RegtMarginsAPI from "./regt-margins";
|
|
10
|
+
|
|
11
|
+
export class Entities extends APIResource {
|
|
12
|
+
pnlSummaries: PnlSummariesAPI.PnlSummaries = new PnlSummariesAPI.PnlSummaries(this._client);
|
|
13
|
+
regtMargins: RegtMarginsAPI.RegtMargins = new RegtMarginsAPI.RegtMargins(this._client);
|
|
14
|
+
portfolioMargins: PortfolioMarginsAPI.PortfolioMargins = new PortfolioMarginsAPI.PortfolioMargins(
|
|
15
|
+
this._client,
|
|
16
|
+
);
|
|
17
|
+
regtMarginSimulations: RegtMarginSimulationsAPI.RegtMarginSimulations =
|
|
18
|
+
new RegtMarginSimulationsAPI.RegtMarginSimulations(this._client);
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Get an entity by its ID.
|
|
22
|
+
*/
|
|
23
|
+
retrieve(entityId: string, options?: Core.RequestOptions): Core.APIPromise<Entity> {
|
|
24
|
+
return this._client.get(`/entities/${entityId}`, options);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* List all available entities.
|
|
29
|
+
*/
|
|
30
|
+
list(options?: Core.RequestOptions): Core.APIPromise<EntityListResponse> {
|
|
31
|
+
return this._client.get('/entities', options);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface Entity {
|
|
36
|
+
client_code: string;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Entity ID for the legal entity.
|
|
40
|
+
*/
|
|
41
|
+
entity_id: string;
|
|
42
|
+
|
|
43
|
+
legal_name?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface PnlSummary {
|
|
47
|
+
/**
|
|
48
|
+
* Profit and loss from intraday trading activities.
|
|
49
|
+
*/
|
|
50
|
+
day_pnl: number;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Entity ID for the legal entity.
|
|
54
|
+
*/
|
|
55
|
+
entity_id: string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Net value of instruments held in the portfolio.
|
|
59
|
+
*/
|
|
60
|
+
equity: number;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Absolute market value of long and short market values.
|
|
64
|
+
*/
|
|
65
|
+
gross_market_value: number;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Market value of securities positioned long.
|
|
69
|
+
*/
|
|
70
|
+
long_market_value: number;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Market value net of long and short market values.
|
|
74
|
+
*/
|
|
75
|
+
net_market_value: number;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* `total_pnl + total_fees`
|
|
79
|
+
*/
|
|
80
|
+
net_pnl: number;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Profit and loss from previous trading date.
|
|
84
|
+
*/
|
|
85
|
+
overnight_pnl: number;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Profit and loss realized from position closing trading activity
|
|
89
|
+
*/
|
|
90
|
+
realized_pnl: number;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Market value of securities positioned short.
|
|
94
|
+
*/
|
|
95
|
+
short_market_value: number;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Net value of instruments held in the portfolio at the start of a trading day.
|
|
99
|
+
*/
|
|
100
|
+
sod_equity: number;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Absolute market value at the start of a trading day.
|
|
104
|
+
*/
|
|
105
|
+
sod_gross_market_value: number;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Market value of securities positioned long at the start of a trading day.
|
|
109
|
+
*/
|
|
110
|
+
sod_long_market_value: number;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Market value of securities positioned short at the start of a trading day.
|
|
114
|
+
*/
|
|
115
|
+
sod_short_market_value: number;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Milliseconds since epoch.
|
|
119
|
+
*/
|
|
120
|
+
timestamp: number;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Total fees incurred from trading activities.
|
|
124
|
+
*/
|
|
125
|
+
total_fees: number;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* `realized_pnl + unrealized_pnl`
|
|
129
|
+
*/
|
|
130
|
+
total_pnl: number;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Profit and loss from market changes.
|
|
134
|
+
*/
|
|
135
|
+
unrealized_pnl: number;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface PortfolioMargin {
|
|
139
|
+
/**
|
|
140
|
+
* Sum of add-on margin requirements. Formula:
|
|
141
|
+
* `liquidity_add_on + concentration_add_on + discretionary_requirement`
|
|
142
|
+
*/
|
|
143
|
+
add_on_requirement?: number;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* The percentage add-on margin requirements in terms of total house requirement.
|
|
147
|
+
* Formula: `add_on_requirement / house_requirement`
|
|
148
|
+
*/
|
|
149
|
+
add_on_requirement_percent?: number;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* A component margin requirement that captures risk based on gross exposure to
|
|
153
|
+
* total equity.
|
|
154
|
+
*/
|
|
155
|
+
concentration_add_on?: number;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* The percentage concentration add-on margin requirements in terms of total house
|
|
159
|
+
* requirement. Formula: `concentration_add_on / house_requirement`
|
|
160
|
+
*/
|
|
161
|
+
concentration_add_on_percent?: number;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* A component margin requirement that captures miscellaneous risk factors.
|
|
165
|
+
*/
|
|
166
|
+
discretionary_requirement?: number;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* The percentage discretionary margin requirements in terms of total house
|
|
170
|
+
* requirement Formula: `discretionary_requirement / house_requirement`
|
|
171
|
+
*/
|
|
172
|
+
discretionary_requirement_percent?: number;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* The maring amount by taking the difference between total equity and the
|
|
176
|
+
* effective requirement. A negative number reflects an effective margin deficit.
|
|
177
|
+
*/
|
|
178
|
+
effecive_excess?: number;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* The enforced margin requirement in effect.
|
|
182
|
+
*/
|
|
183
|
+
effective_requirement?: number;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Portfolio margin groups
|
|
187
|
+
*/
|
|
188
|
+
groups?: Array<PortfolioMargin.Group>;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* The margin amount by taking the difference between total equity and the house
|
|
192
|
+
* requirement. A negative number reflects a house margin deficit.
|
|
193
|
+
*/
|
|
194
|
+
house_excess?: number;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Margin requirements based on Clear Street's house margin methodology.
|
|
198
|
+
*/
|
|
199
|
+
house_requirement?: number;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* A component margin requirement that captures risk based on liquidity, Market
|
|
203
|
+
* Cap, and Average Daily Volume factors.
|
|
204
|
+
*/
|
|
205
|
+
liquidity_add_on?: number;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* The percentage liquidity add-on margin requirements in terms of total house
|
|
209
|
+
* requirement. Formula: `liquidity_add_on / house_requirement`
|
|
210
|
+
*/
|
|
211
|
+
liquidity_add_on_percent?: number;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Sum of market values across all positions.
|
|
215
|
+
*/
|
|
216
|
+
net_market_value?: number;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* A component margin requirement that captures risk for security instruments that
|
|
220
|
+
* are not margin eligible.
|
|
221
|
+
*/
|
|
222
|
+
non_marginable_requirement?: number;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* The percentage non-marginable requirement in terms of total house requirement
|
|
226
|
+
* Formula: `non_marginable_requirement / house_requirement`
|
|
227
|
+
*/
|
|
228
|
+
non_marginable_requirement_percent?: number;
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* A component margin requirement that captures base-case risk under house margin
|
|
232
|
+
* methodology.
|
|
233
|
+
*/
|
|
234
|
+
risk_based_requirement?: number;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* The percentage risk_base margin requirement in terms of total house requirement
|
|
238
|
+
* Formula: `risk_based_requirement / house_requirement`
|
|
239
|
+
*/
|
|
240
|
+
risk_based_requirement_percent?: number;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Timestamp of when this margin was calculated.
|
|
244
|
+
*/
|
|
245
|
+
timestamp?: number;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* A component margin requirement that captures risk based on vega.
|
|
249
|
+
*/
|
|
250
|
+
vega_requirement?: number;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Unique identifier for this margin calculation.
|
|
254
|
+
*/
|
|
255
|
+
version?: string;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export namespace PortfolioMargin {
|
|
259
|
+
export interface Group {
|
|
260
|
+
/**
|
|
261
|
+
* The enforced margin requirement in effect for the group.
|
|
262
|
+
*/
|
|
263
|
+
effective_requirement: number;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* The percentage effective margin requirement in terms of the group market value.
|
|
267
|
+
* Formula: `(effective_requirement / net_market_value)`
|
|
268
|
+
*/
|
|
269
|
+
margin_percent: number;
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* The percentage effective margin requirement in terms of the total effective
|
|
273
|
+
* requirement. Formula: `(effective_requirement / sum(effective_requirement))`
|
|
274
|
+
*/
|
|
275
|
+
margin_percent_contribution: number;
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* The aggregated market value of all instruments for the group.
|
|
279
|
+
*/
|
|
280
|
+
market_value: number;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* The percentage market value of the group in terms of the total net_market_value
|
|
284
|
+
* of all positions. Formula: `(market_value / net_market_value)`
|
|
285
|
+
*/
|
|
286
|
+
market_value_percent: number;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* A list of securities that comprise this group.
|
|
290
|
+
*/
|
|
291
|
+
members: Array<Group.Member>;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Unique name of the group, typically the symbol of the underlier.
|
|
295
|
+
*/
|
|
296
|
+
name: string;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* A component margin requirement that captures risk for the group based on gross
|
|
300
|
+
* exposure to total equity
|
|
301
|
+
*/
|
|
302
|
+
concentration_requirement?: number;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* A component margin requirement that captures miscellaneous risk factors for the
|
|
306
|
+
* group.
|
|
307
|
+
*/
|
|
308
|
+
discretionary_requirement?: number;
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* A component margin requirement that captures risk for the group based on
|
|
312
|
+
* liquidity, Market Cap, and Average Daily Volume factors.
|
|
313
|
+
*/
|
|
314
|
+
liquidity_requirement?: number;
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* A component margin requirement that captures risk for the group that are not
|
|
318
|
+
* margin eligible.
|
|
319
|
+
*/
|
|
320
|
+
non_marginable_requirement?: number;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Margin requirements based on OCC TIMS regulatory margin methodology
|
|
324
|
+
*/
|
|
325
|
+
regulatory_requirement?: number;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* A component margin requirement that captures base-case risk for the group under
|
|
329
|
+
* house margin methodology
|
|
330
|
+
*/
|
|
331
|
+
risk_based_requirement?: number;
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Maps shock scenarios to their resulting pnl.
|
|
335
|
+
*/
|
|
336
|
+
shocks?: Record<string, number>;
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Margin requirements based on value-at-risk over any 5-day period in a 2 year
|
|
340
|
+
* historic lookback
|
|
341
|
+
*/
|
|
342
|
+
var_requirement?: number;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
export namespace Group {
|
|
346
|
+
export interface Member {
|
|
347
|
+
/**
|
|
348
|
+
* The asset class of the symbol.
|
|
349
|
+
*/
|
|
350
|
+
asset_class?: 'other' | 'equity' | 'option' | 'debt';
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* Market value of the instrument.
|
|
354
|
+
*/
|
|
355
|
+
market_value?: number;
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* The percentage market value of the instrument in terms of the total
|
|
359
|
+
* `net_market_value` of all positions held. Formula:
|
|
360
|
+
* `market_value / net_market_value`
|
|
361
|
+
*/
|
|
362
|
+
market_value_percent?: number;
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* The quantity held for this instrument.
|
|
366
|
+
*/
|
|
367
|
+
quantity?: string;
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Maps shock scenarios to their resulting pnl.
|
|
371
|
+
*/
|
|
372
|
+
shocks?: Record<string, number>;
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* The symbol for the instrument.
|
|
376
|
+
*/
|
|
377
|
+
symbol?: string;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
export interface RegtMargin {
|
|
383
|
+
/**
|
|
384
|
+
* The remaining amount of start_of_day_buying_power that captures any day-trading
|
|
385
|
+
* activity.
|
|
386
|
+
*/
|
|
387
|
+
day_trade_buying_power: number;
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* The enforced margin requirement in effect.
|
|
391
|
+
*/
|
|
392
|
+
effective_requirement: number;
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* Margin requirements based on regulatory rules.
|
|
396
|
+
*/
|
|
397
|
+
exchange_requirement: number;
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Reg-T margin groups
|
|
401
|
+
*/
|
|
402
|
+
groups: Array<RegtMargin.Group>;
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* The margin amount by taking the difference between total equity and the house
|
|
406
|
+
* requirement. A negative number reflects a house margin deficit.
|
|
407
|
+
*/
|
|
408
|
+
house_excess: number;
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Margin requirements based on Clear Street's house margin methodology.
|
|
412
|
+
*/
|
|
413
|
+
house_requirement: number;
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Market value net of long and short market values.
|
|
417
|
+
*/
|
|
418
|
+
net_market_value: number;
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* The limit, or "up-to" amount, of securities value that can be purchased and held
|
|
422
|
+
* overnight.
|
|
423
|
+
*/
|
|
424
|
+
overnight_buying_power: number;
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Special Memorandum Account (SMA). The regulatory line of credit amount for
|
|
428
|
+
* margin trading based on market value, trading activity, and available cash.
|
|
429
|
+
*/
|
|
430
|
+
sma: number;
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* The limit, or "up-to" amount, of securities value that can be day-traded for a
|
|
434
|
+
* given trading day.
|
|
435
|
+
*/
|
|
436
|
+
sod_buying_power: number;
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* Timestamp of when this margin was calculated.
|
|
440
|
+
*/
|
|
441
|
+
timestamp: number;
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Unique identifier for this margin calculation.
|
|
445
|
+
*/
|
|
446
|
+
version: string;
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* The maring amount by taking the difference between total equity and the
|
|
450
|
+
* effective requirement. A negative number reflects an effective margin deficit.
|
|
451
|
+
*/
|
|
452
|
+
effective_excess?: number;
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* The margin amount by taking the difference between total equity and the exchange
|
|
456
|
+
* requirement. A negative number reflects an regulatory margin deficit.
|
|
457
|
+
*/
|
|
458
|
+
exchange_excess?: number;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
export namespace RegtMargin {
|
|
462
|
+
export interface Group {
|
|
463
|
+
/**
|
|
464
|
+
* The enforced margin requirement in effect for the symbol group.
|
|
465
|
+
*/
|
|
466
|
+
effective_requirement: number;
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* Margin requirements based on regulatory rules for the symbol group.
|
|
470
|
+
*/
|
|
471
|
+
exchange_requirement: number;
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Margin requirements based on Clear Street's house margin methodology for the
|
|
475
|
+
* symbol group.
|
|
476
|
+
*/
|
|
477
|
+
house_requirement: number;
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* The percentage effective margin requirement in terms of the symbol group market
|
|
481
|
+
* value. Formula: `(effective_requirement / net_market_value)`
|
|
482
|
+
*/
|
|
483
|
+
margin_percent: number;
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* The percentage effective margin requirement in terms of the total effective
|
|
487
|
+
* requirement. Formula: `(effective_requirement / sum(effective_requirement))`
|
|
488
|
+
*/
|
|
489
|
+
margin_percent_contribution: number;
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* The aggregated market value of all instruments for the symbol group.
|
|
493
|
+
*/
|
|
494
|
+
market_value: number;
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* The percentage market value of the symbol group in terms of the total
|
|
498
|
+
* net_market_value of all positions. Formula: `(market_value / net_market_value)`
|
|
499
|
+
*/
|
|
500
|
+
market_value_percent: number;
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* A list of securities that comprise this group.
|
|
504
|
+
*/
|
|
505
|
+
members: Array<Group.Member>;
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Unique name of the group, typically the symbol of the underlier.
|
|
509
|
+
*/
|
|
510
|
+
name: string;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
export namespace Group {
|
|
514
|
+
export interface Member {
|
|
515
|
+
/**
|
|
516
|
+
* The asset class of the symbol.
|
|
517
|
+
*/
|
|
518
|
+
asset_class: 'other' | 'equity' | 'option' | 'debt';
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Market value of the instrument.
|
|
522
|
+
*/
|
|
523
|
+
market_value: number;
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* The percentage market value of the instrument in terms of the total
|
|
527
|
+
* `net_market_value` of all positions held. Formula:
|
|
528
|
+
* `market_value / net_market_value`
|
|
529
|
+
*/
|
|
530
|
+
market_value_percent: number;
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* The quantity held for this instrument.
|
|
534
|
+
*/
|
|
535
|
+
quantity: string;
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* The symbol for the instrument.
|
|
539
|
+
*/
|
|
540
|
+
symbol: string;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
export interface EntityListResponse {
|
|
546
|
+
data?: Array<Entity>;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
export namespace Entities {
|
|
550
|
+
export import Entity = EntitiesAPI.Entity;
|
|
551
|
+
export import PnlSummary = EntitiesAPI.PnlSummary;
|
|
552
|
+
export import PortfolioMargin = EntitiesAPI.PortfolioMargin;
|
|
553
|
+
export import RegtMargin = EntitiesAPI.RegtMargin;
|
|
554
|
+
export import EntityListResponse = EntitiesAPI.EntityListResponse;
|
|
555
|
+
export import PnlSummaries = PnlSummariesAPI.PnlSummaries;
|
|
556
|
+
export import RegtMargins = RegtMarginsAPI.RegtMargins;
|
|
557
|
+
export import PortfolioMargins = PortfolioMarginsAPI.PortfolioMargins;
|
|
558
|
+
export import RegtMarginSimulations = RegtMarginSimulationsAPI.RegtMarginSimulations;
|
|
559
|
+
export import SimulationID = RegtMarginSimulationsAPI.SimulationID;
|
|
560
|
+
export import RegtMarginSimulationCreateResponse = RegtMarginSimulationsAPI.RegtMarginSimulationCreateResponse;
|
|
561
|
+
export import RegtMarginSimulationCreateParams = RegtMarginSimulationsAPI.RegtMarginSimulationCreateParams;
|
|
562
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export { Entity, PnlSummary, PortfolioMargin, RegtMargin, EntityListResponse, Entities } from './entities';
|
|
4
|
+
export { PnlSummaries } from './pnl-summaries';
|
|
5
|
+
export { PortfolioMargins } from './portfolio-margins';
|
|
6
|
+
export { RegtMargins } from './regt-margins';
|
|
7
|
+
export {
|
|
8
|
+
SimulationID,
|
|
9
|
+
RegtMarginSimulationCreateResponse,
|
|
10
|
+
RegtMarginSimulationCreateParams,
|
|
11
|
+
RegtMarginSimulations,
|
|
12
|
+
} from './regt-margin-simulations';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from "../../resource";
|
|
4
|
+
import * as Core from "../../core";
|
|
5
|
+
import * as EntitiesAPI from "./entities";
|
|
6
|
+
|
|
7
|
+
export class PnlSummaries extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Get PNL summary for all accounts in an entity.
|
|
10
|
+
*/
|
|
11
|
+
retrieve(entityId: string, options?: Core.RequestOptions): Core.APIPromise<EntitiesAPI.PnlSummary> {
|
|
12
|
+
return this._client.get(`/entities/${entityId}/pnl-summary`, options);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from "../../resource";
|
|
4
|
+
import * as Core from "../../core";
|
|
5
|
+
import * as EntitiesAPI from "./entities";
|
|
6
|
+
|
|
7
|
+
export class PortfolioMargins extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Get latest portfolio margin calculation for the given entity
|
|
10
|
+
*/
|
|
11
|
+
retrieve(entityId: string, options?: Core.RequestOptions): Core.APIPromise<EntitiesAPI.PortfolioMargin> {
|
|
12
|
+
return this._client.get(`/entities/${entityId}/portfolio-margin`, options);
|
|
13
|
+
}
|
|
14
|
+
}
|