@secapi/cli 0.3.1 → 0.4.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/README.md +156 -0
- package/dist/index.js +3391 -191
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
// src/index.ts
|
|
4
|
+
import { readFileSync } from "node:fs";
|
|
5
|
+
|
|
3
6
|
// src/generated-contracts/agent-prompts.ts
|
|
4
7
|
var AGENT_PROMPT_PERSONAS = [
|
|
5
8
|
"law-firm",
|
|
@@ -15295,12 +15298,23 @@ var responseMetadataSchema = exports_external.object({
|
|
|
15295
15298
|
requestId: exports_external.string(),
|
|
15296
15299
|
traceparent: exports_external.string().nullable().optional()
|
|
15297
15300
|
});
|
|
15301
|
+
var freshnessStatusSchema = exports_external.enum([
|
|
15302
|
+
"fresh",
|
|
15303
|
+
"current",
|
|
15304
|
+
"archival",
|
|
15305
|
+
"stale",
|
|
15306
|
+
"degraded",
|
|
15307
|
+
"unknown"
|
|
15308
|
+
]);
|
|
15298
15309
|
var freshnessMetadataSchema = exports_external.object({
|
|
15299
|
-
status:
|
|
15310
|
+
status: freshnessStatusSchema,
|
|
15300
15311
|
asOf: exports_external.string(),
|
|
15301
15312
|
sourcePublishedAt: exports_external.string().nullable().optional(),
|
|
15302
15313
|
lagMs: exports_external.number().int().nonnegative().nullable().optional()
|
|
15303
15314
|
});
|
|
15315
|
+
var DEFAULT_FILING_FRESH_MS = 24 * 60 * 60 * 1000;
|
|
15316
|
+
var DEFAULT_FILING_DEGRADED_MS = 72 * 60 * 60 * 1000;
|
|
15317
|
+
var DEFAULT_FILING_ARCHIVAL_AGE_MS = 30 * 24 * 60 * 60 * 1000;
|
|
15304
15318
|
var materializationMetadataSchema = exports_external.object({
|
|
15305
15319
|
parserVersion: exports_external.string(),
|
|
15306
15320
|
materializationVersion: exports_external.string()
|
|
@@ -15407,7 +15421,7 @@ var validationStatusSchema = exports_external.object({
|
|
|
15407
15421
|
var dataQualityFreshnessSchema = exports_external.object({
|
|
15408
15422
|
latestObservationAt: exports_external.string().nullable(),
|
|
15409
15423
|
averageLagMs: exports_external.number().nonnegative().nullable(),
|
|
15410
|
-
status:
|
|
15424
|
+
status: freshnessStatusSchema,
|
|
15411
15425
|
observationCount: exports_external.number().int().nonnegative()
|
|
15412
15426
|
});
|
|
15413
15427
|
var dataQualityCompletenessSchema = exports_external.object({
|
|
@@ -15583,6 +15597,21 @@ var statementRowSchema = exports_external.object({
|
|
|
15583
15597
|
unit: exports_external.string().nullable(),
|
|
15584
15598
|
values: exports_external.array(statementValueSchema)
|
|
15585
15599
|
});
|
|
15600
|
+
var compactStatementRowSchema = exports_external.object({
|
|
15601
|
+
key: exports_external.string().nullable(),
|
|
15602
|
+
label: exports_external.string().nullable().optional(),
|
|
15603
|
+
unit: exports_external.string().nullable(),
|
|
15604
|
+
values: exports_external.array(exports_external.number().nullable())
|
|
15605
|
+
});
|
|
15606
|
+
var compactStatementSchema = exports_external.object({
|
|
15607
|
+
ticker: exports_external.string().nullable(),
|
|
15608
|
+
statementKey: exports_external.string().nullable(),
|
|
15609
|
+
period: exports_external.enum(["annual", "quarterly"]).nullable(),
|
|
15610
|
+
periods: exports_external.array(statementPeriodSchema),
|
|
15611
|
+
rows: exports_external.array(compactStatementRowSchema),
|
|
15612
|
+
requestId: exports_external.string().optional(),
|
|
15613
|
+
traceparent: exports_external.string().nullable().optional()
|
|
15614
|
+
});
|
|
15586
15615
|
var statementSchema = exports_external.object({
|
|
15587
15616
|
object: exports_external.literal("statement"),
|
|
15588
15617
|
id: exports_external.string(),
|
|
@@ -16897,6 +16926,14 @@ var billingBudgetSchema = exports_external.object({
|
|
|
16897
16926
|
hardCapReached: exports_external.boolean(),
|
|
16898
16927
|
lineItems: exports_external.array(billingBudgetLineItemSchema)
|
|
16899
16928
|
});
|
|
16929
|
+
var monthlyQuotaSnapshotSchema = exports_external.object({
|
|
16930
|
+
family: exports_external.string(),
|
|
16931
|
+
limit: exports_external.number().int(),
|
|
16932
|
+
used: exports_external.number().int(),
|
|
16933
|
+
remaining: exports_external.number().int(),
|
|
16934
|
+
resetAt: exports_external.string(),
|
|
16935
|
+
graceUntil: exports_external.string().nullable()
|
|
16936
|
+
});
|
|
16900
16937
|
var billingBudgetGateSchema = exports_external.object({
|
|
16901
16938
|
code: exports_external.string(),
|
|
16902
16939
|
status: exports_external.number().int(),
|
|
@@ -16924,6 +16961,7 @@ var billingAccountSchema = exports_external.object({
|
|
|
16924
16961
|
plans: exports_external.array(billingPlanSchema),
|
|
16925
16962
|
settlement: billingSettlementSchema,
|
|
16926
16963
|
budget: billingBudgetSchema,
|
|
16964
|
+
monthlyQuotas: exports_external.record(exports_external.string(), monthlyQuotaSnapshotSchema),
|
|
16927
16965
|
requestId: exports_external.string().optional()
|
|
16928
16966
|
});
|
|
16929
16967
|
var billingQuoteSchema = exports_external.object({
|
|
@@ -16975,6 +17013,75 @@ var dashboardPrincipalSchema = exports_external.object({
|
|
|
16975
17013
|
scopes: exports_external.array(exports_external.string()),
|
|
16976
17014
|
livemode: exports_external.boolean()
|
|
16977
17015
|
}).passthrough();
|
|
17016
|
+
var dashboardSettingsPrincipalSchema = exports_external.object({
|
|
17017
|
+
principalId: exports_external.string(),
|
|
17018
|
+
subject: exports_external.string(),
|
|
17019
|
+
orgId: exports_external.string().nullable(),
|
|
17020
|
+
authMode: exports_external.string(),
|
|
17021
|
+
scopes: exports_external.array(exports_external.string()),
|
|
17022
|
+
livemode: exports_external.boolean()
|
|
17023
|
+
});
|
|
17024
|
+
var dashboardOverviewSummarySchema = exports_external.object({
|
|
17025
|
+
object: exports_external.literal("dashboard_overview_summary"),
|
|
17026
|
+
recordedAt: exports_external.string(),
|
|
17027
|
+
privateBeta: exports_external.object({
|
|
17028
|
+
object: exports_external.literal("dashboard_auth_gate_state"),
|
|
17029
|
+
privateBetaEnabled: exports_external.boolean(),
|
|
17030
|
+
publicSignupEnabled: exports_external.boolean(),
|
|
17031
|
+
authkitConfigured: exports_external.boolean(),
|
|
17032
|
+
clientIdConfigured: exports_external.boolean(),
|
|
17033
|
+
workosConfigured: exports_external.boolean(),
|
|
17034
|
+
loginEnabled: exports_external.boolean(),
|
|
17035
|
+
signupEnabled: exports_external.boolean()
|
|
17036
|
+
}),
|
|
17037
|
+
capabilities: exports_external.object({
|
|
17038
|
+
authMode: exports_external.string(),
|
|
17039
|
+
canManageApiKeys: exports_external.boolean(),
|
|
17040
|
+
canCreateApiKeys: exports_external.boolean(),
|
|
17041
|
+
canManageBilling: exports_external.boolean(),
|
|
17042
|
+
acceptedApiKeyManagementScopes: exports_external.array(exports_external.string()),
|
|
17043
|
+
acceptedBillingManagementScopes: exports_external.array(exports_external.string())
|
|
17044
|
+
}),
|
|
17045
|
+
apiKeys: exports_external.object({
|
|
17046
|
+
activeCount: exports_external.number().int(),
|
|
17047
|
+
revokedCount: exports_external.number().int(),
|
|
17048
|
+
totalCount: exports_external.number().int(),
|
|
17049
|
+
activeKeyLimit: exports_external.number().int(),
|
|
17050
|
+
remainingCreateCount: exports_external.number().int()
|
|
17051
|
+
}),
|
|
17052
|
+
usage: exports_external.object({
|
|
17053
|
+
totalRequests: exports_external.number().int(),
|
|
17054
|
+
successCount: exports_external.number().int(),
|
|
17055
|
+
errorCount: exports_external.number().int(),
|
|
17056
|
+
errorRate: exports_external.number(),
|
|
17057
|
+
lastSeenAt: exports_external.string().nullable(),
|
|
17058
|
+
topMeters: usageSummarySchema.shape.meters
|
|
17059
|
+
}),
|
|
17060
|
+
billing: exports_external.object({
|
|
17061
|
+
publicPlanKey: exports_external.string(),
|
|
17062
|
+
billingState: exports_external.string(),
|
|
17063
|
+
rightsKey: exports_external.string(),
|
|
17064
|
+
cardOnFile: exports_external.boolean(),
|
|
17065
|
+
cardRequired: exports_external.boolean(),
|
|
17066
|
+
freeGrant: exports_external.object({
|
|
17067
|
+
total: exports_external.number().int(),
|
|
17068
|
+
used: exports_external.number().int(),
|
|
17069
|
+
remaining: exports_external.number().int()
|
|
17070
|
+
}),
|
|
17071
|
+
monthlyQuotas: exports_external.record(exports_external.string(), monthlyQuotaSnapshotSchema),
|
|
17072
|
+
budget: billingBudgetSchema,
|
|
17073
|
+
settlementStatus: exports_external.string(),
|
|
17074
|
+
nextRecommendedPlan: exports_external.string().nullable(),
|
|
17075
|
+
subscriptionStatus: exports_external.string().nullable(),
|
|
17076
|
+
currentPeriodEnd: exports_external.string().nullable()
|
|
17077
|
+
}),
|
|
17078
|
+
actions: exports_external.array(exports_external.object({
|
|
17079
|
+
id: exports_external.string(),
|
|
17080
|
+
label: exports_external.string(),
|
|
17081
|
+
enabled: exports_external.boolean(),
|
|
17082
|
+
reason: exports_external.string().nullable()
|
|
17083
|
+
}))
|
|
17084
|
+
});
|
|
16978
17085
|
var dashboardOverviewSchema = exports_external.object({
|
|
16979
17086
|
object: exports_external.literal("dashboard_overview"),
|
|
16980
17087
|
requestId: exports_external.string(),
|
|
@@ -16982,7 +17089,189 @@ var dashboardOverviewSchema = exports_external.object({
|
|
|
16982
17089
|
organization: organizationSchema.omit({ object: true }).nullable(),
|
|
16983
17090
|
billing: billingAccountSchema,
|
|
16984
17091
|
usage: usageSummarySchema,
|
|
16985
|
-
apiKeys: exports_external.array(apiKeySchema)
|
|
17092
|
+
apiKeys: exports_external.array(apiKeySchema),
|
|
17093
|
+
overview: dashboardOverviewSummarySchema
|
|
17094
|
+
});
|
|
17095
|
+
var dashboardAccountSettingsSchema = exports_external.object({
|
|
17096
|
+
object: exports_external.literal("dashboard_account_settings"),
|
|
17097
|
+
requestId: exports_external.string(),
|
|
17098
|
+
principal: dashboardSettingsPrincipalSchema.nullable(),
|
|
17099
|
+
profile: exports_external.object({
|
|
17100
|
+
object: exports_external.literal("dashboard_profile"),
|
|
17101
|
+
userId: exports_external.string().nullable(),
|
|
17102
|
+
email: exports_external.string().nullable(),
|
|
17103
|
+
emailNormalized: exports_external.string().nullable(),
|
|
17104
|
+
name: exports_external.string().nullable(),
|
|
17105
|
+
displayName: exports_external.string().nullable(),
|
|
17106
|
+
displayNameSource: exports_external.enum(["dashboard_settings", "workos", "unknown"]),
|
|
17107
|
+
avatarUrl: exports_external.string().nullable(),
|
|
17108
|
+
editable: exports_external.object({
|
|
17109
|
+
displayName: exports_external.boolean(),
|
|
17110
|
+
email: exports_external.boolean(),
|
|
17111
|
+
name: exports_external.boolean(),
|
|
17112
|
+
avatarUrl: exports_external.boolean()
|
|
17113
|
+
}),
|
|
17114
|
+
updatedAt: exports_external.string().nullable()
|
|
17115
|
+
}),
|
|
17116
|
+
organization: exports_external.object({
|
|
17117
|
+
id: exports_external.string(),
|
|
17118
|
+
name: exports_external.string().nullable(),
|
|
17119
|
+
nameSource: exports_external.enum(["dashboard_settings", "workos"]),
|
|
17120
|
+
workosName: exports_external.string().nullable(),
|
|
17121
|
+
livemode: exports_external.boolean(),
|
|
17122
|
+
createdAt: exports_external.string(),
|
|
17123
|
+
settings: exports_external.object({
|
|
17124
|
+
organization: exports_external.object({
|
|
17125
|
+
displayName: exports_external.string().nullable(),
|
|
17126
|
+
updatedAt: exports_external.string().nullable()
|
|
17127
|
+
}),
|
|
17128
|
+
appearance: exports_external.object({
|
|
17129
|
+
theme: exports_external.enum(["dark", "system"]),
|
|
17130
|
+
density: exports_external.enum(["comfortable", "compact"])
|
|
17131
|
+
}),
|
|
17132
|
+
accountDeletionRequest: exports_external.object({
|
|
17133
|
+
status: exports_external.enum(["not_requested", "requested"]),
|
|
17134
|
+
requestedAt: exports_external.string().nullable(),
|
|
17135
|
+
requestedByPrincipalId: exports_external.string().nullable(),
|
|
17136
|
+
reason: exports_external.string().nullable()
|
|
17137
|
+
})
|
|
17138
|
+
})
|
|
17139
|
+
}).nullable(),
|
|
17140
|
+
membership: exports_external.object({
|
|
17141
|
+
object: exports_external.literal("workos_org_membership"),
|
|
17142
|
+
userId: exports_external.string(),
|
|
17143
|
+
orgId: exports_external.string(),
|
|
17144
|
+
status: exports_external.enum(["active", "inactive", "suspended"]),
|
|
17145
|
+
scopes: exports_external.array(exports_external.string()),
|
|
17146
|
+
firstSeenAt: exports_external.string(),
|
|
17147
|
+
lastSeenAt: exports_external.string(),
|
|
17148
|
+
createdAt: exports_external.string(),
|
|
17149
|
+
updatedAt: exports_external.string()
|
|
17150
|
+
}).nullable(),
|
|
17151
|
+
appearance: exports_external.object({
|
|
17152
|
+
theme: exports_external.enum(["dark", "system"]),
|
|
17153
|
+
density: exports_external.enum(["comfortable", "compact"])
|
|
17154
|
+
}),
|
|
17155
|
+
security: exports_external.object({
|
|
17156
|
+
object: exports_external.literal("dashboard_security_settings"),
|
|
17157
|
+
authProvider: exports_external.literal("workos"),
|
|
17158
|
+
authMode: exports_external.string(),
|
|
17159
|
+
sessionExpiresAt: exports_external.string().nullable(),
|
|
17160
|
+
scopes: exports_external.array(exports_external.string()),
|
|
17161
|
+
logoutPath: exports_external.string(),
|
|
17162
|
+
profileFieldsManagedBy: exports_external.literal("workos")
|
|
17163
|
+
}),
|
|
17164
|
+
accountDeletion: exports_external.object({
|
|
17165
|
+
status: exports_external.enum(["not_requested", "requested"]),
|
|
17166
|
+
requestedAt: exports_external.string().nullable(),
|
|
17167
|
+
requestedByPrincipalId: exports_external.string().nullable(),
|
|
17168
|
+
reason: exports_external.string().nullable()
|
|
17169
|
+
}),
|
|
17170
|
+
actions: exports_external.array(exports_external.object({
|
|
17171
|
+
id: exports_external.string(),
|
|
17172
|
+
method: exports_external.string(),
|
|
17173
|
+
path: exports_external.string(),
|
|
17174
|
+
enabled: exports_external.boolean()
|
|
17175
|
+
}))
|
|
17176
|
+
});
|
|
17177
|
+
var dashboardUsageSeriesSchema = exports_external.object({
|
|
17178
|
+
object: exports_external.literal("dashboard_usage_series"),
|
|
17179
|
+
requestId: exports_external.string().optional(),
|
|
17180
|
+
orgId: exports_external.string(),
|
|
17181
|
+
bucket: exports_external.enum(["hour", "day"]),
|
|
17182
|
+
since: exports_external.string(),
|
|
17183
|
+
until: exports_external.string(),
|
|
17184
|
+
data: exports_external.array(exports_external.object({
|
|
17185
|
+
bucketStart: exports_external.string(),
|
|
17186
|
+
requestCount: exports_external.number().int(),
|
|
17187
|
+
successCount: exports_external.number().int(),
|
|
17188
|
+
errorCount: exports_external.number().int(),
|
|
17189
|
+
units: exports_external.number().int(),
|
|
17190
|
+
avgLatencyMs: exports_external.number()
|
|
17191
|
+
}))
|
|
17192
|
+
});
|
|
17193
|
+
var dashboardEndpointBreakdownSchema = exports_external.object({
|
|
17194
|
+
object: exports_external.literal("dashboard_endpoint_breakdown"),
|
|
17195
|
+
requestId: exports_external.string().optional(),
|
|
17196
|
+
orgId: exports_external.string(),
|
|
17197
|
+
since: exports_external.string(),
|
|
17198
|
+
until: exports_external.string(),
|
|
17199
|
+
data: exports_external.array(exports_external.object({
|
|
17200
|
+
endpointKey: exports_external.string(),
|
|
17201
|
+
method: exports_external.string(),
|
|
17202
|
+
path: exports_external.string(),
|
|
17203
|
+
meterClass: exports_external.string(),
|
|
17204
|
+
meterFamily: exports_external.string(),
|
|
17205
|
+
requestCount: exports_external.number().int(),
|
|
17206
|
+
successCount: exports_external.number().int(),
|
|
17207
|
+
errorCount: exports_external.number().int(),
|
|
17208
|
+
units: exports_external.number().int(),
|
|
17209
|
+
avgLatencyMs: exports_external.number(),
|
|
17210
|
+
lastSeenAt: exports_external.string().nullable()
|
|
17211
|
+
}))
|
|
17212
|
+
});
|
|
17213
|
+
var dashboardUsageRequestSchema = exports_external.object({
|
|
17214
|
+
id: exports_external.string(),
|
|
17215
|
+
requestId: exports_external.string(),
|
|
17216
|
+
principalId: exports_external.string().nullable(),
|
|
17217
|
+
endpointKey: exports_external.string(),
|
|
17218
|
+
method: exports_external.string(),
|
|
17219
|
+
path: exports_external.string(),
|
|
17220
|
+
status: exports_external.number().int(),
|
|
17221
|
+
authMode: exports_external.string().nullable(),
|
|
17222
|
+
meterClass: exports_external.string(),
|
|
17223
|
+
meterFamily: exports_external.string(),
|
|
17224
|
+
mcpToolName: exports_external.string().nullable(),
|
|
17225
|
+
units: exports_external.number().int(),
|
|
17226
|
+
latencyMs: exports_external.number(),
|
|
17227
|
+
invoicePeriod: exports_external.string(),
|
|
17228
|
+
recordedAt: exports_external.string()
|
|
17229
|
+
});
|
|
17230
|
+
var dashboardAuditEventSchema = exports_external.object({
|
|
17231
|
+
id: exports_external.string(),
|
|
17232
|
+
orgId: exports_external.string().nullable(),
|
|
17233
|
+
actorPrincipalId: exports_external.string().nullable(),
|
|
17234
|
+
eventType: exports_external.string(),
|
|
17235
|
+
category: exports_external.string(),
|
|
17236
|
+
outcome: exports_external.enum(["started", "succeeded", "failed", "blocked"]),
|
|
17237
|
+
requestId: exports_external.string().nullable(),
|
|
17238
|
+
authMode: exports_external.string().nullable(),
|
|
17239
|
+
source: exports_external.string(),
|
|
17240
|
+
metadata: exports_external.record(exports_external.string(), exports_external.unknown()),
|
|
17241
|
+
occurredAt: exports_external.string()
|
|
17242
|
+
});
|
|
17243
|
+
var dashboardUsageRequestLogSchema = exports_external.object({
|
|
17244
|
+
object: exports_external.literal("dashboard_usage_request_log"),
|
|
17245
|
+
requestId: exports_external.string(),
|
|
17246
|
+
orgId: exports_external.string(),
|
|
17247
|
+
since: exports_external.string(),
|
|
17248
|
+
until: exports_external.string(),
|
|
17249
|
+
data: exports_external.array(dashboardUsageRequestSchema)
|
|
17250
|
+
});
|
|
17251
|
+
var dashboardUsageExportSchema = exports_external.object({
|
|
17252
|
+
object: exports_external.literal("dashboard_usage_export"),
|
|
17253
|
+
requestId: exports_external.string(),
|
|
17254
|
+
orgId: exports_external.string(),
|
|
17255
|
+
since: exports_external.string(),
|
|
17256
|
+
until: exports_external.string(),
|
|
17257
|
+
format: exports_external.literal("json"),
|
|
17258
|
+
data: exports_external.array(dashboardUsageRequestSchema)
|
|
17259
|
+
});
|
|
17260
|
+
var dashboardUsageActivitySchema = exports_external.object({
|
|
17261
|
+
object: exports_external.literal("dashboard_usage_activity"),
|
|
17262
|
+
requestId: exports_external.string(),
|
|
17263
|
+
orgId: exports_external.string(),
|
|
17264
|
+
since: exports_external.string(),
|
|
17265
|
+
until: exports_external.string(),
|
|
17266
|
+
totalRequests: exports_external.number().int(),
|
|
17267
|
+
successCount: exports_external.number().int(),
|
|
17268
|
+
errorCount: exports_external.number().int(),
|
|
17269
|
+
firstSeenAt: exports_external.string().nullable(),
|
|
17270
|
+
lastSeenAt: exports_external.string().nullable(),
|
|
17271
|
+
activePrincipalCount: exports_external.number().int(),
|
|
17272
|
+
endpointCount: exports_external.number().int(),
|
|
17273
|
+
recentRequests: exports_external.array(dashboardUsageRequestSchema),
|
|
17274
|
+
recentAuditEvents: exports_external.array(dashboardAuditEventSchema)
|
|
16986
17275
|
});
|
|
16987
17276
|
var installPayloadSchema = exports_external.object({
|
|
16988
17277
|
transport: exports_external.object({
|
|
@@ -17140,6 +17429,8 @@ var listSchema = (itemSchema) => exports_external.object({
|
|
|
17140
17429
|
data: exports_external.array(itemSchema),
|
|
17141
17430
|
hasMore: exports_external.boolean(),
|
|
17142
17431
|
nextCursor: exports_external.string().nullable(),
|
|
17432
|
+
responseMode: exports_external.enum(["compact", "standard", "verbose"]).nullable().optional(),
|
|
17433
|
+
include: exports_external.array(exports_external.string()).nullable().optional(),
|
|
17143
17434
|
requestId: exports_external.string()
|
|
17144
17435
|
});
|
|
17145
17436
|
var entityListSchema = listSchema(entitySchema);
|
|
@@ -17193,12 +17484,19 @@ var entityAgentRecordSchema = exports_external.object({
|
|
|
17193
17484
|
var statementAgentRecordSchema = statementSchema.pick({
|
|
17194
17485
|
object: true,
|
|
17195
17486
|
ticker: true,
|
|
17487
|
+
companyName: true,
|
|
17196
17488
|
statementKey: true,
|
|
17197
17489
|
title: true,
|
|
17198
17490
|
period: true,
|
|
17199
17491
|
periods: true,
|
|
17200
17492
|
rows: true
|
|
17201
17493
|
}).extend({
|
|
17494
|
+
sources: exports_external.array(exports_external.object({
|
|
17495
|
+
source: exports_external.string(),
|
|
17496
|
+
sourceKind: exports_external.enum(["company_facts", "filing"]),
|
|
17497
|
+
accessionNumber: exports_external.string().nullable(),
|
|
17498
|
+
sourceUrl: exports_external.string().url()
|
|
17499
|
+
})).default([]),
|
|
17202
17500
|
requestId: exports_external.string()
|
|
17203
17501
|
});
|
|
17204
17502
|
var factPointAgentItemSchema = factPointSchema.pick({
|
|
@@ -17347,6 +17645,7 @@ var ownershipReportAgentRecordSchema = ownershipReportSchema.pick({
|
|
|
17347
17645
|
managerName: true,
|
|
17348
17646
|
form: true,
|
|
17349
17647
|
filingDate: true,
|
|
17648
|
+
reportDate: true,
|
|
17350
17649
|
accessionNumber: true
|
|
17351
17650
|
}).extend({
|
|
17352
17651
|
filingUrl: exports_external.string().nullable(),
|
|
@@ -17500,10 +17799,15 @@ var observabilityExportSchema = exports_external.object({
|
|
|
17500
17799
|
var symbolSchema = exports_external.string().min(1);
|
|
17501
17800
|
var isoCountryCodeSchema = exports_external.string().length(2);
|
|
17502
17801
|
var investorMetadataShape = {
|
|
17503
|
-
|
|
17802
|
+
responseMode: exports_external.enum(["compact", "standard", "verbose"]).optional(),
|
|
17803
|
+
dataAsOf: exports_external.string().optional(),
|
|
17804
|
+
freshnessStatus: exports_external.string().optional(),
|
|
17805
|
+
methodologyVersion: exports_external.string().optional(),
|
|
17806
|
+
materializationVersion: exports_external.string().optional(),
|
|
17807
|
+
provenance: provenanceSchema.optional(),
|
|
17504
17808
|
freshness: freshnessMetadataSchema.optional(),
|
|
17505
17809
|
materialization: materializationMetadataSchema.optional(),
|
|
17506
|
-
sourceRights: sourceRightsMetadataSchema,
|
|
17810
|
+
sourceRights: sourceRightsMetadataSchema.optional(),
|
|
17507
17811
|
methodology: methodologyMetadataSchema.optional(),
|
|
17508
17812
|
revision: revisionMetadataSchema.optional(),
|
|
17509
17813
|
degradedState: degradedStateSchema.nullable().optional()
|
|
@@ -17664,16 +17968,55 @@ var macroForecastSchema = exports_external.object({
|
|
|
17664
17968
|
scenario: exports_external.string().nullable().optional(),
|
|
17665
17969
|
...investorMetadataShape
|
|
17666
17970
|
});
|
|
17971
|
+
var factorQualityProofSourceMetadataSchema = exports_external.object({
|
|
17972
|
+
latestAsOf: exports_external.string().nullable(),
|
|
17973
|
+
latestSourcePublishedAt: exports_external.string().nullable(),
|
|
17974
|
+
observedModelNameCount: exports_external.number().int().nonnegative(),
|
|
17975
|
+
observedModelNamesSample: exports_external.array(exports_external.string()).default([]),
|
|
17976
|
+
nonStockBasketRowCount: exports_external.number().int().nonnegative(),
|
|
17977
|
+
metadataModelNames: exports_external.array(exports_external.string()).default([]),
|
|
17978
|
+
metadataModelVersions: exports_external.array(exports_external.string()).default([]),
|
|
17979
|
+
metadataMethodologyUrls: exports_external.array(exports_external.string()).default([])
|
|
17980
|
+
});
|
|
17981
|
+
var factorQualityProofSchema = exports_external.object({
|
|
17982
|
+
object: exports_external.literal("factor_quality_proof"),
|
|
17983
|
+
status: exports_external.enum(["ready", "degraded", "not_available"]),
|
|
17984
|
+
proofSource: exports_external.string().nullable(),
|
|
17985
|
+
proofObservedAt: exports_external.string().nullable(),
|
|
17986
|
+
rowLevelProofAvailable: exports_external.boolean(),
|
|
17987
|
+
proofReady: exports_external.boolean(),
|
|
17988
|
+
firstDate: exports_external.string().nullable(),
|
|
17989
|
+
lastDate: exports_external.string().nullable(),
|
|
17990
|
+
firstRequiredMarketDate: exports_external.string().nullable(),
|
|
17991
|
+
latestMarketDay: exports_external.string().nullable(),
|
|
17992
|
+
targetHistoryStartDate: exports_external.string().nullable(),
|
|
17993
|
+
requiredHistoryStartDate: exports_external.string().nullable(),
|
|
17994
|
+
shortHistoryExempt: exports_external.boolean(),
|
|
17995
|
+
historyStartMarketDayLag: exports_external.number().int().nullable(),
|
|
17996
|
+
latestMarketDayLag: exports_external.number().int().nullable(),
|
|
17997
|
+
rowCount: exports_external.number().int().nonnegative().nullable(),
|
|
17998
|
+
distinctFactorDateCount: exports_external.number().int().nonnegative().nullable(),
|
|
17999
|
+
coveredMarketDateCount: exports_external.number().int().nonnegative().nullable(),
|
|
18000
|
+
expectedMarketDateCount: exports_external.number().int().nonnegative().nullable(),
|
|
18001
|
+
missingSessionCount: exports_external.number().int().nonnegative().nullable(),
|
|
18002
|
+
coveragePct: exports_external.number().min(0).max(1).nullable(),
|
|
18003
|
+
methodologyVersion: exports_external.string().nullable(),
|
|
18004
|
+
modelName: exports_external.string().nullable(),
|
|
18005
|
+
methodologyUrl: exports_external.string().nullable(),
|
|
18006
|
+
sourceMetadata: factorQualityProofSourceMetadataSchema.nullable(),
|
|
18007
|
+
degradedReasons: exports_external.array(exports_external.string()).default([])
|
|
18008
|
+
});
|
|
17667
18009
|
var factorDefinitionSchema = exports_external.object({
|
|
17668
18010
|
object: exports_external.literal("factor_definition"),
|
|
17669
18011
|
id: exports_external.string(),
|
|
17670
18012
|
key: exports_external.string(),
|
|
17671
18013
|
name: exports_external.string(),
|
|
17672
|
-
category: exports_external.enum(["market", "style", "macro", "sector", "industry", "country", "
|
|
18014
|
+
category: exports_external.enum(["market", "style", "macro", "sector", "industry", "country", "thematic"]),
|
|
17673
18015
|
description: exports_external.string(),
|
|
17674
18016
|
benchmarkSymbol: exports_external.string().nullable().optional(),
|
|
17675
18017
|
equation: exports_external.record(exports_external.string(), exports_external.number()).optional(),
|
|
17676
18018
|
orthogonalizedAgainst: exports_external.array(exports_external.string()).default([]),
|
|
18019
|
+
qualityProof: factorQualityProofSchema,
|
|
17677
18020
|
...investorMetadataShape
|
|
17678
18021
|
});
|
|
17679
18022
|
var factorReturnSchema = exports_external.object({
|
|
@@ -17687,6 +18030,212 @@ var factorReturnSchema = exports_external.object({
|
|
|
17687
18030
|
scaledReturn: exports_external.number().nullable().optional(),
|
|
17688
18031
|
zScore: exports_external.number().nullable().optional(),
|
|
17689
18032
|
leverage: exports_external.number().nullable().optional(),
|
|
18033
|
+
qualityProof: factorQualityProofSchema,
|
|
18034
|
+
...investorMetadataShape
|
|
18035
|
+
});
|
|
18036
|
+
var factorExtremeMoveSchema = exports_external.object({
|
|
18037
|
+
object: exports_external.literal("factor_extreme_move"),
|
|
18038
|
+
id: exports_external.string(),
|
|
18039
|
+
rank: exports_external.number().int().positive(),
|
|
18040
|
+
factorKey: exports_external.string(),
|
|
18041
|
+
factorName: exports_external.string(),
|
|
18042
|
+
category: exports_external.string(),
|
|
18043
|
+
window: exports_external.string(),
|
|
18044
|
+
lookback: exports_external.string(),
|
|
18045
|
+
direction: exports_external.enum(["up", "down", "flat"]),
|
|
18046
|
+
sort: exports_external.enum(["abs_z_score", "abs_scaled_return"]),
|
|
18047
|
+
score: exports_external.number(),
|
|
18048
|
+
absZScore: exports_external.number().nonnegative(),
|
|
18049
|
+
absScaledReturn: exports_external.number().nonnegative(),
|
|
18050
|
+
minAbsZScore: exports_external.number().nonnegative(),
|
|
18051
|
+
isExtreme: exports_external.boolean(),
|
|
18052
|
+
asOf: exports_external.string(),
|
|
18053
|
+
rawReturn: exports_external.number().nullable().optional(),
|
|
18054
|
+
pureReturn: exports_external.number().nullable().optional(),
|
|
18055
|
+
scaledReturn: exports_external.number().nullable().optional(),
|
|
18056
|
+
zScore: exports_external.number().nullable().optional(),
|
|
18057
|
+
leverage: exports_external.number().nullable().optional(),
|
|
18058
|
+
...investorMetadataShape
|
|
18059
|
+
});
|
|
18060
|
+
var factorExtremePairSchema = exports_external.object({
|
|
18061
|
+
object: exports_external.literal("factor_extreme_pair"),
|
|
18062
|
+
id: exports_external.string(),
|
|
18063
|
+
rank: exports_external.number().int().positive(),
|
|
18064
|
+
factor1: exports_external.string(),
|
|
18065
|
+
factor2: exports_external.string(),
|
|
18066
|
+
factor1Name: exports_external.string(),
|
|
18067
|
+
factor2Name: exports_external.string(),
|
|
18068
|
+
category1: exports_external.string(),
|
|
18069
|
+
category2: exports_external.string(),
|
|
18070
|
+
window: exports_external.enum(["1d", "5d", "10d", "21d", "63d", "126d", "252d"]),
|
|
18071
|
+
lookback: exports_external.string(),
|
|
18072
|
+
direction: exports_external.enum(["factor1", "factor2", "flat"]),
|
|
18073
|
+
sort: exports_external.enum(["abs_z_score", "abs_spread_return"]),
|
|
18074
|
+
score: exports_external.number(),
|
|
18075
|
+
absZScore: exports_external.number().nonnegative(),
|
|
18076
|
+
absSpreadReturn: exports_external.number().nonnegative(),
|
|
18077
|
+
minAbsZScore: exports_external.number().nonnegative(),
|
|
18078
|
+
isExtreme: exports_external.boolean(),
|
|
18079
|
+
spreadReturn: exports_external.number(),
|
|
18080
|
+
factor1Return: exports_external.number(),
|
|
18081
|
+
factor2Return: exports_external.number(),
|
|
18082
|
+
averageSpreadReturn: exports_external.number(),
|
|
18083
|
+
spreadVolatility: exports_external.number().nonnegative(),
|
|
18084
|
+
zScore: exports_external.number(),
|
|
18085
|
+
spreadZScore: exports_external.number(),
|
|
18086
|
+
meanReversionSignal: exports_external.enum(["factor1_overextended", "factor2_overextended", "neutral"]),
|
|
18087
|
+
meanReversionSummary: exports_external.string(),
|
|
18088
|
+
windowStartDate: exports_external.string(),
|
|
18089
|
+
windowEndDate: exports_external.string(),
|
|
18090
|
+
pairHistory: exports_external.record(exports_external.string(), exports_external.unknown()),
|
|
18091
|
+
observationCount: exports_external.number().int().nonnegative(),
|
|
18092
|
+
rollingObservationCount: exports_external.number().int().nonnegative(),
|
|
18093
|
+
asOf: exports_external.string(),
|
|
18094
|
+
...investorMetadataShape
|
|
18095
|
+
});
|
|
18096
|
+
var factorValuationSchema = exports_external.object({
|
|
18097
|
+
object: exports_external.literal("factor_valuation"),
|
|
18098
|
+
id: exports_external.string(),
|
|
18099
|
+
rank: exports_external.number().int().positive(),
|
|
18100
|
+
factorKey: exports_external.string(),
|
|
18101
|
+
factorName: exports_external.string(),
|
|
18102
|
+
category: exports_external.string(),
|
|
18103
|
+
valuationMetric: exports_external.string(),
|
|
18104
|
+
longLeg: exports_external.string(),
|
|
18105
|
+
shortLeg: exports_external.string(),
|
|
18106
|
+
window: exports_external.string(),
|
|
18107
|
+
lookback: exports_external.string(),
|
|
18108
|
+
signal: exports_external.enum(["tailwind", "headwind", "neutral"]),
|
|
18109
|
+
signalDirection: exports_external.enum(["tailwind", "headwind", "neutral"]),
|
|
18110
|
+
weightingMode: exports_external.enum(["long_short_equal", "long_leg_focus", "short_leg_focus"]),
|
|
18111
|
+
legWeights: exports_external.object({
|
|
18112
|
+
long: exports_external.number(),
|
|
18113
|
+
short: exports_external.number()
|
|
18114
|
+
}),
|
|
18115
|
+
rawFactorZScore: exports_external.number(),
|
|
18116
|
+
weightedZScore: exports_external.number(),
|
|
18117
|
+
sort: exports_external.enum(["opportunity_score", "abs_z_score", "factor_key"]),
|
|
18118
|
+
score: exports_external.number(),
|
|
18119
|
+
opportunityScore: exports_external.number(),
|
|
18120
|
+
zScore: exports_external.number(),
|
|
18121
|
+
absZScore: exports_external.number().nonnegative(),
|
|
18122
|
+
scaledReturn: exports_external.number().nullable().optional(),
|
|
18123
|
+
pureReturn: exports_external.number().nullable().optional(),
|
|
18124
|
+
rawReturn: exports_external.number().nullable().optional(),
|
|
18125
|
+
asOf: exports_external.string(),
|
|
18126
|
+
signalSource: exports_external.literal("materialized_factor_return_z_score"),
|
|
18127
|
+
stockDrilldown: exports_external.record(exports_external.string(), exports_external.unknown()),
|
|
18128
|
+
opportunitySummary: exports_external.string(),
|
|
18129
|
+
...investorMetadataShape
|
|
18130
|
+
});
|
|
18131
|
+
var factorValuationStockSchema = exports_external.object({
|
|
18132
|
+
object: exports_external.literal("factor_valuation_stock"),
|
|
18133
|
+
id: exports_external.string(),
|
|
18134
|
+
rank: exports_external.number().int().positive(),
|
|
18135
|
+
symbol: symbolSchema,
|
|
18136
|
+
factorKey: exports_external.string(),
|
|
18137
|
+
factorName: exports_external.string(),
|
|
18138
|
+
category: exports_external.string(),
|
|
18139
|
+
valuationMetric: exports_external.string(),
|
|
18140
|
+
valuationSignal: exports_external.enum(["tailwind", "headwind", "neutral"]),
|
|
18141
|
+
signalDirection: exports_external.enum(["tailwind", "headwind", "neutral"]),
|
|
18142
|
+
weightingMode: exports_external.enum(["long_short_equal", "long_leg_focus", "short_leg_focus"]),
|
|
18143
|
+
legWeights: exports_external.object({
|
|
18144
|
+
long: exports_external.number(),
|
|
18145
|
+
short: exports_external.number()
|
|
18146
|
+
}),
|
|
18147
|
+
stance: exports_external.enum(["beneficiaries", "at_risk", "both"]),
|
|
18148
|
+
impact: exports_external.enum(["beneficiary", "at_risk", "neutral"]),
|
|
18149
|
+
sort: exports_external.enum(["score", "abs_beta", "symbol"]),
|
|
18150
|
+
score: exports_external.number(),
|
|
18151
|
+
expectedFactorImpactScore: exports_external.number(),
|
|
18152
|
+
factorZScore: exports_external.number(),
|
|
18153
|
+
rawFactorZScore: exports_external.number(),
|
|
18154
|
+
weightedFactorZScore: exports_external.number(),
|
|
18155
|
+
exposureAdjustedFactorZScore: exports_external.number(),
|
|
18156
|
+
exposureBeta: exports_external.number(),
|
|
18157
|
+
absExposureBeta: exports_external.number().nonnegative(),
|
|
18158
|
+
exposurePercentile: exports_external.number().nullable().optional(),
|
|
18159
|
+
exposureConfidence: exports_external.enum(["high", "medium", "low"]).nullable().optional(),
|
|
18160
|
+
nActiveFactors: exports_external.number().int().nonnegative(),
|
|
18161
|
+
window: exports_external.string(),
|
|
18162
|
+
lookback: exports_external.string(),
|
|
18163
|
+
modelName: exports_external.string(),
|
|
18164
|
+
asOf: exports_external.string(),
|
|
18165
|
+
factorAsOf: exports_external.string(),
|
|
18166
|
+
factorFreshness: freshnessMetadataSchema.optional(),
|
|
18167
|
+
factorMaterialization: materializationMetadataSchema.optional(),
|
|
18168
|
+
signalSource: exports_external.literal("materialized_factor_return_z_score_plus_latest_factor_exposure"),
|
|
18169
|
+
rankingRationale: exports_external.string(),
|
|
18170
|
+
opportunitySummary: exports_external.string(),
|
|
18171
|
+
...investorMetadataShape
|
|
18172
|
+
});
|
|
18173
|
+
var factorHistoryPointSchema = exports_external.object({
|
|
18174
|
+
date: exports_external.string(),
|
|
18175
|
+
rawReturn: exports_external.number().nullable().optional(),
|
|
18176
|
+
pureReturn: exports_external.number().nullable().optional(),
|
|
18177
|
+
scaledReturn: exports_external.number().nullable().optional(),
|
|
18178
|
+
zScore: exports_external.number().nullable().optional(),
|
|
18179
|
+
leverage: exports_external.number().nullable().optional()
|
|
18180
|
+
});
|
|
18181
|
+
var factorHistoryWindowSchema = exports_external.object({
|
|
18182
|
+
window: exports_external.string(),
|
|
18183
|
+
rawReturn: exports_external.number().nullable().optional(),
|
|
18184
|
+
pureReturn: exports_external.number().nullable().optional(),
|
|
18185
|
+
scaledReturn: exports_external.number().nullable().optional(),
|
|
18186
|
+
observationCount: exports_external.number().int().nonnegative(),
|
|
18187
|
+
startDate: exports_external.string().nullable().optional(),
|
|
18188
|
+
endDate: exports_external.string().nullable().optional()
|
|
18189
|
+
});
|
|
18190
|
+
var factorHistorySchema = exports_external.object({
|
|
18191
|
+
object: exports_external.literal("factor_history"),
|
|
18192
|
+
id: exports_external.string(),
|
|
18193
|
+
factorKey: exports_external.string(),
|
|
18194
|
+
factorName: exports_external.string(),
|
|
18195
|
+
category: exports_external.string(),
|
|
18196
|
+
range: exports_external.string(),
|
|
18197
|
+
dateFrom: exports_external.string(),
|
|
18198
|
+
dateTo: exports_external.string(),
|
|
18199
|
+
historyStartDate: exports_external.string().nullable().optional(),
|
|
18200
|
+
historyEndDate: exports_external.string().nullable().optional(),
|
|
18201
|
+
observationCount: exports_external.number().int().nonnegative(),
|
|
18202
|
+
asOf: exports_external.string(),
|
|
18203
|
+
series: exports_external.array(factorHistoryPointSchema).default([]),
|
|
18204
|
+
seriesCount: exports_external.number().int().nonnegative().optional(),
|
|
18205
|
+
seriesSample: exports_external.array(factorHistoryPointSchema).optional(),
|
|
18206
|
+
expansionHints: exports_external.array(exports_external.string()).optional(),
|
|
18207
|
+
summaryWindows: exports_external.array(factorHistoryWindowSchema).default([]),
|
|
18208
|
+
qualityProof: factorQualityProofSchema,
|
|
18209
|
+
...investorMetadataShape
|
|
18210
|
+
});
|
|
18211
|
+
var factorSparklinePointSchema = exports_external.object({
|
|
18212
|
+
date: exports_external.string(),
|
|
18213
|
+
value: exports_external.number()
|
|
18214
|
+
});
|
|
18215
|
+
var factorSparklineSchema = exports_external.object({
|
|
18216
|
+
object: exports_external.literal("factor_sparkline"),
|
|
18217
|
+
id: exports_external.string(),
|
|
18218
|
+
factorKey: exports_external.string(),
|
|
18219
|
+
factorName: exports_external.string(),
|
|
18220
|
+
category: exports_external.string(),
|
|
18221
|
+
range: exports_external.string(),
|
|
18222
|
+
metric: exports_external.enum(["scaled_return", "pure_return", "raw_return", "z_score"]),
|
|
18223
|
+
dateFrom: exports_external.string(),
|
|
18224
|
+
dateTo: exports_external.string(),
|
|
18225
|
+
historyStartDate: exports_external.string().nullable().optional(),
|
|
18226
|
+
historyEndDate: exports_external.string().nullable().optional(),
|
|
18227
|
+
observationCount: exports_external.number().int().nonnegative(),
|
|
18228
|
+
pointCount: exports_external.number().int().nonnegative(),
|
|
18229
|
+
asOf: exports_external.string(),
|
|
18230
|
+
latestValue: exports_external.number().nullable().optional(),
|
|
18231
|
+
latestRawReturn: exports_external.number().nullable().optional(),
|
|
18232
|
+
latestPureReturn: exports_external.number().nullable().optional(),
|
|
18233
|
+
latestScaledReturn: exports_external.number().nullable().optional(),
|
|
18234
|
+
latestZScore: exports_external.number().nullable().optional(),
|
|
18235
|
+
latestLeverage: exports_external.number().nullable().optional(),
|
|
18236
|
+
summaryWindows: exports_external.array(factorHistoryWindowSchema).default([]),
|
|
18237
|
+
points: exports_external.array(factorSparklinePointSchema).default([]),
|
|
18238
|
+
qualityProof: factorQualityProofSchema,
|
|
17690
18239
|
...investorMetadataShape
|
|
17691
18240
|
});
|
|
17692
18241
|
var factorIntradaySnapshotSchema = exports_external.object({
|
|
@@ -17714,7 +18263,7 @@ var factorRegimePerformanceSchema = exports_external.object({
|
|
|
17714
18263
|
regimeLabel: exports_external.string(),
|
|
17715
18264
|
factorKey: exports_external.string(),
|
|
17716
18265
|
factorName: exports_external.string(),
|
|
17717
|
-
factorCategory: exports_external.enum(["market", "style", "macro", "sector", "industry", "country", "
|
|
18266
|
+
factorCategory: exports_external.enum(["market", "style", "macro", "sector", "industry", "country", "thematic"]),
|
|
17718
18267
|
window: exports_external.string(),
|
|
17719
18268
|
lookback: exports_external.string(),
|
|
17720
18269
|
rank: exports_external.number().int().positive(),
|
|
@@ -17930,16 +18479,149 @@ var countryReportRequestSchema = exports_external.object({
|
|
|
17930
18479
|
var portfolioIntelligenceRequestSchema = exports_external.object({
|
|
17931
18480
|
country: exports_external.string().min(2).max(12).default("US"),
|
|
17932
18481
|
lookback: exports_external.string().min(2).max(12).optional(),
|
|
18482
|
+
category: exports_external.string().min(2).max(32).optional(),
|
|
18483
|
+
keys: exports_external.array(exports_external.string()).default([]),
|
|
18484
|
+
holdings: exports_external.array(portfolioHoldingInputSchema).min(1).max(250),
|
|
18485
|
+
benchmarkLabel: exports_external.string().min(1).max(160).optional(),
|
|
18486
|
+
benchmarkHoldings: exports_external.array(portfolioHoldingInputSchema).min(1).max(250).optional(),
|
|
18487
|
+
whatIfLabel: exports_external.string().min(1).max(160).optional(),
|
|
18488
|
+
whatIfHoldings: exports_external.array(portfolioHoldingInputSchema).min(1).max(250).optional()
|
|
18489
|
+
});
|
|
18490
|
+
var portfolioAttributionRequestSchema = exports_external.object({
|
|
18491
|
+
country: exports_external.string().min(2).max(12).default("US"),
|
|
18492
|
+
lookback: exports_external.string().min(2).max(12).optional(),
|
|
18493
|
+
window: exports_external.string().min(2).max(12).optional(),
|
|
18494
|
+
frequency: exports_external.enum(["daily", "weekly", "monthly", "quarterly", "annual"]).default("daily"),
|
|
18495
|
+
exportFormat: exports_external.enum(["json", "csv", "both"]).default("json"),
|
|
18496
|
+
category: exports_external.string().min(2).max(32).optional(),
|
|
17933
18497
|
keys: exports_external.array(exports_external.string()).default([]),
|
|
17934
18498
|
holdings: exports_external.array(portfolioHoldingInputSchema).min(1).max(250)
|
|
17935
18499
|
});
|
|
18500
|
+
var portfolioHedgeInstrumentTypeSchema = exports_external.enum(["equity", "etf", "future", "option", "cash"]);
|
|
18501
|
+
var portfolioHedgeConstraintsSchema = exports_external.object({
|
|
18502
|
+
maxHedges: exports_external.number().int().min(1).max(5).default(3),
|
|
18503
|
+
maxPositionWeight: exports_external.number().min(0.001).max(1).default(0.1),
|
|
18504
|
+
maxTotalHedgeWeight: exports_external.number().min(0.001).max(1).default(0.3),
|
|
18505
|
+
maxSectorWeight: exports_external.number().min(0.001).max(1).default(1),
|
|
18506
|
+
hedgeIntensity: exports_external.number().min(0.05).max(1).default(1),
|
|
18507
|
+
longOnly: exports_external.boolean().default(false),
|
|
18508
|
+
allowedInstrumentTypes: exports_external.array(portfolioHedgeInstrumentTypeSchema).min(1).default(["etf"]),
|
|
18509
|
+
customUniverse: exports_external.array(symbolSchema).max(250).default([]),
|
|
18510
|
+
targetExposures: exports_external.record(exports_external.string(), exports_external.number()).default({}),
|
|
18511
|
+
minConfidence: exports_external.enum(["low", "medium", "high"]).default("medium"),
|
|
18512
|
+
minLiquidityUsd: exports_external.number().min(0).default(0),
|
|
18513
|
+
excludedSectors: exports_external.array(exports_external.string()).max(64).default([])
|
|
18514
|
+
}).strict().default({
|
|
18515
|
+
maxHedges: 3,
|
|
18516
|
+
maxPositionWeight: 0.1,
|
|
18517
|
+
maxTotalHedgeWeight: 0.3,
|
|
18518
|
+
maxSectorWeight: 1,
|
|
18519
|
+
hedgeIntensity: 1,
|
|
18520
|
+
longOnly: false,
|
|
18521
|
+
allowedInstrumentTypes: ["etf"],
|
|
18522
|
+
customUniverse: [],
|
|
18523
|
+
targetExposures: {},
|
|
18524
|
+
minConfidence: "medium",
|
|
18525
|
+
minLiquidityUsd: 0,
|
|
18526
|
+
excludedSectors: []
|
|
18527
|
+
});
|
|
18528
|
+
var portfolioOptimizerConstraintsSchema = exports_external.object({
|
|
18529
|
+
maxCandidates: exports_external.number().int().min(1).max(8).default(3),
|
|
18530
|
+
maxIterations: exports_external.number().int().min(10).max(250).default(50),
|
|
18531
|
+
maxRuntimeMs: exports_external.number().int().min(50).max(2500).default(750),
|
|
18532
|
+
maxPositionWeight: exports_external.number().min(0.001).max(1).default(0.35),
|
|
18533
|
+
minPositionWeight: exports_external.number().min(0).max(0.5).default(0),
|
|
18534
|
+
longOnly: exports_external.boolean().default(true),
|
|
18535
|
+
turnoverLimit: exports_external.number().min(0).max(2).default(0.25),
|
|
18536
|
+
riskFreeRate: exports_external.number().min(-0.25).max(0.25).default(0)
|
|
18537
|
+
}).strict().default({
|
|
18538
|
+
maxCandidates: 3,
|
|
18539
|
+
maxIterations: 50,
|
|
18540
|
+
maxRuntimeMs: 750,
|
|
18541
|
+
maxPositionWeight: 0.35,
|
|
18542
|
+
minPositionWeight: 0,
|
|
18543
|
+
longOnly: true,
|
|
18544
|
+
turnoverLimit: 0.25,
|
|
18545
|
+
riskFreeRate: 0
|
|
18546
|
+
});
|
|
18547
|
+
var portfolioOptimizeRequestSchema = exports_external.object({
|
|
18548
|
+
country: exports_external.string().min(2).max(12).default("US"),
|
|
18549
|
+
lookback: exports_external.string().min(2).max(12).optional(),
|
|
18550
|
+
category: exports_external.string().min(2).max(32).optional(),
|
|
18551
|
+
keys: exports_external.array(exports_external.string()).default([]),
|
|
18552
|
+
objective: exports_external.enum(["factor_neutral", "min_drawdown", "regime_aware"]).default("factor_neutral"),
|
|
18553
|
+
maxHedges: exports_external.number().int().min(1).max(5).optional(),
|
|
18554
|
+
constraints: portfolioOptimizerConstraintsSchema.optional(),
|
|
18555
|
+
holdings: exports_external.array(portfolioHoldingInputSchema).min(1).max(250)
|
|
18556
|
+
}).strict();
|
|
18557
|
+
var portfolioHedgeRequestSchema = exports_external.object({
|
|
18558
|
+
country: exports_external.string().min(2).max(12).default("US"),
|
|
18559
|
+
lookback: exports_external.string().min(2).max(12).optional(),
|
|
18560
|
+
category: exports_external.string().min(2).max(32).optional(),
|
|
18561
|
+
keys: exports_external.array(exports_external.string()).default([]),
|
|
18562
|
+
objective: exports_external.enum(["factor_neutral", "min_drawdown", "regime_aware"]).default("factor_neutral"),
|
|
18563
|
+
mode: exports_external.enum(["compact", "standard"]).default("compact"),
|
|
18564
|
+
constraints: portfolioHedgeConstraintsSchema,
|
|
18565
|
+
holdings: exports_external.array(portfolioHoldingInputSchema).min(1).max(250)
|
|
18566
|
+
}).strict();
|
|
17936
18567
|
var portfolioStressTestRequestSchema = exports_external.object({
|
|
17937
18568
|
country: exports_external.string().min(2).max(12).default("US"),
|
|
17938
18569
|
lookback: exports_external.string().min(2).max(12).optional(),
|
|
17939
18570
|
category: exports_external.string().min(2).max(32).optional(),
|
|
18571
|
+
keys: exports_external.array(exports_external.string()).default([]),
|
|
17940
18572
|
scenarioKey: exports_external.enum(["us_recession", "higher_for_longer", "china_growth_scare"]).optional(),
|
|
17941
18573
|
holdings: exports_external.array(portfolioHoldingInputSchema).min(1).max(250)
|
|
17942
18574
|
});
|
|
18575
|
+
var modelFactorAnalysisModelInputSchema = exports_external.object({
|
|
18576
|
+
id: exports_external.string().min(1).max(120).optional(),
|
|
18577
|
+
label: exports_external.string().min(1).max(160).default("Ad hoc model"),
|
|
18578
|
+
description: exports_external.string().max(500).default("Ad hoc model submitted for factor analysis."),
|
|
18579
|
+
tags: exports_external.array(exports_external.string().min(1).max(64)).max(20).default([]),
|
|
18580
|
+
source: exports_external.enum(["turos", "client", "model_builder"]).default("client")
|
|
18581
|
+
}).strict().default({
|
|
18582
|
+
label: "Ad hoc model",
|
|
18583
|
+
description: "Ad hoc model submitted for factor analysis.",
|
|
18584
|
+
tags: [],
|
|
18585
|
+
source: "client"
|
|
18586
|
+
});
|
|
18587
|
+
var modelFactorAnalysisIncludeSchema = exports_external.object({
|
|
18588
|
+
attribution: exports_external.boolean().default(true),
|
|
18589
|
+
hedge: exports_external.boolean().default(false),
|
|
18590
|
+
optimizer: exports_external.boolean().default(false),
|
|
18591
|
+
positionViews: exports_external.boolean().default(true)
|
|
18592
|
+
}).strict().default({
|
|
18593
|
+
attribution: true,
|
|
18594
|
+
hedge: false,
|
|
18595
|
+
optimizer: false,
|
|
18596
|
+
positionViews: true
|
|
18597
|
+
});
|
|
18598
|
+
var modelFactorAnalysisHedgeOptionsSchema = exports_external.object({
|
|
18599
|
+
objective: exports_external.enum(["factor_neutral", "min_drawdown", "regime_aware"]).default("factor_neutral"),
|
|
18600
|
+
mode: exports_external.enum(["compact", "standard"]).default("compact"),
|
|
18601
|
+
constraints: portfolioHedgeConstraintsSchema
|
|
18602
|
+
}).strict().default({
|
|
18603
|
+
objective: "factor_neutral",
|
|
18604
|
+
mode: "compact",
|
|
18605
|
+
constraints: portfolioHedgeConstraintsSchema.parse(undefined)
|
|
18606
|
+
});
|
|
18607
|
+
var modelFactorAnalysisOptimizerOptionsSchema = exports_external.object({
|
|
18608
|
+
objective: exports_external.enum(["factor_neutral", "min_drawdown", "regime_aware"]).default("factor_neutral"),
|
|
18609
|
+
constraints: portfolioOptimizerConstraintsSchema.optional()
|
|
18610
|
+
}).strict().default({
|
|
18611
|
+
objective: "factor_neutral"
|
|
18612
|
+
});
|
|
18613
|
+
var modelFactorAnalysisRequestSchema = exports_external.object({
|
|
18614
|
+
model: modelFactorAnalysisModelInputSchema,
|
|
18615
|
+
country: exports_external.string().min(2).max(12).default("US"),
|
|
18616
|
+
lookback: exports_external.string().min(2).max(12).optional(),
|
|
18617
|
+
window: exports_external.string().min(2).max(12).optional(),
|
|
18618
|
+
category: exports_external.string().min(2).max(32).optional(),
|
|
18619
|
+
keys: exports_external.array(exports_external.string()).default([]),
|
|
18620
|
+
include: modelFactorAnalysisIncludeSchema,
|
|
18621
|
+
hedge: modelFactorAnalysisHedgeOptionsSchema,
|
|
18622
|
+
optimizer: modelFactorAnalysisOptimizerOptionsSchema,
|
|
18623
|
+
holdings: exports_external.array(portfolioHoldingInputSchema).min(1).max(250)
|
|
18624
|
+
}).strict();
|
|
17943
18625
|
var watchlistIntelligenceRequestSchema = exports_external.object({
|
|
17944
18626
|
country: exports_external.string().min(2).max(12).default("US"),
|
|
17945
18627
|
lookback: exports_external.string().min(2).max(12).optional(),
|
|
@@ -17989,42 +18671,250 @@ var earningsPreviewBundleSchema = exports_external.object({
|
|
|
17989
18671
|
summaryMd: exports_external.string(),
|
|
17990
18672
|
...investorMetadataShape
|
|
17991
18673
|
});
|
|
18674
|
+
var portfolioFitSummarySchema = exports_external.object({
|
|
18675
|
+
object: exports_external.literal("portfolio_fit_summary"),
|
|
18676
|
+
exposureCount: exports_external.number().int().nonnegative(),
|
|
18677
|
+
activeFactorCount: exports_external.number().int().nonnegative(),
|
|
18678
|
+
averageRSquared: exports_external.number().min(0).max(1).nullable(),
|
|
18679
|
+
averageAdjustedRSquared: exports_external.number().nullable(),
|
|
18680
|
+
idiosyncraticRiskScore: exports_external.number().min(0).max(1).nullable(),
|
|
18681
|
+
rSquaredMethod: exports_external.literal("unweighted_average_of_factor_exposure_r_squared"),
|
|
18682
|
+
idiosyncraticRiskMethod: exports_external.literal("one_minus_average_factor_exposure_r_squared_proxy"),
|
|
18683
|
+
observationCount: exports_external.number().int().nonnegative().nullable(),
|
|
18684
|
+
interpretation: exports_external.string()
|
|
18685
|
+
});
|
|
18686
|
+
var portfolioBenchmarkTiltSchema = exports_external.object({
|
|
18687
|
+
object: exports_external.literal("portfolio_benchmark_tilt"),
|
|
18688
|
+
factorKey: exports_external.string(),
|
|
18689
|
+
portfolioBeta: exports_external.number(),
|
|
18690
|
+
benchmarkBeta: exports_external.number(),
|
|
18691
|
+
activeTilt: exports_external.number(),
|
|
18692
|
+
direction: exports_external.enum(["overweight", "underweight", "neutral"]),
|
|
18693
|
+
summary: exports_external.string()
|
|
18694
|
+
});
|
|
18695
|
+
var portfolioWhatIfComparisonSchema = exports_external.object({
|
|
18696
|
+
object: exports_external.literal("portfolio_what_if_comparison"),
|
|
18697
|
+
label: exports_external.string(),
|
|
18698
|
+
holdings: exports_external.array(portfolioHoldingInputSchema),
|
|
18699
|
+
exposureDeltas: exports_external.array(portfolioBenchmarkTiltSchema).default([]),
|
|
18700
|
+
summaryMd: exports_external.string()
|
|
18701
|
+
});
|
|
18702
|
+
var portfolioOptimizerCandidateSchema = exports_external.object({
|
|
18703
|
+
object: exports_external.literal("portfolio_optimizer_candidate"),
|
|
18704
|
+
rank: exports_external.number().int().positive(),
|
|
18705
|
+
name: exports_external.string(),
|
|
18706
|
+
objective: exports_external.enum(["current_reference", "factor_neutral", "min_drawdown", "regime_aware"]),
|
|
18707
|
+
holdings: exports_external.array(portfolioHoldingInputSchema),
|
|
18708
|
+
expectedReturn: exports_external.number(),
|
|
18709
|
+
expectedVolatility: exports_external.number(),
|
|
18710
|
+
expectedSharpe: exports_external.number(),
|
|
18711
|
+
maxDrawdownProxy: exports_external.number(),
|
|
18712
|
+
factorExposureScore: exports_external.number(),
|
|
18713
|
+
turnover: exports_external.number(),
|
|
18714
|
+
score: exports_external.number(),
|
|
18715
|
+
constraintStatus: exports_external.enum(["ok", "capped", "rejected"]),
|
|
18716
|
+
constraintsApplied: exports_external.array(exports_external.string()).default([]),
|
|
18717
|
+
rationale: exports_external.string()
|
|
18718
|
+
});
|
|
18719
|
+
var portfolioOptimizerCandidateSummarySchema = portfolioOptimizerCandidateSchema.omit({
|
|
18720
|
+
holdings: true
|
|
18721
|
+
});
|
|
18722
|
+
var portfolioOptimizerRuntimeSchema = exports_external.object({
|
|
18723
|
+
object: exports_external.literal("portfolio_optimizer_runtime"),
|
|
18724
|
+
method: exports_external.literal("bounded_deterministic_candidate_search"),
|
|
18725
|
+
candidateCount: exports_external.number().int().nonnegative(),
|
|
18726
|
+
iterationBudget: exports_external.number().int().positive(),
|
|
18727
|
+
iterationsRun: exports_external.number().int().nonnegative(),
|
|
18728
|
+
runtimeMs: exports_external.number(),
|
|
18729
|
+
maxRuntimeMs: exports_external.number().int().positive(),
|
|
18730
|
+
timeout: exports_external.boolean()
|
|
18731
|
+
});
|
|
17992
18732
|
var portfolioAnalysisSchema = exports_external.object({
|
|
17993
18733
|
object: exports_external.literal("portfolio_analysis"),
|
|
17994
18734
|
id: exports_external.string(),
|
|
17995
18735
|
asOf: exports_external.string(),
|
|
17996
18736
|
holdings: exports_external.array(portfolioHoldingInputSchema),
|
|
17997
18737
|
exposures: exports_external.array(factorExposureSchema).default([]),
|
|
18738
|
+
fit: portfolioFitSummarySchema.nullable().default(null),
|
|
18739
|
+
benchmarkLabel: exports_external.string().nullable().default(null),
|
|
18740
|
+
benchmarkTilts: exports_external.array(portfolioBenchmarkTiltSchema).default([]),
|
|
18741
|
+
whatIfComparison: portfolioWhatIfComparisonSchema.nullable().default(null),
|
|
17998
18742
|
positionViews: exports_external.array(exports_external.lazy(() => portfolioPositionFactorViewSchema)).default([]),
|
|
17999
18743
|
positionExposures: exports_external.array(factorExposureSchema).default([]),
|
|
18000
18744
|
attribution: exports_external.array(attributionContributionSchema).default([]),
|
|
18001
18745
|
hedgeSuggestions: exports_external.array(hedgeCandidateSchema).default([]),
|
|
18002
18746
|
optimizationNotes: exports_external.array(exports_external.string()).default([]),
|
|
18003
18747
|
factorNeutralPlan: exports_external.array(exports_external.string()).default([]),
|
|
18748
|
+
optimizerObjective: exports_external.enum(["factor_neutral", "min_drawdown", "regime_aware"]).optional(),
|
|
18749
|
+
optimizerConstraints: portfolioOptimizerConstraintsSchema.optional(),
|
|
18750
|
+
optimizerRuntime: portfolioOptimizerRuntimeSchema.optional(),
|
|
18751
|
+
optimizerCandidates: exports_external.array(portfolioOptimizerCandidateSchema).default([]).optional(),
|
|
18752
|
+
optimizerCandidateCount: exports_external.number().int().nonnegative().optional(),
|
|
18753
|
+
optimizerCandidateSample: exports_external.array(portfolioOptimizerCandidateSummarySchema).default([]).optional(),
|
|
18754
|
+
selectedCandidate: exports_external.union([portfolioOptimizerCandidateSchema, portfolioOptimizerCandidateSummarySchema]).nullable().optional(),
|
|
18755
|
+
optimizerDisclosures: exports_external.array(exports_external.string()).default([]).optional(),
|
|
18004
18756
|
summaryMd: exports_external.string(),
|
|
18005
18757
|
...investorMetadataShape
|
|
18006
18758
|
});
|
|
18007
|
-
var
|
|
18008
|
-
object: exports_external.literal("
|
|
18759
|
+
var portfolioFactorAttributionSchema = exports_external.object({
|
|
18760
|
+
object: exports_external.literal("portfolio_factor_attribution"),
|
|
18761
|
+
rank: exports_external.number().int().positive(),
|
|
18762
|
+
factorKey: exports_external.string(),
|
|
18763
|
+
factorName: exports_external.string(),
|
|
18764
|
+
factorCategory: exports_external.string(),
|
|
18765
|
+
contributionPercent: exports_external.number(),
|
|
18766
|
+
contributionPct: exports_external.number().nullable(),
|
|
18767
|
+
beta: exports_external.number(),
|
|
18768
|
+
factorReturn: exports_external.number(),
|
|
18769
|
+
rawReturn: exports_external.number().nullable().optional(),
|
|
18770
|
+
pureReturn: exports_external.number().nullable().optional(),
|
|
18771
|
+
scaledReturn: exports_external.number().nullable().optional(),
|
|
18772
|
+
zScore: exports_external.number().nullable().optional(),
|
|
18773
|
+
leverage: exports_external.number().nullable().optional(),
|
|
18774
|
+
modelName: exports_external.string().nullable().optional(),
|
|
18775
|
+
explanation: exports_external.string(),
|
|
18776
|
+
trace: traceReferenceSchema.nullable().optional()
|
|
18777
|
+
});
|
|
18778
|
+
var portfolioReturnPointSchema = exports_external.object({
|
|
18779
|
+
object: exports_external.literal("portfolio_return_point"),
|
|
18780
|
+
period: exports_external.string(),
|
|
18781
|
+
periodEnd: exports_external.string(),
|
|
18782
|
+
frequency: exports_external.enum(["daily", "weekly", "monthly", "quarterly", "annual"]),
|
|
18783
|
+
periodReturn: exports_external.number(),
|
|
18784
|
+
cumulativeReturn: exports_external.number(),
|
|
18785
|
+
coverageWeight: exports_external.number().min(0),
|
|
18786
|
+
missingSymbols: exports_external.array(exports_external.string()).default([])
|
|
18787
|
+
});
|
|
18788
|
+
var portfolioRollingBetaSchema = exports_external.object({
|
|
18789
|
+
object: exports_external.literal("portfolio_rolling_beta"),
|
|
18790
|
+
factorKey: exports_external.string(),
|
|
18791
|
+
factorName: exports_external.string(),
|
|
18792
|
+
factorCategory: exports_external.string(),
|
|
18793
|
+
beta: exports_external.number(),
|
|
18794
|
+
lookback: exports_external.string(),
|
|
18795
|
+
windowStart: exports_external.string().nullable(),
|
|
18796
|
+
windowEnd: exports_external.string(),
|
|
18797
|
+
rSquared: exports_external.number().nullable(),
|
|
18798
|
+
adjustedRSquared: exports_external.number().nullable(),
|
|
18799
|
+
observationCount: exports_external.number().int().nonnegative().nullable(),
|
|
18800
|
+
method: exports_external.literal("materialized_factor_exposure_regression_beta")
|
|
18801
|
+
});
|
|
18802
|
+
var portfolioAttributionExportFileSchema = exports_external.object({
|
|
18803
|
+
name: exports_external.string(),
|
|
18804
|
+
kind: exports_external.enum(["contributions", "return_stream", "rolling_betas"]),
|
|
18805
|
+
format: exports_external.literal("csv"),
|
|
18806
|
+
columns: exports_external.array(exports_external.string()).default([]),
|
|
18807
|
+
csv: exports_external.string()
|
|
18808
|
+
});
|
|
18809
|
+
var portfolioAttributionExportSchema = exports_external.object({
|
|
18810
|
+
object: exports_external.literal("portfolio_attribution_export"),
|
|
18811
|
+
requestedFormat: exports_external.enum(["json", "csv", "both"]),
|
|
18812
|
+
formats: exports_external.array(exports_external.enum(["json", "csv"])).default(["json"]),
|
|
18813
|
+
fileName: exports_external.string(),
|
|
18814
|
+
columns: exports_external.array(exports_external.string()).default([]),
|
|
18815
|
+
csv: exports_external.string().nullable().default(null),
|
|
18816
|
+
files: exports_external.array(portfolioAttributionExportFileSchema).default([])
|
|
18817
|
+
});
|
|
18818
|
+
var portfolioAttributionSchema = exports_external.object({
|
|
18819
|
+
object: exports_external.literal("portfolio_attribution"),
|
|
18009
18820
|
id: exports_external.string(),
|
|
18821
|
+
analysisId: exports_external.string(),
|
|
18010
18822
|
asOf: exports_external.string(),
|
|
18011
|
-
|
|
18012
|
-
|
|
18013
|
-
|
|
18014
|
-
|
|
18015
|
-
|
|
18016
|
-
|
|
18017
|
-
|
|
18823
|
+
country: exports_external.string(),
|
|
18824
|
+
window: exports_external.string(),
|
|
18825
|
+
lookback: exports_external.string(),
|
|
18826
|
+
frequency: exports_external.enum(["daily", "weekly", "monthly", "quarterly", "annual"]),
|
|
18827
|
+
holdings: exports_external.array(portfolioHoldingInputSchema),
|
|
18828
|
+
portfolioReturn: exports_external.number().nullable(),
|
|
18829
|
+
totalExplained: exports_external.number(),
|
|
18830
|
+
alpha: exports_external.number().nullable(),
|
|
18831
|
+
rSquared: exports_external.number().nullable(),
|
|
18832
|
+
contributions: exports_external.array(portfolioFactorAttributionSchema).default([]),
|
|
18833
|
+
returnStream: exports_external.array(portfolioReturnPointSchema).default([]),
|
|
18834
|
+
returnPointCount: exports_external.number().int().nonnegative().optional(),
|
|
18835
|
+
returnStreamSample: exports_external.array(portfolioReturnPointSchema).default([]).optional(),
|
|
18836
|
+
rollingBetas: exports_external.array(portfolioRollingBetaSchema).default([]),
|
|
18837
|
+
rollingBetaCount: exports_external.number().int().nonnegative().optional(),
|
|
18838
|
+
rollingBetasUnavailableReason: exports_external.string().nullable().default(null),
|
|
18839
|
+
exposures: exports_external.array(factorExposureSchema).default([]),
|
|
18840
|
+
export: portfolioAttributionExportSchema,
|
|
18018
18841
|
summaryMd: exports_external.string(),
|
|
18019
18842
|
...investorMetadataShape
|
|
18020
18843
|
});
|
|
18021
|
-
var
|
|
18022
|
-
|
|
18023
|
-
|
|
18024
|
-
|
|
18025
|
-
|
|
18026
|
-
|
|
18027
|
-
|
|
18844
|
+
var portfolioHedgeTargetExposureSchema = exports_external.object({
|
|
18845
|
+
object: exports_external.literal("portfolio_hedge_target_exposure"),
|
|
18846
|
+
factorKey: exports_external.string(),
|
|
18847
|
+
factorName: exports_external.string(),
|
|
18848
|
+
factorCategory: exports_external.string(),
|
|
18849
|
+
beta: exports_external.number(),
|
|
18850
|
+
targetExposureDelta: exports_external.number(),
|
|
18851
|
+
proposedExposureDelta: exports_external.number(),
|
|
18852
|
+
residualBeta: exports_external.number(),
|
|
18853
|
+
hedged: exports_external.boolean(),
|
|
18854
|
+
skipReason: exports_external.string().nullable()
|
|
18855
|
+
});
|
|
18856
|
+
var portfolioHedgeCandidateSchema = exports_external.object({
|
|
18857
|
+
object: exports_external.literal("portfolio_hedge_candidate"),
|
|
18858
|
+
rank: exports_external.number().int().positive(),
|
|
18859
|
+
factorKey: exports_external.string(),
|
|
18860
|
+
factorName: exports_external.string(),
|
|
18861
|
+
factorCategory: exports_external.string(),
|
|
18862
|
+
symbol: symbolSchema,
|
|
18863
|
+
instrumentType: portfolioHedgeInstrumentTypeSchema,
|
|
18864
|
+
action: exports_external.enum(["long", "short"]),
|
|
18865
|
+
recommendedWeight: exports_external.number(),
|
|
18866
|
+
targetExposureDelta: exports_external.number(),
|
|
18867
|
+
expectedExposureDelta: exports_external.record(exports_external.string(), exports_external.number()).default({}),
|
|
18868
|
+
residualBeta: exports_external.number(),
|
|
18869
|
+
constraintStatus: exports_external.enum(["ok", "capped"]),
|
|
18870
|
+
constraintsApplied: exports_external.array(exports_external.string()).default([]),
|
|
18871
|
+
liquidityUsd: exports_external.number().nullable(),
|
|
18872
|
+
estimatedCostBps: exports_external.number().nullable(),
|
|
18873
|
+
sectorKey: exports_external.string().nullable(),
|
|
18874
|
+
rationale: exports_external.string(),
|
|
18875
|
+
confidence: exports_external.enum(["high", "medium", "low"])
|
|
18876
|
+
});
|
|
18877
|
+
var portfolioHedgeSchema = exports_external.object({
|
|
18878
|
+
object: exports_external.literal("portfolio_hedge"),
|
|
18879
|
+
id: exports_external.string(),
|
|
18880
|
+
analysisId: exports_external.string().nullable(),
|
|
18881
|
+
asOf: exports_external.string(),
|
|
18882
|
+
country: exports_external.string(),
|
|
18883
|
+
lookback: exports_external.string(),
|
|
18884
|
+
objective: exports_external.enum(["factor_neutral", "min_drawdown", "regime_aware"]),
|
|
18885
|
+
mode: exports_external.enum(["compact", "standard"]),
|
|
18886
|
+
constraints: portfolioHedgeConstraintsSchema,
|
|
18887
|
+
holdings: exports_external.array(portfolioHoldingInputSchema),
|
|
18888
|
+
targetExposures: exports_external.array(portfolioHedgeTargetExposureSchema).default([]),
|
|
18889
|
+
hedges: exports_external.array(portfolioHedgeCandidateSchema).default([]),
|
|
18890
|
+
residualExposure: exports_external.record(exports_external.string(), exports_external.number()).default({}),
|
|
18891
|
+
exposures: exports_external.array(factorExposureSchema).default([]),
|
|
18892
|
+
optimizationNotes: exports_external.array(exports_external.string()).default([]),
|
|
18893
|
+
factorNeutralPlan: exports_external.array(exports_external.string()).default([]),
|
|
18894
|
+
summaryMd: exports_external.string(),
|
|
18895
|
+
...investorMetadataShape
|
|
18896
|
+
});
|
|
18897
|
+
var portfolioStressTestSchema = exports_external.object({
|
|
18898
|
+
object: exports_external.literal("portfolio_stress_test"),
|
|
18899
|
+
id: exports_external.string(),
|
|
18900
|
+
asOf: exports_external.string(),
|
|
18901
|
+
scenarioKey: exports_external.string(),
|
|
18902
|
+
scenarioLabel: exports_external.string(),
|
|
18903
|
+
estimatedDrawdownPercent: exports_external.number(),
|
|
18904
|
+
factorShocks: exports_external.record(exports_external.string(), exports_external.number()).default({}),
|
|
18905
|
+
macroShocks: exports_external.record(exports_external.string(), exports_external.number()).default({}),
|
|
18906
|
+
regime: macroRegimeSchema.nullable().optional(),
|
|
18907
|
+
conditioningNotes: exports_external.array(exports_external.string()).default([]),
|
|
18908
|
+
summaryMd: exports_external.string(),
|
|
18909
|
+
...investorMetadataShape
|
|
18910
|
+
});
|
|
18911
|
+
var factorDrillTargetSchema = exports_external.object({
|
|
18912
|
+
label: exports_external.string(),
|
|
18913
|
+
method: exports_external.literal("GET"),
|
|
18914
|
+
path: exports_external.string()
|
|
18915
|
+
});
|
|
18916
|
+
var portfolioPositionFactorViewSchema = exports_external.object({
|
|
18917
|
+
object: exports_external.literal("portfolio_position_factor_view"),
|
|
18028
18918
|
symbol: symbolSchema,
|
|
18029
18919
|
holding: portfolioHoldingInputSchema,
|
|
18030
18920
|
activeFactorCount: exports_external.number().int().nonnegative(),
|
|
@@ -18045,7 +18935,41 @@ var modelPortfolioFactorViewSchema = exports_external.object({
|
|
|
18045
18935
|
holdings: exports_external.array(portfolioHoldingInputSchema),
|
|
18046
18936
|
analysis: portfolioAnalysisSchema,
|
|
18047
18937
|
positionViews: exports_external.array(portfolioPositionFactorViewSchema).default([]),
|
|
18048
|
-
positionExposures: exports_external.array(factorExposureSchema).default([])
|
|
18938
|
+
positionExposures: exports_external.array(factorExposureSchema).default([]),
|
|
18939
|
+
...investorMetadataShape
|
|
18940
|
+
});
|
|
18941
|
+
var modelFactorAnalysisSchema = exports_external.object({
|
|
18942
|
+
object: exports_external.literal("model_factor_analysis"),
|
|
18943
|
+
id: exports_external.string(),
|
|
18944
|
+
asOf: exports_external.string(),
|
|
18945
|
+
model: exports_external.object({
|
|
18946
|
+
id: exports_external.string(),
|
|
18947
|
+
label: exports_external.string(),
|
|
18948
|
+
description: exports_external.string(),
|
|
18949
|
+
tags: exports_external.array(exports_external.string()).default([]),
|
|
18950
|
+
source: exports_external.enum(["turos", "client", "model_builder"])
|
|
18951
|
+
}),
|
|
18952
|
+
country: exports_external.string(),
|
|
18953
|
+
lookback: exports_external.string(),
|
|
18954
|
+
window: exports_external.string(),
|
|
18955
|
+
category: exports_external.string(),
|
|
18956
|
+
holdings: exports_external.array(portfolioHoldingInputSchema),
|
|
18957
|
+
include: modelFactorAnalysisIncludeSchema,
|
|
18958
|
+
analysis: portfolioAnalysisSchema,
|
|
18959
|
+
attribution: portfolioAttributionSchema.nullable(),
|
|
18960
|
+
hedge: portfolioHedgeSchema.nullable(),
|
|
18961
|
+
optimizerObjective: exports_external.enum(["factor_neutral", "min_drawdown", "regime_aware"]).optional(),
|
|
18962
|
+
optimizerConstraints: portfolioOptimizerConstraintsSchema.optional(),
|
|
18963
|
+
optimizerRuntime: portfolioOptimizerRuntimeSchema.optional(),
|
|
18964
|
+
optimizerCandidates: exports_external.array(portfolioOptimizerCandidateSchema).default([]).optional(),
|
|
18965
|
+
optimizerCandidateCount: exports_external.number().int().nonnegative().optional(),
|
|
18966
|
+
optimizerCandidateSample: exports_external.array(portfolioOptimizerCandidateSummarySchema).default([]).optional(),
|
|
18967
|
+
selectedCandidate: exports_external.union([portfolioOptimizerCandidateSchema, portfolioOptimizerCandidateSummarySchema]).nullable().optional(),
|
|
18968
|
+
optimizerDisclosures: exports_external.array(exports_external.string()).default([]).optional(),
|
|
18969
|
+
positionViews: exports_external.array(portfolioPositionFactorViewSchema).default([]),
|
|
18970
|
+
positionExposures: exports_external.array(factorExposureSchema).default([]),
|
|
18971
|
+
summaryMd: exports_external.string(),
|
|
18972
|
+
...investorMetadataShape
|
|
18049
18973
|
});
|
|
18050
18974
|
var factorRotationStrategySchema = exports_external.object({
|
|
18051
18975
|
object: exports_external.literal("factor_rotation_strategy"),
|
|
@@ -18756,11 +19680,1197 @@ var dilutionVerificationSummarySchema = exports_external.object({
|
|
|
18756
19680
|
modelVersion: exports_external.string().nullable()
|
|
18757
19681
|
});
|
|
18758
19682
|
var schemaRef = (name) => ({ $ref: `#/components/schemas/${name}` });
|
|
19683
|
+
var objectExampleBySchema = {
|
|
19684
|
+
FactorRegimeScreen: "regime_screen"
|
|
19685
|
+
};
|
|
19686
|
+
var exampleAsOf = "2026-06-09T22:15:00.000Z";
|
|
19687
|
+
var exampleSnapshotAt = "2026-06-09T19:45:00.000Z";
|
|
19688
|
+
var exampleDataDate = "2026-06-09";
|
|
19689
|
+
var exampleTrustMetadata = {
|
|
19690
|
+
dataAsOf: exampleDataDate,
|
|
19691
|
+
freshnessStatus: "fresh",
|
|
19692
|
+
methodologyVersion: "secapi_factor_returns_v1",
|
|
19693
|
+
materializationVersion: "2026-06-09",
|
|
19694
|
+
provenance: {
|
|
19695
|
+
source: "secapi_factor_pipeline",
|
|
19696
|
+
sourceLabel: "SecAPI factor pipeline",
|
|
19697
|
+
accessionNumber: null,
|
|
19698
|
+
filingUrl: "https://docs.secapi.ai/factors/methodology",
|
|
19699
|
+
acceptedAt: null,
|
|
19700
|
+
retrievedAt: exampleAsOf,
|
|
19701
|
+
parserVersion: "secapi-factor-pipeline"
|
|
19702
|
+
},
|
|
19703
|
+
freshness: {
|
|
19704
|
+
status: "fresh",
|
|
19705
|
+
asOf: exampleAsOf,
|
|
19706
|
+
sourcePublishedAt: "2026-06-09T21:30:00.000Z",
|
|
19707
|
+
lagMs: 2700000
|
|
19708
|
+
},
|
|
19709
|
+
materialization: {
|
|
19710
|
+
parserVersion: "secapi-factor-pipeline",
|
|
19711
|
+
materializationVersion: "2026-06-09"
|
|
19712
|
+
},
|
|
19713
|
+
sourceRights: {
|
|
19714
|
+
source: "secapi_owned_factor_pipeline",
|
|
19715
|
+
sourceLabel: "SecAPI factor pipeline",
|
|
19716
|
+
posture: "public_safe",
|
|
19717
|
+
publicAvailability: "public",
|
|
19718
|
+
contractStatus: "approved",
|
|
19719
|
+
restrictions: [],
|
|
19720
|
+
notes: "SecAPI-owned derived factor data."
|
|
19721
|
+
},
|
|
19722
|
+
methodology: {
|
|
19723
|
+
id: "secapi_factor_returns",
|
|
19724
|
+
version: "v1",
|
|
19725
|
+
summary: "SecAPI-owned daily factor returns, exposures, and portfolio analytics built for agent and API workflows.",
|
|
19726
|
+
confidence: "high",
|
|
19727
|
+
launchState: "beta",
|
|
19728
|
+
inputs: ["secapi_factor_returns", "secapi_factor_exposures", "market_calendar"],
|
|
19729
|
+
validation: { launchHistoryFloor: "2015-01-01", marketCalendarAware: true }
|
|
19730
|
+
},
|
|
19731
|
+
revision: {
|
|
19732
|
+
sourcePublishedAt: "2026-06-09T21:30:00.000Z",
|
|
19733
|
+
retrievedAt: exampleAsOf,
|
|
19734
|
+
vintageId: "2026-06-09",
|
|
19735
|
+
revisedFrom: null
|
|
19736
|
+
},
|
|
19737
|
+
degradedState: null
|
|
19738
|
+
};
|
|
19739
|
+
var exampleLaunchReadiness = {
|
|
19740
|
+
object: "factor_launch_readiness",
|
|
19741
|
+
status: "launch_ready",
|
|
19742
|
+
proofGated: true,
|
|
19743
|
+
proofReady: true,
|
|
19744
|
+
observedProofStatus: "ready",
|
|
19745
|
+
proofObservedAt: exampleAsOf,
|
|
19746
|
+
requiredProofArtifact: "factor_quality_daily_proof",
|
|
19747
|
+
requiredProofStatus: "ready",
|
|
19748
|
+
targetHistoryStartDate: "2015-01-01",
|
|
19749
|
+
historyStartDateClaim: "2015-01-01",
|
|
19750
|
+
betaReason: null,
|
|
19751
|
+
exclusionReason: null,
|
|
19752
|
+
claimPrerequisites: ["2015+ launch history", "latest complete market day", "row-level quality proof"]
|
|
19753
|
+
};
|
|
19754
|
+
var exampleQualityProof = {
|
|
19755
|
+
object: "factor_quality_proof",
|
|
19756
|
+
status: "ready",
|
|
19757
|
+
proofSource: "secapi_factor_pipeline",
|
|
19758
|
+
proofObservedAt: exampleAsOf,
|
|
19759
|
+
rowLevelProofAvailable: true,
|
|
19760
|
+
proofReady: true,
|
|
19761
|
+
firstDate: "2015-01-02",
|
|
19762
|
+
lastDate: "2026-06-09",
|
|
19763
|
+
firstRequiredMarketDate: "2015-01-02",
|
|
19764
|
+
latestMarketDay: "2026-06-09",
|
|
19765
|
+
targetHistoryStartDate: "2015-01-01",
|
|
19766
|
+
requiredHistoryStartDate: "2015-01-01",
|
|
19767
|
+
shortHistoryExempt: false,
|
|
19768
|
+
historyStartMarketDayLag: 0,
|
|
19769
|
+
latestMarketDayLag: 0,
|
|
19770
|
+
rowCount: 2882,
|
|
19771
|
+
distinctFactorDateCount: 2882,
|
|
19772
|
+
coveredMarketDateCount: 2882,
|
|
19773
|
+
expectedMarketDateCount: 2882,
|
|
19774
|
+
missingSessionCount: 0,
|
|
19775
|
+
coveragePct: 1,
|
|
19776
|
+
methodologyVersion: "secapi_factor_returns_v1",
|
|
19777
|
+
modelName: "secapi_stock_basket_factor_model_v1",
|
|
19778
|
+
methodologyUrl: "https://docs.secapi.ai/factors/methodology",
|
|
19779
|
+
sourceMetadata: {
|
|
19780
|
+
latestAsOf: "2026-06-09",
|
|
19781
|
+
latestSourcePublishedAt: "2026-06-09T21:30:00.000Z",
|
|
19782
|
+
observedModelNameCount: 1,
|
|
19783
|
+
observedModelNamesSample: ["secapi_stock_basket_factor_model_v1"],
|
|
19784
|
+
nonStockBasketRowCount: 0,
|
|
19785
|
+
metadataModelNames: ["secapi_stock_basket_factor_model_v1"],
|
|
19786
|
+
metadataModelVersions: ["2026-06-09"],
|
|
19787
|
+
metadataMethodologyUrls: ["https://docs.secapi.ai/factors/methodology"]
|
|
19788
|
+
},
|
|
19789
|
+
degradedReasons: []
|
|
19790
|
+
};
|
|
19791
|
+
var exampleHoldings = [
|
|
19792
|
+
{ symbol: "AAPL", weight: 0.35 },
|
|
19793
|
+
{ symbol: "MSFT", weight: 0.3 },
|
|
19794
|
+
{ symbol: "NVDA", weight: 0.2 },
|
|
19795
|
+
{ symbol: "JPM", weight: 0.15 }
|
|
19796
|
+
];
|
|
19797
|
+
var exampleHedgeConstraints = {
|
|
19798
|
+
maxHedges: 3,
|
|
19799
|
+
maxPositionWeight: 0.08,
|
|
19800
|
+
maxTotalHedgeWeight: 0.2,
|
|
19801
|
+
maxSectorWeight: 0.35,
|
|
19802
|
+
hedgeIntensity: 0.75,
|
|
19803
|
+
longOnly: false,
|
|
19804
|
+
allowedInstrumentTypes: ["etf"],
|
|
19805
|
+
customUniverse: ["QUAL", "MTUM", "VLUE", "USMV"],
|
|
19806
|
+
targetExposures: { VALUE: 0, MOMENTUM: 0.1 },
|
|
19807
|
+
minConfidence: "medium",
|
|
19808
|
+
minLiquidityUsd: 1e7,
|
|
19809
|
+
excludedSectors: []
|
|
19810
|
+
};
|
|
19811
|
+
var exampleOptimizerConstraints = {
|
|
19812
|
+
maxCandidates: 3,
|
|
19813
|
+
maxIterations: 50,
|
|
19814
|
+
maxRuntimeMs: 750,
|
|
19815
|
+
maxPositionWeight: 0.4,
|
|
19816
|
+
minPositionWeight: 0.02,
|
|
19817
|
+
longOnly: true,
|
|
19818
|
+
turnoverLimit: 0.25,
|
|
19819
|
+
riskFreeRate: 0.04
|
|
19820
|
+
};
|
|
19821
|
+
var exampleExposure = {
|
|
19822
|
+
object: "factor_exposure",
|
|
19823
|
+
id: "factor_exposure:AAPL:VALUE:2026-06-09",
|
|
19824
|
+
subjectType: "security",
|
|
19825
|
+
subjectKey: "AAPL",
|
|
19826
|
+
factorKey: "VALUE",
|
|
19827
|
+
beta: -0.42,
|
|
19828
|
+
intercept: 0.001,
|
|
19829
|
+
rSquared: 0.31,
|
|
19830
|
+
adjustedRSquared: 0.29,
|
|
19831
|
+
tStat: -4.8,
|
|
19832
|
+
observationCount: 126,
|
|
19833
|
+
nActiveFactors: 7,
|
|
19834
|
+
percentile: 18.2,
|
|
19835
|
+
confidence: "high",
|
|
19836
|
+
modelName: "secapi_stock_basket_factor_model_v1",
|
|
19837
|
+
asOf: exampleAsOf,
|
|
19838
|
+
responseMode: "compact",
|
|
19839
|
+
...exampleTrustMetadata,
|
|
19840
|
+
methodologyVersion: "secapi_factor_exposures_v1"
|
|
19841
|
+
};
|
|
19842
|
+
var exampleFactorReturn = {
|
|
19843
|
+
object: "factor_return",
|
|
19844
|
+
id: "factor_return:VALUE:1m:2026-06-09",
|
|
19845
|
+
factorKey: "VALUE",
|
|
19846
|
+
factorName: "Value",
|
|
19847
|
+
category: "style",
|
|
19848
|
+
asOf: exampleAsOf,
|
|
19849
|
+
window: "1m",
|
|
19850
|
+
modelName: "secapi_stock_basket_factor_model_v1",
|
|
19851
|
+
rawReturn: 0.018,
|
|
19852
|
+
pureReturn: 0.014,
|
|
19853
|
+
scaledReturn: 0.021,
|
|
19854
|
+
zScore: 1.42,
|
|
19855
|
+
leverage: 1,
|
|
19856
|
+
qualityProof: exampleQualityProof,
|
|
19857
|
+
responseMode: "compact",
|
|
19858
|
+
...exampleTrustMetadata
|
|
19859
|
+
};
|
|
19860
|
+
var exampleRegime = {
|
|
19861
|
+
key: "soft_landing",
|
|
19862
|
+
label: "Soft Landing",
|
|
19863
|
+
country: "US",
|
|
19864
|
+
confidence: "medium",
|
|
19865
|
+
drivers: [],
|
|
19866
|
+
factorImpacts: []
|
|
19867
|
+
};
|
|
19868
|
+
var exampleRegimePerformance = {
|
|
19869
|
+
object: "factor_regime_performance",
|
|
19870
|
+
id: "factor_regime_performance:US:VALUE:soft_landing:2026-06-09",
|
|
19871
|
+
country: "US",
|
|
19872
|
+
regimeKey: "soft_landing",
|
|
19873
|
+
regimeLabel: "Soft Landing",
|
|
19874
|
+
factorKey: "VALUE",
|
|
19875
|
+
factorName: "Value",
|
|
19876
|
+
factorCategory: "style",
|
|
19877
|
+
window: "1m",
|
|
19878
|
+
lookback: "6m",
|
|
19879
|
+
rank: 1,
|
|
19880
|
+
regimeScore: 0.68,
|
|
19881
|
+
combinedScore: 0.74,
|
|
19882
|
+
direction: "tailwind",
|
|
19883
|
+
rationale: "Value has positive recent return and historically improves in this regime.",
|
|
19884
|
+
rawReturn: 0.018,
|
|
19885
|
+
pureReturn: 0.014,
|
|
19886
|
+
scaledReturn: 0.021,
|
|
19887
|
+
zScore: 1.42,
|
|
19888
|
+
leverage: 1,
|
|
19889
|
+
asOf: exampleAsOf,
|
|
19890
|
+
responseMode: "compact",
|
|
19891
|
+
...exampleTrustMetadata
|
|
19892
|
+
};
|
|
19893
|
+
var examplePortfolioAnalysis = {
|
|
19894
|
+
object: "portfolio_analysis",
|
|
19895
|
+
id: "portfolio_analysis:example:2026-06-09",
|
|
19896
|
+
asOf: exampleAsOf,
|
|
19897
|
+
holdings: exampleHoldings,
|
|
19898
|
+
exposures: [exampleExposure],
|
|
19899
|
+
fit: null,
|
|
19900
|
+
benchmarkLabel: "NASDAQ 100",
|
|
19901
|
+
benchmarkTilts: [],
|
|
19902
|
+
whatIfComparison: null,
|
|
19903
|
+
positionViews: [],
|
|
19904
|
+
positionExposures: [exampleExposure],
|
|
19905
|
+
attribution: [
|
|
19906
|
+
{
|
|
19907
|
+
key: "VALUE",
|
|
19908
|
+
label: "Value",
|
|
19909
|
+
category: "factor",
|
|
19910
|
+
contributionPercent: -0.48,
|
|
19911
|
+
explanation: "Negative value beta detracted as value lagged over the selected window."
|
|
19912
|
+
}
|
|
19913
|
+
],
|
|
19914
|
+
hedgeSuggestions: [
|
|
19915
|
+
{
|
|
19916
|
+
symbol: "VLUE",
|
|
19917
|
+
instrumentType: "etf",
|
|
19918
|
+
rationale: "Offsets the portfolio's negative value exposure with a liquid value ETF sleeve.",
|
|
19919
|
+
expectedExposureDelta: { VALUE: 0.18 },
|
|
19920
|
+
confidence: "medium"
|
|
19921
|
+
}
|
|
19922
|
+
],
|
|
19923
|
+
optimizationNotes: ["Candidate search respected max position and turnover constraints."],
|
|
19924
|
+
factorNeutralPlan: ["Reduce negative VALUE exposure before increasing MOMENTUM exposure."],
|
|
19925
|
+
optimizerObjective: "factor_neutral",
|
|
19926
|
+
optimizerConstraints: exampleOptimizerConstraints,
|
|
19927
|
+
optimizerRuntime: {
|
|
19928
|
+
object: "portfolio_optimizer_runtime",
|
|
19929
|
+
method: "bounded_deterministic_candidate_search",
|
|
19930
|
+
candidateCount: 3,
|
|
19931
|
+
iterationBudget: 50,
|
|
19932
|
+
iterationsRun: 38,
|
|
19933
|
+
runtimeMs: 118,
|
|
19934
|
+
maxRuntimeMs: 750,
|
|
19935
|
+
timeout: false
|
|
19936
|
+
},
|
|
19937
|
+
optimizerCandidateCount: 1,
|
|
19938
|
+
optimizerCandidateSample: [
|
|
19939
|
+
{
|
|
19940
|
+
object: "portfolio_optimizer_candidate",
|
|
19941
|
+
rank: 1,
|
|
19942
|
+
name: "Factor-neutral tilt",
|
|
19943
|
+
objective: "factor_neutral",
|
|
19944
|
+
expectedReturn: 0.087,
|
|
19945
|
+
expectedVolatility: 0.164,
|
|
19946
|
+
expectedSharpe: 0.53,
|
|
19947
|
+
maxDrawdownProxy: -0.18,
|
|
19948
|
+
factorExposureScore: 0.21,
|
|
19949
|
+
turnover: 0.12,
|
|
19950
|
+
score: 0.81,
|
|
19951
|
+
constraintStatus: "ok",
|
|
19952
|
+
constraintsApplied: ["turnoverLimit"],
|
|
19953
|
+
rationale: "Improves factor balance without breaching turnover or concentration limits."
|
|
19954
|
+
}
|
|
19955
|
+
],
|
|
19956
|
+
selectedCandidate: null,
|
|
19957
|
+
optimizerDisclosures: ["Optimizer output is a deterministic scenario, not investment advice."],
|
|
19958
|
+
summaryMd: "Portfolio is growth and quality tilted with a moderate negative value exposure.",
|
|
19959
|
+
responseMode: "compact",
|
|
19960
|
+
...exampleTrustMetadata,
|
|
19961
|
+
methodologyVersion: "secapi_portfolio_factor_v1"
|
|
19962
|
+
};
|
|
19963
|
+
var examplePortfolioAttribution = {
|
|
19964
|
+
object: "portfolio_attribution",
|
|
19965
|
+
id: "portfolio_attribution:example:2026-06-09",
|
|
19966
|
+
analysisId: "portfolio_analysis:example:2026-06-09",
|
|
19967
|
+
asOf: exampleAsOf,
|
|
19968
|
+
country: "US",
|
|
19969
|
+
window: "3m",
|
|
19970
|
+
lookback: "12m",
|
|
19971
|
+
frequency: "weekly",
|
|
19972
|
+
holdings: exampleHoldings,
|
|
19973
|
+
portfolioReturn: 0.082,
|
|
19974
|
+
totalExplained: 0.061,
|
|
19975
|
+
alpha: 0.021,
|
|
19976
|
+
rSquared: 0.74,
|
|
19977
|
+
contributions: [
|
|
19978
|
+
{
|
|
19979
|
+
object: "portfolio_factor_attribution",
|
|
19980
|
+
rank: 1,
|
|
19981
|
+
factorKey: "MOMENTUM",
|
|
19982
|
+
factorName: "Momentum",
|
|
19983
|
+
factorCategory: "style",
|
|
19984
|
+
contributionPercent: 2.4,
|
|
19985
|
+
contributionPct: 0.024,
|
|
19986
|
+
beta: 0.37,
|
|
19987
|
+
factorReturn: 0.065,
|
|
19988
|
+
rawReturn: 0.058,
|
|
19989
|
+
pureReturn: 0.052,
|
|
19990
|
+
scaledReturn: 0.065,
|
|
19991
|
+
zScore: 1.7,
|
|
19992
|
+
leverage: 1,
|
|
19993
|
+
modelName: "secapi_stock_basket_factor_model_v1",
|
|
19994
|
+
explanation: "Positive momentum exposure explained 240 bps of the portfolio return."
|
|
19995
|
+
}
|
|
19996
|
+
],
|
|
19997
|
+
returnStream: [],
|
|
19998
|
+
returnPointCount: 12,
|
|
19999
|
+
returnStreamSample: [
|
|
20000
|
+
{
|
|
20001
|
+
object: "portfolio_return_point",
|
|
20002
|
+
period: "2026-W22",
|
|
20003
|
+
periodEnd: "2026-05-29",
|
|
20004
|
+
frequency: "weekly",
|
|
20005
|
+
periodReturn: 0.011,
|
|
20006
|
+
cumulativeReturn: 0.064,
|
|
20007
|
+
coverageWeight: 1,
|
|
20008
|
+
missingSymbols: []
|
|
20009
|
+
}
|
|
20010
|
+
],
|
|
20011
|
+
rollingBetas: [],
|
|
20012
|
+
rollingBetaCount: 4,
|
|
20013
|
+
rollingBetasUnavailableReason: null,
|
|
20014
|
+
exposures: [exampleExposure],
|
|
20015
|
+
export: {
|
|
20016
|
+
object: "portfolio_attribution_export",
|
|
20017
|
+
requestedFormat: "json",
|
|
20018
|
+
formats: ["json"],
|
|
20019
|
+
fileName: "secapi-portfolio-attribution-2026-06-09",
|
|
20020
|
+
columns: ["factorKey", "contributionPercent", "beta", "factorReturn"],
|
|
20021
|
+
csv: null,
|
|
20022
|
+
files: []
|
|
20023
|
+
},
|
|
20024
|
+
summaryMd: "Momentum and quality explained most of the recent return while value detracted.",
|
|
20025
|
+
responseMode: "compact",
|
|
20026
|
+
...exampleTrustMetadata,
|
|
20027
|
+
methodologyVersion: "secapi_portfolio_attribution_v1"
|
|
20028
|
+
};
|
|
20029
|
+
var examplePortfolioHedge = {
|
|
20030
|
+
object: "portfolio_hedge",
|
|
20031
|
+
id: "portfolio_hedge:example:2026-06-09",
|
|
20032
|
+
analysisId: "portfolio_analysis:example:2026-06-09",
|
|
20033
|
+
asOf: exampleAsOf,
|
|
20034
|
+
country: "US",
|
|
20035
|
+
lookback: "12m",
|
|
20036
|
+
objective: "factor_neutral",
|
|
20037
|
+
mode: "compact",
|
|
20038
|
+
constraints: exampleHedgeConstraints,
|
|
20039
|
+
holdings: exampleHoldings,
|
|
20040
|
+
targetExposures: [
|
|
20041
|
+
{
|
|
20042
|
+
object: "portfolio_hedge_target_exposure",
|
|
20043
|
+
factorKey: "VALUE",
|
|
20044
|
+
factorName: "Value",
|
|
20045
|
+
factorCategory: "style",
|
|
20046
|
+
beta: -0.42,
|
|
20047
|
+
targetExposureDelta: 0.42,
|
|
20048
|
+
proposedExposureDelta: 0.18,
|
|
20049
|
+
residualBeta: -0.24,
|
|
20050
|
+
hedged: true,
|
|
20051
|
+
skipReason: null
|
|
20052
|
+
}
|
|
20053
|
+
],
|
|
20054
|
+
hedges: [
|
|
20055
|
+
{
|
|
20056
|
+
object: "portfolio_hedge_candidate",
|
|
20057
|
+
rank: 1,
|
|
20058
|
+
factorKey: "VALUE",
|
|
20059
|
+
factorName: "Value",
|
|
20060
|
+
factorCategory: "style",
|
|
20061
|
+
symbol: "VLUE",
|
|
20062
|
+
instrumentType: "etf",
|
|
20063
|
+
action: "long",
|
|
20064
|
+
recommendedWeight: 0.08,
|
|
20065
|
+
targetExposureDelta: 0.42,
|
|
20066
|
+
expectedExposureDelta: { VALUE: 0.18 },
|
|
20067
|
+
residualBeta: -0.24,
|
|
20068
|
+
constraintStatus: "ok",
|
|
20069
|
+
constraintsApplied: ["maxPositionWeight"],
|
|
20070
|
+
liquidityUsd: 145000000,
|
|
20071
|
+
estimatedCostBps: 4,
|
|
20072
|
+
sectorKey: null,
|
|
20073
|
+
rationale: "Adds liquid value exposure without increasing single-name concentration.",
|
|
20074
|
+
confidence: "medium"
|
|
20075
|
+
}
|
|
20076
|
+
],
|
|
20077
|
+
residualExposure: { VALUE: -0.24, MOMENTUM: 0.37 },
|
|
20078
|
+
exposures: [exampleExposure],
|
|
20079
|
+
optimizationNotes: ["Hedge candidates are bounded by liquidity and max total hedge weight."],
|
|
20080
|
+
factorNeutralPlan: ["Add VLUE at 8% funded pro rata from overweight growth names."],
|
|
20081
|
+
summaryMd: "The suggested hedge reduces negative VALUE beta while keeping total hedge weight under 20%.",
|
|
20082
|
+
responseMode: "compact",
|
|
20083
|
+
...exampleTrustMetadata,
|
|
20084
|
+
methodologyVersion: "secapi_portfolio_hedge_v1"
|
|
20085
|
+
};
|
|
20086
|
+
var responseExampleBySchema = {
|
|
20087
|
+
FactorCatalog: {
|
|
20088
|
+
object: "list",
|
|
20089
|
+
data: [
|
|
20090
|
+
{
|
|
20091
|
+
object: "factor_definition",
|
|
20092
|
+
id: "factor:VALUE",
|
|
20093
|
+
key: "VALUE",
|
|
20094
|
+
name: "Value",
|
|
20095
|
+
category: "style",
|
|
20096
|
+
description: "Long cheaper stocks and short expensive stocks using SecAPI-owned factor construction.",
|
|
20097
|
+
benchmarkSymbol: "VLUE",
|
|
20098
|
+
equation: { long_leg: 1, short_leg: -1 },
|
|
20099
|
+
orthogonalizedAgainst: ["MARKET"],
|
|
20100
|
+
catalogStatus: "launch_ready",
|
|
20101
|
+
sourceAvailabilityStatus: "implemented",
|
|
20102
|
+
launchUniverseStatus: "launch_candidate",
|
|
20103
|
+
launchClaimStatus: "candidate_pending_history_freshness_proof",
|
|
20104
|
+
launchParityCategory: "style",
|
|
20105
|
+
launchReadiness: exampleLaunchReadiness,
|
|
20106
|
+
qualityProof: exampleQualityProof,
|
|
20107
|
+
responseMode: "compact",
|
|
20108
|
+
...exampleTrustMetadata
|
|
20109
|
+
}
|
|
20110
|
+
],
|
|
20111
|
+
hasMore: false,
|
|
20112
|
+
nextCursor: null,
|
|
20113
|
+
categories: ["market", "style", "sector", "industry"],
|
|
20114
|
+
requestId: "req_example"
|
|
20115
|
+
},
|
|
20116
|
+
FactorReturnList: {
|
|
20117
|
+
object: "list",
|
|
20118
|
+
data: [exampleFactorReturn],
|
|
20119
|
+
hasMore: false,
|
|
20120
|
+
nextCursor: null,
|
|
20121
|
+
responseMode: "compact",
|
|
20122
|
+
requestId: "req_example"
|
|
20123
|
+
},
|
|
20124
|
+
FactorHistory: {
|
|
20125
|
+
object: "factor_history",
|
|
20126
|
+
id: "factor_history:VALUE:1y:2026-06-09",
|
|
20127
|
+
factorKey: "VALUE",
|
|
20128
|
+
factorName: "Value",
|
|
20129
|
+
category: "style",
|
|
20130
|
+
range: "1y",
|
|
20131
|
+
dateFrom: "2025-06-10",
|
|
20132
|
+
dateTo: "2026-06-09",
|
|
20133
|
+
historyStartDate: "2015-01-02",
|
|
20134
|
+
historyEndDate: "2026-06-09",
|
|
20135
|
+
observationCount: 252,
|
|
20136
|
+
asOf: exampleAsOf,
|
|
20137
|
+
series: [],
|
|
20138
|
+
seriesCount: 252,
|
|
20139
|
+
seriesSample: [
|
|
20140
|
+
{ date: "2025-06-10", rawReturn: 0.0012, pureReturn: 0.0009, scaledReturn: 0.0011, zScore: 0.18, leverage: 1 },
|
|
20141
|
+
{ date: "2026-06-09", rawReturn: 0.0038, pureReturn: 0.0031, scaledReturn: 0.0042, zScore: 1.42, leverage: 1 }
|
|
20142
|
+
],
|
|
20143
|
+
expansionHints: ["Use include=series for full daily observations in compact mode."],
|
|
20144
|
+
summaryWindows: [
|
|
20145
|
+
{ window: "1d", rawReturn: 0.0038, pureReturn: 0.0031, scaledReturn: 0.0042, observationCount: 1, startDate: "2026-06-09", endDate: "2026-06-09" },
|
|
20146
|
+
{ window: "1m", rawReturn: 0.018, pureReturn: 0.014, scaledReturn: 0.021, observationCount: 21, startDate: "2026-05-11", endDate: "2026-06-09" },
|
|
20147
|
+
{ window: "max", rawReturn: 1.46, pureReturn: 1.12, scaledReturn: 1.31, observationCount: 2882, startDate: "2015-01-02", endDate: "2026-06-09" }
|
|
20148
|
+
],
|
|
20149
|
+
qualityProof: exampleQualityProof,
|
|
20150
|
+
responseMode: "compact",
|
|
20151
|
+
...exampleTrustMetadata,
|
|
20152
|
+
methodologyVersion: "secapi_factor_returns_v1"
|
|
20153
|
+
},
|
|
20154
|
+
FactorSparklineList: {
|
|
20155
|
+
object: "list",
|
|
20156
|
+
data: [
|
|
20157
|
+
{
|
|
20158
|
+
object: "factor_sparkline",
|
|
20159
|
+
id: "factor_sparkline:VALUE:1y:scaled_return",
|
|
20160
|
+
factorKey: "VALUE",
|
|
20161
|
+
factorName: "Value",
|
|
20162
|
+
category: "style",
|
|
20163
|
+
range: "1y",
|
|
20164
|
+
metric: "scaled_return",
|
|
20165
|
+
dateFrom: "2025-06-10",
|
|
20166
|
+
dateTo: "2026-06-09",
|
|
20167
|
+
historyStartDate: "2015-01-02",
|
|
20168
|
+
historyEndDate: "2026-06-09",
|
|
20169
|
+
observationCount: 252,
|
|
20170
|
+
pointCount: 120,
|
|
20171
|
+
asOf: exampleAsOf,
|
|
20172
|
+
latestValue: 0.131,
|
|
20173
|
+
latestRawReturn: 0.0038,
|
|
20174
|
+
latestPureReturn: 0.0031,
|
|
20175
|
+
latestScaledReturn: 0.0042,
|
|
20176
|
+
latestZScore: 1.42,
|
|
20177
|
+
latestLeverage: 1,
|
|
20178
|
+
summaryWindows: [
|
|
20179
|
+
{ window: "1m", rawReturn: 0.018, pureReturn: 0.014, scaledReturn: 0.021, observationCount: 21, startDate: "2026-05-11", endDate: "2026-06-09" }
|
|
20180
|
+
],
|
|
20181
|
+
points: [
|
|
20182
|
+
{ date: "2025-06-10", value: 0 },
|
|
20183
|
+
{ date: "2026-06-09", value: 0.131 }
|
|
20184
|
+
],
|
|
20185
|
+
qualityProof: exampleQualityProof,
|
|
20186
|
+
responseMode: "compact",
|
|
20187
|
+
...exampleTrustMetadata
|
|
20188
|
+
}
|
|
20189
|
+
],
|
|
20190
|
+
hasMore: false,
|
|
20191
|
+
nextCursor: null,
|
|
20192
|
+
responseMode: "compact",
|
|
20193
|
+
requestId: "req_example"
|
|
20194
|
+
},
|
|
20195
|
+
FactorDashboard: {
|
|
20196
|
+
object: "factor_dashboard",
|
|
20197
|
+
id: "factor_dashboard:US:style:2026-06-09",
|
|
20198
|
+
asOf: exampleAsOf,
|
|
20199
|
+
country: "US",
|
|
20200
|
+
category: "style",
|
|
20201
|
+
window: "1m",
|
|
20202
|
+
lookback: "6m",
|
|
20203
|
+
intraday: [],
|
|
20204
|
+
regimePerformance: [],
|
|
20205
|
+
rotation: null,
|
|
20206
|
+
spotlightSymbol: "AAPL",
|
|
20207
|
+
spotlightExposures: [exampleExposure],
|
|
20208
|
+
modelPortfolio: null,
|
|
20209
|
+
summaryMd: "Value is a tailwind, momentum remains extended, and the portfolio spotlight shows negative value exposure.",
|
|
20210
|
+
responseMode: "compact",
|
|
20211
|
+
...exampleTrustMetadata,
|
|
20212
|
+
methodologyVersion: "secapi_factor_dashboard_v1"
|
|
20213
|
+
},
|
|
20214
|
+
FactorIntradaySnapshotList: {
|
|
20215
|
+
object: "list",
|
|
20216
|
+
data: [
|
|
20217
|
+
{
|
|
20218
|
+
object: "factor_intraday_snapshot",
|
|
20219
|
+
id: "factor_intraday_snapshot:VALUE:1d:2026-06-09T19:45:00.000Z",
|
|
20220
|
+
factorKey: "VALUE",
|
|
20221
|
+
factorName: "Value",
|
|
20222
|
+
factorCategory: "style",
|
|
20223
|
+
modelName: "secapi_stock_basket_factor_model_v1",
|
|
20224
|
+
window: "1d",
|
|
20225
|
+
snapshotAt: exampleSnapshotAt,
|
|
20226
|
+
benchmarkSymbols: ["VLUE", "IWD", "IWF"],
|
|
20227
|
+
rawReturn: 0.0038,
|
|
20228
|
+
pureReturn: 0.0031,
|
|
20229
|
+
scaledReturn: 0.0042,
|
|
20230
|
+
zScore: 1.42,
|
|
20231
|
+
leverage: 1,
|
|
20232
|
+
responseMode: "compact",
|
|
20233
|
+
...exampleTrustMetadata
|
|
20234
|
+
}
|
|
20235
|
+
],
|
|
20236
|
+
hasMore: false,
|
|
20237
|
+
nextCursor: null,
|
|
20238
|
+
responseMode: "compact",
|
|
20239
|
+
requestId: "req_example"
|
|
20240
|
+
},
|
|
20241
|
+
FactorRegimePerformanceList: {
|
|
20242
|
+
object: "list",
|
|
20243
|
+
data: [exampleRegimePerformance],
|
|
20244
|
+
hasMore: false,
|
|
20245
|
+
nextCursor: null,
|
|
20246
|
+
responseMode: "compact",
|
|
20247
|
+
requestId: "req_example"
|
|
20248
|
+
},
|
|
20249
|
+
FactorExtremeMoveList: {
|
|
20250
|
+
object: "list",
|
|
20251
|
+
data: [
|
|
20252
|
+
{
|
|
20253
|
+
object: "factor_extreme_move",
|
|
20254
|
+
id: "factor_extreme_move:MOMENTUM:1m:2026-06-09",
|
|
20255
|
+
rank: 1,
|
|
20256
|
+
factorKey: "MOMENTUM",
|
|
20257
|
+
factorName: "Momentum",
|
|
20258
|
+
category: "style",
|
|
20259
|
+
window: "1m",
|
|
20260
|
+
lookback: "6m",
|
|
20261
|
+
direction: "up",
|
|
20262
|
+
sort: "abs_z_score",
|
|
20263
|
+
score: 2.61,
|
|
20264
|
+
absZScore: 2.61,
|
|
20265
|
+
absScaledReturn: 0.064,
|
|
20266
|
+
minAbsZScore: 2,
|
|
20267
|
+
isExtreme: true,
|
|
20268
|
+
asOf: exampleAsOf,
|
|
20269
|
+
rawReturn: 0.057,
|
|
20270
|
+
pureReturn: 0.049,
|
|
20271
|
+
scaledReturn: 0.064,
|
|
20272
|
+
zScore: 2.61,
|
|
20273
|
+
leverage: 1,
|
|
20274
|
+
responseMode: "compact",
|
|
20275
|
+
...exampleTrustMetadata
|
|
20276
|
+
}
|
|
20277
|
+
],
|
|
20278
|
+
hasMore: false,
|
|
20279
|
+
nextCursor: null,
|
|
20280
|
+
responseMode: "compact",
|
|
20281
|
+
requestId: "req_example"
|
|
20282
|
+
},
|
|
20283
|
+
FactorExtremePairList: {
|
|
20284
|
+
object: "list",
|
|
20285
|
+
data: [
|
|
20286
|
+
{
|
|
20287
|
+
object: "factor_extreme_pair",
|
|
20288
|
+
id: "factor_extreme_pair:MOMENTUM:VALUE:21d:2026-06-09",
|
|
20289
|
+
rank: 1,
|
|
20290
|
+
factor1: "MOMENTUM",
|
|
20291
|
+
factor2: "VALUE",
|
|
20292
|
+
factor1Name: "Momentum",
|
|
20293
|
+
factor2Name: "Value",
|
|
20294
|
+
category1: "style",
|
|
20295
|
+
category2: "style",
|
|
20296
|
+
window: "21d",
|
|
20297
|
+
lookback: "6m",
|
|
20298
|
+
direction: "factor1",
|
|
20299
|
+
sort: "abs_z_score",
|
|
20300
|
+
score: 2.18,
|
|
20301
|
+
absZScore: 2.18,
|
|
20302
|
+
absSpreadReturn: 0.043,
|
|
20303
|
+
minAbsZScore: 2,
|
|
20304
|
+
isExtreme: true,
|
|
20305
|
+
spreadReturn: 0.043,
|
|
20306
|
+
factor1Return: 0.064,
|
|
20307
|
+
factor2Return: 0.021,
|
|
20308
|
+
averageSpreadReturn: 0.006,
|
|
20309
|
+
spreadVolatility: 0.017,
|
|
20310
|
+
zScore: 2.18,
|
|
20311
|
+
spreadZScore: 2.18,
|
|
20312
|
+
meanReversionSignal: "factor1_overextended",
|
|
20313
|
+
meanReversionSummary: "Momentum has outperformed value unusually over the latest 21 trading days.",
|
|
20314
|
+
windowStartDate: "2026-05-11",
|
|
20315
|
+
windowEndDate: "2026-06-09",
|
|
20316
|
+
pairHistory: { endpoint: "/v1/factors/pair-history/MOMENTUM/VALUE?window=1m&lookback=6m" },
|
|
20317
|
+
observationCount: 126,
|
|
20318
|
+
rollingObservationCount: 106,
|
|
20319
|
+
asOf: exampleAsOf,
|
|
20320
|
+
responseMode: "compact",
|
|
20321
|
+
...exampleTrustMetadata
|
|
20322
|
+
}
|
|
20323
|
+
],
|
|
20324
|
+
hasMore: false,
|
|
20325
|
+
nextCursor: null,
|
|
20326
|
+
responseMode: "compact",
|
|
20327
|
+
requestId: "req_example"
|
|
20328
|
+
},
|
|
20329
|
+
FactorValuationList: {
|
|
20330
|
+
object: "list",
|
|
20331
|
+
data: [
|
|
20332
|
+
{
|
|
20333
|
+
object: "factor_valuation",
|
|
20334
|
+
id: "factor_valuation:VALUE:2026-06-09",
|
|
20335
|
+
rank: 1,
|
|
20336
|
+
factorKey: "VALUE",
|
|
20337
|
+
factorName: "Value",
|
|
20338
|
+
category: "style",
|
|
20339
|
+
valuationMetric: "earnings_yield",
|
|
20340
|
+
longLeg: "cheap",
|
|
20341
|
+
shortLeg: "expensive",
|
|
20342
|
+
window: "1m",
|
|
20343
|
+
lookback: "6m",
|
|
20344
|
+
signal: "tailwind",
|
|
20345
|
+
signalDirection: "tailwind",
|
|
20346
|
+
weightingMode: "long_short_equal",
|
|
20347
|
+
legWeights: { long: 1, short: -1 },
|
|
20348
|
+
rawFactorZScore: 1.42,
|
|
20349
|
+
weightedZScore: 1.42,
|
|
20350
|
+
sort: "opportunity_score",
|
|
20351
|
+
score: 0.71,
|
|
20352
|
+
opportunityScore: 0.71,
|
|
20353
|
+
zScore: 1.42,
|
|
20354
|
+
absZScore: 1.42,
|
|
20355
|
+
scaledReturn: 0.021,
|
|
20356
|
+
pureReturn: 0.014,
|
|
20357
|
+
rawReturn: 0.018,
|
|
20358
|
+
asOf: exampleAsOf,
|
|
20359
|
+
signalSource: "materialized_factor_return_z_score",
|
|
20360
|
+
stockDrilldown: { endpoint: "/v1/factors/valuations/stocks?factor=VALUE&signal=tailwind" },
|
|
20361
|
+
opportunitySummary: "Value is above trend and inexpensive names have a current factor tailwind.",
|
|
20362
|
+
responseMode: "compact",
|
|
20363
|
+
...exampleTrustMetadata
|
|
20364
|
+
}
|
|
20365
|
+
],
|
|
20366
|
+
hasMore: false,
|
|
20367
|
+
nextCursor: null,
|
|
20368
|
+
responseMode: "compact",
|
|
20369
|
+
requestId: "req_example"
|
|
20370
|
+
},
|
|
20371
|
+
FactorValuationStockList: {
|
|
20372
|
+
object: "list",
|
|
20373
|
+
data: [
|
|
20374
|
+
{
|
|
20375
|
+
object: "factor_valuation_stock",
|
|
20376
|
+
id: "factor_valuation_stock:VALUE:JPM:2026-06-09",
|
|
20377
|
+
rank: 1,
|
|
20378
|
+
symbol: "JPM",
|
|
20379
|
+
factorKey: "VALUE",
|
|
20380
|
+
factorName: "Value",
|
|
20381
|
+
category: "style",
|
|
20382
|
+
valuationMetric: "earnings_yield",
|
|
20383
|
+
valuationSignal: "tailwind",
|
|
20384
|
+
signalDirection: "tailwind",
|
|
20385
|
+
weightingMode: "long_short_equal",
|
|
20386
|
+
legWeights: { long: 1, short: -1 },
|
|
20387
|
+
stance: "beneficiaries",
|
|
20388
|
+
impact: "beneficiary",
|
|
20389
|
+
sort: "score",
|
|
20390
|
+
score: 0.84,
|
|
20391
|
+
expectedFactorImpactScore: 0.62,
|
|
20392
|
+
factorZScore: 1.42,
|
|
20393
|
+
rawFactorZScore: 1.42,
|
|
20394
|
+
weightedFactorZScore: 1.42,
|
|
20395
|
+
exposureAdjustedFactorZScore: 0.62,
|
|
20396
|
+
exposureBeta: 0.44,
|
|
20397
|
+
absExposureBeta: 0.44,
|
|
20398
|
+
exposurePercentile: 88.4,
|
|
20399
|
+
exposureConfidence: "high",
|
|
20400
|
+
nActiveFactors: 7,
|
|
20401
|
+
window: "1m",
|
|
20402
|
+
lookback: "6m",
|
|
20403
|
+
modelName: "secapi_stock_basket_factor_model_v1",
|
|
20404
|
+
asOf: exampleAsOf,
|
|
20405
|
+
factorAsOf: exampleAsOf,
|
|
20406
|
+
signalSource: "materialized_factor_return_z_score_plus_latest_factor_exposure",
|
|
20407
|
+
rankingRationale: "JPM has positive value beta while VALUE has a current tailwind.",
|
|
20408
|
+
opportunitySummary: "Potential beneficiary of a continuing value tailwind.",
|
|
20409
|
+
responseMode: "compact",
|
|
20410
|
+
...exampleTrustMetadata
|
|
20411
|
+
}
|
|
20412
|
+
],
|
|
20413
|
+
hasMore: false,
|
|
20414
|
+
nextCursor: null,
|
|
20415
|
+
responseMode: "compact",
|
|
20416
|
+
requestId: "req_example"
|
|
20417
|
+
},
|
|
20418
|
+
FactorSimilarityPack: {
|
|
20419
|
+
object: "factor_similarity_pack",
|
|
20420
|
+
id: "factor_similarity_pack:NVDA:2026-06-09",
|
|
20421
|
+
symbol: "NVDA",
|
|
20422
|
+
asOf: exampleAsOf,
|
|
20423
|
+
anchorTheme: "accelerated compute",
|
|
20424
|
+
themeLabels: ["AI infrastructure", "semiconductors"],
|
|
20425
|
+
factorKeySuggestion: "AI_INFRASTRUCTURE",
|
|
20426
|
+
discoveryMode: "factor_overlap_plus_filing_news_signature",
|
|
20427
|
+
semanticSignature: {
|
|
20428
|
+
algorithm: "secapi_filing_news_signature_v1",
|
|
20429
|
+
dimensions: 384,
|
|
20430
|
+
topTerms: ["accelerated computing", "data center", "gpu"],
|
|
20431
|
+
sourceKinds: ["filing_title", "news_headline"],
|
|
20432
|
+
sourceCount: 18
|
|
20433
|
+
},
|
|
20434
|
+
namingWorkflow: {
|
|
20435
|
+
workflowVersion: "2026-06-09",
|
|
20436
|
+
selectedLabel: "AI Infrastructure",
|
|
20437
|
+
factorKeySuggestion: "AI_INFRASTRUCTURE",
|
|
20438
|
+
confidence: "high",
|
|
20439
|
+
labelCandidates: [
|
|
20440
|
+
{ label: "AI Infrastructure", score: 0.91, kind: "phrase", evidenceTerms: ["data center", "gpu"], sourceCount: 18 }
|
|
20441
|
+
],
|
|
20442
|
+
rationale: "Peers cluster around data-center accelerator demand and AI infrastructure filings."
|
|
20443
|
+
},
|
|
20444
|
+
evidence: [],
|
|
20445
|
+
peers: [],
|
|
20446
|
+
summaryMd: "NVDA peers share semiconductor and AI infrastructure signatures plus similar factor exposure.",
|
|
20447
|
+
responseMode: "compact",
|
|
20448
|
+
...exampleTrustMetadata
|
|
20449
|
+
},
|
|
20450
|
+
FactorExposureList: {
|
|
20451
|
+
object: "list",
|
|
20452
|
+
data: [exampleExposure],
|
|
20453
|
+
hasMore: false,
|
|
20454
|
+
nextCursor: null,
|
|
20455
|
+
responseMode: "compact",
|
|
20456
|
+
requestId: "req_example"
|
|
20457
|
+
},
|
|
20458
|
+
FactorCorrelationList: {
|
|
20459
|
+
object: "list",
|
|
20460
|
+
data: [
|
|
20461
|
+
{
|
|
20462
|
+
object: "factor_correlation",
|
|
20463
|
+
id: "factor_correlation:VALUE:MOMENTUM:6m",
|
|
20464
|
+
leftFactorKey: "VALUE",
|
|
20465
|
+
rightFactorKey: "MOMENTUM",
|
|
20466
|
+
lookback: "6m",
|
|
20467
|
+
correlation: -0.34,
|
|
20468
|
+
observationCount: 126,
|
|
20469
|
+
responseMode: "compact",
|
|
20470
|
+
...exampleTrustMetadata
|
|
20471
|
+
}
|
|
20472
|
+
],
|
|
20473
|
+
hasMore: false,
|
|
20474
|
+
nextCursor: null,
|
|
20475
|
+
responseMode: "compact",
|
|
20476
|
+
requestId: "req_example"
|
|
20477
|
+
},
|
|
20478
|
+
FactorDecomposition: {
|
|
20479
|
+
object: "factor_decomposition",
|
|
20480
|
+
id: "factor_decomposition:AAPL:3m:2026-06-09",
|
|
20481
|
+
symbol: "AAPL",
|
|
20482
|
+
factorCategory: "style",
|
|
20483
|
+
window: "3m",
|
|
20484
|
+
asOf: exampleAsOf,
|
|
20485
|
+
exposures: [exampleExposure],
|
|
20486
|
+
contributions: [
|
|
20487
|
+
{
|
|
20488
|
+
factorKey: "MOMENTUM",
|
|
20489
|
+
contributionPercent: 1.8,
|
|
20490
|
+
explanation: "Momentum beta explained 180 bps of AAPL's selected-window return."
|
|
20491
|
+
}
|
|
20492
|
+
],
|
|
20493
|
+
summaryMd: "AAPL's selected-window return was mostly explained by momentum and quality exposure.",
|
|
20494
|
+
stockReturn: 0.072,
|
|
20495
|
+
totalExplained: 0.049,
|
|
20496
|
+
alpha: 0.023,
|
|
20497
|
+
rSquared: 0.68,
|
|
20498
|
+
modelName: "secapi_stock_basket_factor_model_v1",
|
|
20499
|
+
date: exampleDataDate,
|
|
20500
|
+
responseMode: "compact",
|
|
20501
|
+
...exampleTrustMetadata
|
|
20502
|
+
},
|
|
20503
|
+
RelatedSecurityList: {
|
|
20504
|
+
object: "list",
|
|
20505
|
+
data: [
|
|
20506
|
+
{
|
|
20507
|
+
object: "related_security",
|
|
20508
|
+
id: "related_security:NVDA:AMD",
|
|
20509
|
+
symbol: "AMD",
|
|
20510
|
+
similarity: 0.86,
|
|
20511
|
+
score: 0.84,
|
|
20512
|
+
factorSimilarity: 0.79,
|
|
20513
|
+
thematicSimilarity: 0.91,
|
|
20514
|
+
factorOverlap: ["MOMENTUM", "QUALITY", "AI_INFRASTRUCTURE"],
|
|
20515
|
+
explanation: "AMD shares semiconductor, AI infrastructure, and momentum exposure with NVDA.",
|
|
20516
|
+
themeLabels: ["AI infrastructure", "semiconductors"],
|
|
20517
|
+
evidence: [],
|
|
20518
|
+
responseMode: "compact",
|
|
20519
|
+
...exampleTrustMetadata
|
|
20520
|
+
}
|
|
20521
|
+
],
|
|
20522
|
+
hasMore: false,
|
|
20523
|
+
nextCursor: null,
|
|
20524
|
+
responseMode: "compact",
|
|
20525
|
+
requestId: "req_example"
|
|
20526
|
+
},
|
|
20527
|
+
FactorPairSpreadList: {
|
|
20528
|
+
object: "list",
|
|
20529
|
+
data: [
|
|
20530
|
+
{
|
|
20531
|
+
object: "factor_pair_spread",
|
|
20532
|
+
id: "factor_pair_spread:MOMENTUM:VALUE:21d:2026-06-09",
|
|
20533
|
+
factor1: "MOMENTUM",
|
|
20534
|
+
factor2: "VALUE",
|
|
20535
|
+
factor1Name: "Momentum",
|
|
20536
|
+
factor2Name: "Value",
|
|
20537
|
+
category1: "style",
|
|
20538
|
+
category2: "style",
|
|
20539
|
+
window: "21d",
|
|
20540
|
+
lookback: "6m",
|
|
20541
|
+
spreadReturn: 0.043,
|
|
20542
|
+
factor1Return: 0.064,
|
|
20543
|
+
factor2Return: 0.021,
|
|
20544
|
+
averageSpread: 0.006,
|
|
20545
|
+
averageSpreadReturn: 0.006,
|
|
20546
|
+
spreadVolatility: 0.017,
|
|
20547
|
+
rollingSpreadVolatility: 0.017,
|
|
20548
|
+
zScore: 2.18,
|
|
20549
|
+
spreadZScore: 2.18,
|
|
20550
|
+
absZScore: 2.18,
|
|
20551
|
+
direction: "factor1",
|
|
20552
|
+
meanReversionSignal: "factor1_overextended",
|
|
20553
|
+
meanReversionSummary: "Momentum has outperformed value unusually over the latest 21 trading days.",
|
|
20554
|
+
windowStartDate: "2026-05-11",
|
|
20555
|
+
windowEndDate: "2026-06-09",
|
|
20556
|
+
rollingObservationCount: 106,
|
|
20557
|
+
observationCount: 126,
|
|
20558
|
+
seriesCount: 106,
|
|
20559
|
+
seriesSample: [
|
|
20560
|
+
{ date: "2026-05-11", spread: 0.004, f1Return: 0.006, f2Return: 0.002 },
|
|
20561
|
+
{ date: "2026-06-09", spread: 0.043, f1Return: 0.064, f2Return: 0.021 }
|
|
20562
|
+
],
|
|
20563
|
+
expansionHints: ["Use response_mode=standard for full pair-history series."],
|
|
20564
|
+
asOf: exampleAsOf,
|
|
20565
|
+
responseMode: "compact",
|
|
20566
|
+
...exampleTrustMetadata
|
|
20567
|
+
}
|
|
20568
|
+
],
|
|
20569
|
+
hasMore: false,
|
|
20570
|
+
nextCursor: null,
|
|
20571
|
+
responseMode: "compact",
|
|
20572
|
+
requestId: "req_example"
|
|
20573
|
+
},
|
|
20574
|
+
FactorBulkReturnList: {
|
|
20575
|
+
object: "list",
|
|
20576
|
+
data: [
|
|
20577
|
+
{
|
|
20578
|
+
object: "factor_bulk_return",
|
|
20579
|
+
id: "factor_bulk_return:VALUE:12m:2026-06-09",
|
|
20580
|
+
factorKey: "VALUE",
|
|
20581
|
+
factorName: "Value",
|
|
20582
|
+
category: "style",
|
|
20583
|
+
asOf: exampleAsOf,
|
|
20584
|
+
window: "1m",
|
|
20585
|
+
lookback: "12m",
|
|
20586
|
+
rawReturn: 0.018,
|
|
20587
|
+
pureReturn: 0.014,
|
|
20588
|
+
scaledReturn: 0.021,
|
|
20589
|
+
zScore: 1.42,
|
|
20590
|
+
leverage: 1,
|
|
20591
|
+
seriesCount: 252,
|
|
20592
|
+
seriesSample: [
|
|
20593
|
+
{ date: "2025-06-10", rawReturn: 0.0012, pureReturn: 0.0009, scaledReturn: 0.0011, zScore: 0.18 },
|
|
20594
|
+
{ date: "2026-06-09", rawReturn: 0.0038, pureReturn: 0.0031, scaledReturn: 0.0042, zScore: 1.42 }
|
|
20595
|
+
],
|
|
20596
|
+
expansionHints: ["Use response_mode=standard for full daily series."],
|
|
20597
|
+
responseMode: "compact",
|
|
20598
|
+
...exampleTrustMetadata
|
|
20599
|
+
}
|
|
20600
|
+
],
|
|
20601
|
+
hasMore: false,
|
|
20602
|
+
nextCursor: null,
|
|
20603
|
+
responseMode: "compact",
|
|
20604
|
+
requestId: "req_example"
|
|
20605
|
+
},
|
|
20606
|
+
PortfolioAnalysis: examplePortfolioAnalysis,
|
|
20607
|
+
PortfolioAttribution: examplePortfolioAttribution,
|
|
20608
|
+
PortfolioHedge: examplePortfolioHedge,
|
|
20609
|
+
ModelFactorAnalysis: {
|
|
20610
|
+
object: "model_factor_analysis",
|
|
20611
|
+
id: "model_factor_analysis:example:2026-06-09",
|
|
20612
|
+
asOf: exampleAsOf,
|
|
20613
|
+
model: {
|
|
20614
|
+
id: "growth-quality-core",
|
|
20615
|
+
label: "Growth Quality Core",
|
|
20616
|
+
description: "Model Builder portfolio submitted for factor analysis.",
|
|
20617
|
+
tags: ["model-builder", "growth"],
|
|
20618
|
+
source: "model_builder"
|
|
20619
|
+
},
|
|
20620
|
+
country: "US",
|
|
20621
|
+
lookback: "12m",
|
|
20622
|
+
window: "3m",
|
|
20623
|
+
category: "style",
|
|
20624
|
+
holdings: exampleHoldings,
|
|
20625
|
+
include: { attribution: true, hedge: true, optimizer: true, positionViews: true },
|
|
20626
|
+
analysis: examplePortfolioAnalysis,
|
|
20627
|
+
attribution: examplePortfolioAttribution,
|
|
20628
|
+
hedge: examplePortfolioHedge,
|
|
20629
|
+
optimizerObjective: "factor_neutral",
|
|
20630
|
+
optimizerConstraints: exampleOptimizerConstraints,
|
|
20631
|
+
optimizerRuntime: examplePortfolioAnalysis.optimizerRuntime,
|
|
20632
|
+
optimizerCandidates: [],
|
|
20633
|
+
optimizerCandidateCount: 1,
|
|
20634
|
+
optimizerCandidateSample: examplePortfolioAnalysis.optimizerCandidateSample,
|
|
20635
|
+
selectedCandidate: null,
|
|
20636
|
+
optimizerDisclosures: examplePortfolioAnalysis.optimizerDisclosures,
|
|
20637
|
+
positionViews: [],
|
|
20638
|
+
positionExposures: [exampleExposure],
|
|
20639
|
+
summaryMd: "Model is growth-quality tilted; hedge and optimizer sections show bounded factor-neutral alternatives.",
|
|
20640
|
+
responseMode: "compact",
|
|
20641
|
+
...exampleTrustMetadata,
|
|
20642
|
+
methodologyVersion: "secapi_model_factor_analysis_v1"
|
|
20643
|
+
},
|
|
20644
|
+
ModelPortfolioFactorView: {
|
|
20645
|
+
object: "model_portfolio_factor_view",
|
|
20646
|
+
id: "model_portfolio_factor_view:growth-quality-core:2026-06-09",
|
|
20647
|
+
portfolioId: "growth-quality-core",
|
|
20648
|
+
label: "Growth Quality Core",
|
|
20649
|
+
description: "Saved Turos model portfolio factor view.",
|
|
20650
|
+
tags: ["model-builder", "growth"],
|
|
20651
|
+
holdings: exampleHoldings,
|
|
20652
|
+
analysis: examplePortfolioAnalysis,
|
|
20653
|
+
positionViews: [],
|
|
20654
|
+
positionExposures: [exampleExposure],
|
|
20655
|
+
responseMode: "compact",
|
|
20656
|
+
...exampleTrustMetadata
|
|
20657
|
+
},
|
|
20658
|
+
FactorRotationStrategy: {
|
|
20659
|
+
object: "factor_rotation_strategy",
|
|
20660
|
+
id: "factor_rotation_strategy:US:soft_landing:2026-06-09",
|
|
20661
|
+
asOf: exampleAsOf,
|
|
20662
|
+
country: "US",
|
|
20663
|
+
regime: exampleRegime,
|
|
20664
|
+
leaders: [exampleRegimePerformance],
|
|
20665
|
+
laggards: [
|
|
20666
|
+
{
|
|
20667
|
+
...exampleRegimePerformance,
|
|
20668
|
+
id: "factor_regime_performance:US:LOW_VOL:soft_landing:2026-06-09",
|
|
20669
|
+
factorKey: "LOW_VOL",
|
|
20670
|
+
factorName: "Low Volatility",
|
|
20671
|
+
rank: 2,
|
|
20672
|
+
direction: "headwind",
|
|
20673
|
+
combinedScore: -0.41,
|
|
20674
|
+
rationale: "Low volatility trails in the current risk-on regime."
|
|
20675
|
+
}
|
|
20676
|
+
],
|
|
20677
|
+
summaryMd: "Rotate toward value and momentum while low volatility trails in the current regime.",
|
|
20678
|
+
responseMode: "compact",
|
|
20679
|
+
...exampleTrustMetadata
|
|
20680
|
+
},
|
|
20681
|
+
FactorRegimeScreen: {
|
|
20682
|
+
object: "regime_screen",
|
|
20683
|
+
id: "regime_screen:US:soft_landing:2026-06-09",
|
|
20684
|
+
asOf: exampleAsOf,
|
|
20685
|
+
country: "US",
|
|
20686
|
+
regime: exampleRegime,
|
|
20687
|
+
matches: [exampleFactorReturn],
|
|
20688
|
+
summaryMd: "Value and momentum are the highest-ranked style factors for the current regime screen.",
|
|
20689
|
+
responseMode: "compact",
|
|
20690
|
+
...exampleTrustMetadata
|
|
20691
|
+
},
|
|
20692
|
+
PortfolioStressTest: {
|
|
20693
|
+
object: "portfolio_stress_test",
|
|
20694
|
+
id: "portfolio_stress_test:higher_for_longer:2026-06-09",
|
|
20695
|
+
asOf: exampleAsOf,
|
|
20696
|
+
scenarioKey: "higher_for_longer",
|
|
20697
|
+
scenarioLabel: "Higher for Longer",
|
|
20698
|
+
estimatedDrawdownPercent: -7.4,
|
|
20699
|
+
factorShocks: { VALUE: 0.02, MOMENTUM: -0.04, QUALITY: 0.01 },
|
|
20700
|
+
macroShocks: { rates: 0.75, credit_spreads: 0.35 },
|
|
20701
|
+
regime: null,
|
|
20702
|
+
conditioningNotes: ["Uses bounded factor shocks from historical higher-rate episodes."],
|
|
20703
|
+
summaryMd: "Portfolio drawdown proxy is driven mainly by momentum and duration-sensitive exposures.",
|
|
20704
|
+
responseMode: "compact",
|
|
20705
|
+
...exampleTrustMetadata
|
|
20706
|
+
}
|
|
20707
|
+
};
|
|
20708
|
+
var requestExampleBySchema = {
|
|
20709
|
+
FactorCustomDiscoveryRequest: {
|
|
20710
|
+
symbol: "NVDA",
|
|
20711
|
+
candidates: ["AMD", "AVGO", "TSM", "ASML"],
|
|
20712
|
+
lookback: "6m",
|
|
20713
|
+
limit: 5
|
|
20714
|
+
},
|
|
20715
|
+
PortfolioIntelligenceRequest: {
|
|
20716
|
+
country: "US",
|
|
20717
|
+
lookback: "12m",
|
|
20718
|
+
category: "style",
|
|
20719
|
+
keys: ["VALUE", "MOMENTUM", "QUALITY"],
|
|
20720
|
+
holdings: exampleHoldings,
|
|
20721
|
+
benchmarkLabel: "NASDAQ 100",
|
|
20722
|
+
benchmarkHoldings: [
|
|
20723
|
+
{ symbol: "QQQ", weight: 1 }
|
|
20724
|
+
]
|
|
20725
|
+
},
|
|
20726
|
+
PortfolioAttributionRequest: {
|
|
20727
|
+
country: "US",
|
|
20728
|
+
lookback: "12m",
|
|
20729
|
+
window: "3m",
|
|
20730
|
+
frequency: "weekly",
|
|
20731
|
+
exportFormat: "json",
|
|
20732
|
+
category: "style",
|
|
20733
|
+
keys: ["VALUE", "MOMENTUM", "QUALITY"],
|
|
20734
|
+
holdings: exampleHoldings
|
|
20735
|
+
},
|
|
20736
|
+
PortfolioHedgeRequest: {
|
|
20737
|
+
country: "US",
|
|
20738
|
+
lookback: "12m",
|
|
20739
|
+
category: "style",
|
|
20740
|
+
keys: ["VALUE", "MOMENTUM", "QUALITY"],
|
|
20741
|
+
objective: "factor_neutral",
|
|
20742
|
+
mode: "compact",
|
|
20743
|
+
constraints: exampleHedgeConstraints,
|
|
20744
|
+
holdings: exampleHoldings
|
|
20745
|
+
},
|
|
20746
|
+
PortfolioOptimizeRequest: {
|
|
20747
|
+
country: "US",
|
|
20748
|
+
lookback: "12m",
|
|
20749
|
+
category: "style",
|
|
20750
|
+
keys: ["VALUE", "MOMENTUM", "QUALITY"],
|
|
20751
|
+
objective: "factor_neutral",
|
|
20752
|
+
constraints: exampleOptimizerConstraints,
|
|
20753
|
+
holdings: exampleHoldings
|
|
20754
|
+
},
|
|
20755
|
+
PortfolioStressTestRequest: {
|
|
20756
|
+
country: "US",
|
|
20757
|
+
lookback: "12m",
|
|
20758
|
+
category: "style",
|
|
20759
|
+
keys: ["VALUE", "MOMENTUM", "QUALITY"],
|
|
20760
|
+
scenarioKey: "higher_for_longer",
|
|
20761
|
+
holdings: exampleHoldings
|
|
20762
|
+
},
|
|
20763
|
+
ModelFactorAnalysisRequest: {
|
|
20764
|
+
model: {
|
|
20765
|
+
id: "growth-quality-core",
|
|
20766
|
+
label: "Growth Quality Core",
|
|
20767
|
+
description: "Model Builder portfolio submitted for factor analysis.",
|
|
20768
|
+
tags: ["model-builder", "growth"],
|
|
20769
|
+
source: "model_builder"
|
|
20770
|
+
},
|
|
20771
|
+
country: "US",
|
|
20772
|
+
lookback: "12m",
|
|
20773
|
+
window: "3m",
|
|
20774
|
+
category: "style",
|
|
20775
|
+
keys: ["VALUE", "MOMENTUM", "QUALITY"],
|
|
20776
|
+
include: { attribution: true, hedge: true, optimizer: true, positionViews: true },
|
|
20777
|
+
hedge: {
|
|
20778
|
+
objective: "factor_neutral",
|
|
20779
|
+
mode: "compact",
|
|
20780
|
+
constraints: exampleHedgeConstraints
|
|
20781
|
+
},
|
|
20782
|
+
optimizer: {
|
|
20783
|
+
objective: "factor_neutral",
|
|
20784
|
+
constraints: exampleOptimizerConstraints
|
|
20785
|
+
},
|
|
20786
|
+
holdings: exampleHoldings
|
|
20787
|
+
},
|
|
20788
|
+
FactorStrategyRequest: {
|
|
20789
|
+
country: "US",
|
|
20790
|
+
category: "style",
|
|
20791
|
+
window: "1m",
|
|
20792
|
+
lookback: "6m",
|
|
20793
|
+
limit: 5
|
|
20794
|
+
}
|
|
20795
|
+
};
|
|
20796
|
+
var launchResponseSchemasRequiringExplicitExamples = new Set([
|
|
20797
|
+
"FactorCatalog",
|
|
20798
|
+
"FactorReturnList",
|
|
20799
|
+
"FactorHistory",
|
|
20800
|
+
"FactorSparklineList",
|
|
20801
|
+
"FactorIntradaySnapshotList",
|
|
20802
|
+
"FactorDashboard",
|
|
20803
|
+
"FactorRegimePerformanceList",
|
|
20804
|
+
"FactorExposureList",
|
|
20805
|
+
"FactorCorrelationList",
|
|
20806
|
+
"FactorDecomposition",
|
|
20807
|
+
"RelatedSecurityList",
|
|
20808
|
+
"FactorSimilarityPack",
|
|
20809
|
+
"FactorPairSpreadList",
|
|
20810
|
+
"FactorBulkReturnList",
|
|
20811
|
+
"FactorExtremeMoveList",
|
|
20812
|
+
"FactorExtremePairList",
|
|
20813
|
+
"FactorValuationList",
|
|
20814
|
+
"FactorValuationStockList",
|
|
20815
|
+
"PortfolioAnalysis",
|
|
20816
|
+
"PortfolioAttribution",
|
|
20817
|
+
"PortfolioHedge",
|
|
20818
|
+
"PortfolioStressTest",
|
|
20819
|
+
"ModelPortfolioFactorView",
|
|
20820
|
+
"ModelFactorAnalysis",
|
|
20821
|
+
"FactorRotationStrategy",
|
|
20822
|
+
"FactorRegimeScreen"
|
|
20823
|
+
]);
|
|
20824
|
+
var responseExampleForSchema = (name) => {
|
|
20825
|
+
const specificExample = responseExampleBySchema[name];
|
|
20826
|
+
if (specificExample)
|
|
20827
|
+
return specificExample;
|
|
20828
|
+
if (launchResponseSchemasRequiringExplicitExamples.has(name)) {
|
|
20829
|
+
throw new Error(`Launch OpenAPI schema ${name} requires a realistic explicit example`);
|
|
20830
|
+
}
|
|
20831
|
+
if (name === "FactorCatalog") {
|
|
20832
|
+
return {
|
|
20833
|
+
object: "list",
|
|
20834
|
+
data: [],
|
|
20835
|
+
hasMore: false,
|
|
20836
|
+
nextCursor: null,
|
|
20837
|
+
categories: ["market", "style", "sector", "industry"],
|
|
20838
|
+
requestId: "req_example"
|
|
20839
|
+
};
|
|
20840
|
+
}
|
|
20841
|
+
if (name.endsWith("List") || name === "FactorCatalog") {
|
|
20842
|
+
return {
|
|
20843
|
+
object: "list",
|
|
20844
|
+
data: [],
|
|
20845
|
+
hasMore: false,
|
|
20846
|
+
nextCursor: null,
|
|
20847
|
+
responseMode: "compact",
|
|
20848
|
+
requestId: "req_example"
|
|
20849
|
+
};
|
|
20850
|
+
}
|
|
20851
|
+
return {
|
|
20852
|
+
object: objectExampleBySchema[name] ?? name.replace(/([a-z])([A-Z])/g, "$1_$2").toLowerCase(),
|
|
20853
|
+
responseMode: "compact",
|
|
20854
|
+
requestId: "req_example"
|
|
20855
|
+
};
|
|
20856
|
+
};
|
|
20857
|
+
var requestExampleForSchema = (name) => requestExampleBySchema[name];
|
|
18759
20858
|
var jsonContent = (name) => ({
|
|
18760
20859
|
"application/json": {
|
|
18761
20860
|
schema: schemaRef(name)
|
|
18762
20861
|
}
|
|
18763
20862
|
});
|
|
20863
|
+
var jsonContentWithExample = (name, summary = "Compact response") => ({
|
|
20864
|
+
"application/json": {
|
|
20865
|
+
schema: schemaRef(name),
|
|
20866
|
+
examples: {
|
|
20867
|
+
compact: {
|
|
20868
|
+
summary,
|
|
20869
|
+
value: responseExampleForSchema(name)
|
|
20870
|
+
}
|
|
20871
|
+
}
|
|
20872
|
+
}
|
|
20873
|
+
});
|
|
18764
20874
|
var jsonResponse = (name, description = "Successful response") => ({
|
|
18765
20875
|
responses: {
|
|
18766
20876
|
"200": {
|
|
@@ -18769,13 +20879,105 @@ var jsonResponse = (name, description = "Successful response") => ({
|
|
|
18769
20879
|
}
|
|
18770
20880
|
}
|
|
18771
20881
|
});
|
|
20882
|
+
var jsonStatusResponse = (status, name, description = "Successful response") => ({
|
|
20883
|
+
responses: {
|
|
20884
|
+
[status]: {
|
|
20885
|
+
description,
|
|
20886
|
+
content: jsonContent(name)
|
|
20887
|
+
}
|
|
20888
|
+
}
|
|
20889
|
+
});
|
|
20890
|
+
var jsonResponseWithExample = (name, description = "Successful response") => ({
|
|
20891
|
+
responses: {
|
|
20892
|
+
"200": {
|
|
20893
|
+
description,
|
|
20894
|
+
content: jsonContentWithExample(name)
|
|
20895
|
+
}
|
|
20896
|
+
}
|
|
20897
|
+
});
|
|
20898
|
+
var jsonFactorResponse = (name, description = "Successful response") => ({
|
|
20899
|
+
responses: {
|
|
20900
|
+
"200": {
|
|
20901
|
+
description,
|
|
20902
|
+
content: {
|
|
20903
|
+
"application/json": {
|
|
20904
|
+
schema: schemaRef(name),
|
|
20905
|
+
examples: {
|
|
20906
|
+
compact: {
|
|
20907
|
+
summary: "Token-efficient compact response",
|
|
20908
|
+
value: responseExampleForSchema(name)
|
|
20909
|
+
}
|
|
20910
|
+
}
|
|
20911
|
+
}
|
|
20912
|
+
}
|
|
20913
|
+
}
|
|
20914
|
+
}
|
|
20915
|
+
});
|
|
20916
|
+
var jsonFactorResponseWithCsv = (name, description = "Successful response") => {
|
|
20917
|
+
const response = jsonFactorResponse(name, description);
|
|
20918
|
+
return {
|
|
20919
|
+
responses: {
|
|
20920
|
+
"200": {
|
|
20921
|
+
...response.responses["200"],
|
|
20922
|
+
content: {
|
|
20923
|
+
...response.responses["200"].content,
|
|
20924
|
+
"text/csv": {
|
|
20925
|
+
schema: { type: "string" }
|
|
20926
|
+
}
|
|
20927
|
+
}
|
|
20928
|
+
}
|
|
20929
|
+
}
|
|
20930
|
+
};
|
|
20931
|
+
};
|
|
18772
20932
|
var jsonRequestBody = (name, description) => ({
|
|
18773
20933
|
requestBody: {
|
|
18774
20934
|
required: true,
|
|
18775
20935
|
...description ? { description } : {},
|
|
18776
|
-
content:
|
|
20936
|
+
content: {
|
|
20937
|
+
"application/json": {
|
|
20938
|
+
schema: schemaRef(name),
|
|
20939
|
+
...requestExampleForSchema(name) ? {
|
|
20940
|
+
examples: {
|
|
20941
|
+
default: {
|
|
20942
|
+
summary: "Copy-pasteable request",
|
|
20943
|
+
value: requestExampleForSchema(name)
|
|
20944
|
+
}
|
|
20945
|
+
}
|
|
20946
|
+
} : {}
|
|
20947
|
+
}
|
|
20948
|
+
}
|
|
18777
20949
|
}
|
|
18778
20950
|
});
|
|
20951
|
+
var factorResponseParameters = [
|
|
20952
|
+
{
|
|
20953
|
+
name: "response_mode",
|
|
20954
|
+
in: "query",
|
|
20955
|
+
required: false,
|
|
20956
|
+
schema: { type: "string", enum: ["compact", "standard", "verbose"], default: "compact" },
|
|
20957
|
+
description: "Response projection. compact is token-efficient for agents; standard returns the full operational shape; verbose preserves full trust metadata and drill-down context."
|
|
20958
|
+
},
|
|
20959
|
+
{
|
|
20960
|
+
name: "include",
|
|
20961
|
+
in: "query",
|
|
20962
|
+
required: false,
|
|
20963
|
+
schema: { type: "string" },
|
|
20964
|
+
description: "Comma-separated compact-mode expansions such as trust, metadata, series, exposures, position_views, position_exposures, optimizer_candidates, or drilldown. Use trust when an agent or report needs provenance, freshness, source-rights, methodology, revision, and degraded-state metadata."
|
|
20965
|
+
}
|
|
20966
|
+
];
|
|
20967
|
+
var factorResponseParams = (parameters = [], options = {}) => [
|
|
20968
|
+
...parameters,
|
|
20969
|
+
...factorResponseParameters.map((parameter) => {
|
|
20970
|
+
if (parameter.name !== "response_mode" || !options.responseModeDefault)
|
|
20971
|
+
return parameter;
|
|
20972
|
+
return {
|
|
20973
|
+
...parameter,
|
|
20974
|
+
schema: {
|
|
20975
|
+
...parameter.schema,
|
|
20976
|
+
default: options.responseModeDefault
|
|
20977
|
+
}
|
|
20978
|
+
};
|
|
20979
|
+
})
|
|
20980
|
+
];
|
|
18779
20981
|
var openApiDocument = {
|
|
18780
20982
|
openapi: "3.1.0",
|
|
18781
20983
|
info: {
|
|
@@ -18876,7 +21078,84 @@ var openApiDocument = {
|
|
|
18876
21078
|
post: { summary: "Exchange a sponsor token for the first org-scoped API key, billing snapshot, limits, and MCP install metadata" }
|
|
18877
21079
|
},
|
|
18878
21080
|
"/v1/dashboard/overview": {
|
|
18879
|
-
get: {
|
|
21081
|
+
get: {
|
|
21082
|
+
summary: "Return the logged-in dashboard overview with principal, org, enriched billing, usage, and API key context",
|
|
21083
|
+
...jsonResponse("DashboardOverview")
|
|
21084
|
+
}
|
|
21085
|
+
},
|
|
21086
|
+
"/v1/dashboard/settings": {
|
|
21087
|
+
get: {
|
|
21088
|
+
summary: "Return profile, organization, appearance, security, and account-deletion settings for the dashboard",
|
|
21089
|
+
...jsonResponse("DashboardAccountSettings")
|
|
21090
|
+
}
|
|
21091
|
+
},
|
|
21092
|
+
"/v1/dashboard/settings/profile": {
|
|
21093
|
+
patch: {
|
|
21094
|
+
summary: "Update local dashboard profile preferences for the current WorkOS user",
|
|
21095
|
+
...jsonRequestBody("AccountUpdateDashboardProfileBody"),
|
|
21096
|
+
...jsonResponse("DashboardAccountSettings")
|
|
21097
|
+
}
|
|
21098
|
+
},
|
|
21099
|
+
"/v1/dashboard/settings/organization": {
|
|
21100
|
+
patch: {
|
|
21101
|
+
summary: "Update locally owned organization profile settings",
|
|
21102
|
+
...jsonRequestBody("AccountUpdateDashboardOrganizationBody"),
|
|
21103
|
+
...jsonResponse("DashboardAccountSettings")
|
|
21104
|
+
}
|
|
21105
|
+
},
|
|
21106
|
+
"/v1/dashboard/settings/appearance": {
|
|
21107
|
+
put: {
|
|
21108
|
+
summary: "Update dashboard appearance preferences for the current organization",
|
|
21109
|
+
...jsonRequestBody("AccountUpdateDashboardAppearanceBody"),
|
|
21110
|
+
...jsonResponse("DashboardAccountSettings")
|
|
21111
|
+
}
|
|
21112
|
+
},
|
|
21113
|
+
"/v1/dashboard/settings/account-deletion-request": {
|
|
21114
|
+
post: {
|
|
21115
|
+
summary: "Record an account-deletion request for the current organization without deleting data inline",
|
|
21116
|
+
...jsonRequestBody("AccountRequestDeletionBody"),
|
|
21117
|
+
...jsonStatusResponse("202", "DashboardAccountSettings", "Account-deletion request recorded")
|
|
21118
|
+
}
|
|
21119
|
+
},
|
|
21120
|
+
"/v1/dashboard/usage/series": {
|
|
21121
|
+
get: {
|
|
21122
|
+
summary: "Return dashboard usage counts over time for the current organization",
|
|
21123
|
+
...jsonResponse("DashboardUsageSeries")
|
|
21124
|
+
}
|
|
21125
|
+
},
|
|
21126
|
+
"/v1/dashboard/usage/endpoints": {
|
|
21127
|
+
get: {
|
|
21128
|
+
summary: "Return dashboard endpoint-level usage breakdown for the current organization",
|
|
21129
|
+
...jsonResponse("DashboardEndpointBreakdown")
|
|
21130
|
+
}
|
|
21131
|
+
},
|
|
21132
|
+
"/v1/dashboard/usage/requests": {
|
|
21133
|
+
get: {
|
|
21134
|
+
summary: "Return recent dashboard request log rows for the current organization",
|
|
21135
|
+
...jsonResponse("DashboardUsageRequestLog")
|
|
21136
|
+
}
|
|
21137
|
+
},
|
|
21138
|
+
"/v1/dashboard/usage/export": {
|
|
21139
|
+
get: {
|
|
21140
|
+
summary: "Export dashboard usage request log rows as JSON or CSV",
|
|
21141
|
+
responses: {
|
|
21142
|
+
"200": {
|
|
21143
|
+
description: "Dashboard usage export as JSON or CSV",
|
|
21144
|
+
content: {
|
|
21145
|
+
...jsonContent("DashboardUsageExport"),
|
|
21146
|
+
"text/csv": {
|
|
21147
|
+
schema: { type: "string" }
|
|
21148
|
+
}
|
|
21149
|
+
}
|
|
21150
|
+
}
|
|
21151
|
+
}
|
|
21152
|
+
}
|
|
21153
|
+
},
|
|
21154
|
+
"/v1/dashboard/activity": {
|
|
21155
|
+
get: {
|
|
21156
|
+
summary: "Return dashboard activity totals and recent request rows for the current organization",
|
|
21157
|
+
...jsonResponse("DashboardUsageActivity")
|
|
21158
|
+
}
|
|
18880
21159
|
},
|
|
18881
21160
|
"/v1/events": {
|
|
18882
21161
|
get: { summary: "List canonical event, webhook delivery, and stream records for the current organization" }
|
|
@@ -19171,104 +21450,422 @@ var openApiDocument = {
|
|
|
19171
21450
|
}
|
|
19172
21451
|
},
|
|
19173
21452
|
"/v1/factors/catalog": {
|
|
19174
|
-
get: {
|
|
21453
|
+
get: {
|
|
21454
|
+
summary: "Return the SEC API factor catalog with methodology, proxy, and orthogonalization metadata",
|
|
21455
|
+
parameters: factorResponseParams(),
|
|
21456
|
+
...jsonResponseWithExample("FactorCatalog")
|
|
21457
|
+
}
|
|
19175
21458
|
},
|
|
19176
21459
|
"/v1/factors/returns": {
|
|
19177
|
-
get: {
|
|
21460
|
+
get: {
|
|
21461
|
+
summary: "Return factor return history, z-scores, and volatility-scaled series for supported factor families",
|
|
21462
|
+
parameters: factorResponseParams(),
|
|
21463
|
+
...jsonFactorResponse("FactorReturnList")
|
|
21464
|
+
}
|
|
21465
|
+
},
|
|
21466
|
+
"/v1/factors/history/{factorKey}": {
|
|
21467
|
+
get: {
|
|
21468
|
+
summary: "Return a single factor's daily return history with 1D through MAX summary windows for chart and table workflows",
|
|
21469
|
+
parameters: factorResponseParams([
|
|
21470
|
+
{
|
|
21471
|
+
name: "factorKey",
|
|
21472
|
+
in: "path",
|
|
21473
|
+
required: true,
|
|
21474
|
+
schema: { type: "string" },
|
|
21475
|
+
description: "Canonical factor key or supported public alias such as VALUE_V2. Explicit keys do not broaden to other factors."
|
|
21476
|
+
},
|
|
21477
|
+
{
|
|
21478
|
+
name: "range",
|
|
21479
|
+
in: "query",
|
|
21480
|
+
required: false,
|
|
21481
|
+
schema: { type: "string", enum: ["1d", "5d", "10d", "1m", "3m", "6m", "1y", "max"], default: "1y" },
|
|
21482
|
+
description: "Trailing observation window for the returned chart series. Defaults to 1y for token-efficient agent and dashboard workflows. MAX requests the public launch-history floor, 2015-01-01, through the latest complete market date when row-level coverage exists for the factor."
|
|
21483
|
+
},
|
|
21484
|
+
{
|
|
21485
|
+
name: "date_from",
|
|
21486
|
+
in: "query",
|
|
21487
|
+
required: false,
|
|
21488
|
+
schema: { type: "string", format: "date", minimum: "2015-01-01" },
|
|
21489
|
+
description: "Optional inclusive ISO start date. Must be on or after 2015-01-01. When supplied, it overrides range for the returned series bounds."
|
|
21490
|
+
},
|
|
21491
|
+
{
|
|
21492
|
+
name: "date_to",
|
|
21493
|
+
in: "query",
|
|
21494
|
+
required: false,
|
|
21495
|
+
schema: { type: "string", format: "date", minimum: "2015-01-01" },
|
|
21496
|
+
description: "Optional inclusive ISO end date. Must be on or after 2015-01-01 and on or before the latest complete XNYS market date."
|
|
21497
|
+
},
|
|
21498
|
+
{ name: "format", in: "query", schema: { type: "string", enum: ["json", "csv"], default: "json" }, description: "Return JSON by default or a table-ready CSV export with one row per factor/date." }
|
|
21499
|
+
]),
|
|
21500
|
+
...jsonFactorResponseWithCsv("FactorHistory")
|
|
21501
|
+
}
|
|
21502
|
+
},
|
|
21503
|
+
"/v1/factors/sparklines": {
|
|
21504
|
+
get: {
|
|
21505
|
+
summary: "Return compact multi-factor sparkline series with 1D through MAX summary windows for dashboard, sector, index, and model UIs",
|
|
21506
|
+
parameters: factorResponseParams([
|
|
21507
|
+
{
|
|
21508
|
+
name: "factors",
|
|
21509
|
+
in: "query",
|
|
21510
|
+
required: false,
|
|
21511
|
+
schema: { type: "string" },
|
|
21512
|
+
description: "Comma-separated canonical factor keys or supported public aliases. Alias normalization is explicit and does not broaden the selection."
|
|
21513
|
+
},
|
|
21514
|
+
{
|
|
21515
|
+
name: "keys",
|
|
21516
|
+
in: "query",
|
|
21517
|
+
required: false,
|
|
21518
|
+
schema: { type: "string" },
|
|
21519
|
+
description: "Alias for factors."
|
|
21520
|
+
},
|
|
21521
|
+
{
|
|
21522
|
+
name: "category",
|
|
21523
|
+
in: "query",
|
|
21524
|
+
required: false,
|
|
21525
|
+
schema: { type: "string" },
|
|
21526
|
+
description: "Optional launch factor category filter such as style, sector, or industry."
|
|
21527
|
+
},
|
|
21528
|
+
{
|
|
21529
|
+
name: "range",
|
|
21530
|
+
in: "query",
|
|
21531
|
+
required: false,
|
|
21532
|
+
schema: { type: "string", enum: ["1d", "5d", "10d", "1m", "3m", "6m", "1y", "max"], default: "1y" },
|
|
21533
|
+
description: "Trailing observation window for the returned sparkline points. Defaults to 1y for token-efficient dashboard and agent workflows. MAX requests the public launch-history floor, 2015-01-01, through the latest complete market date when row-level coverage exists for each factor."
|
|
21534
|
+
},
|
|
21535
|
+
{
|
|
21536
|
+
name: "metric",
|
|
21537
|
+
in: "query",
|
|
21538
|
+
required: false,
|
|
21539
|
+
schema: { type: "string", enum: ["scaled_return", "pure_return", "raw_return", "z_score"], default: "scaled_return" },
|
|
21540
|
+
description: "Metric used for sparkline point values. Return metrics are cumulative over the selected range; z_score returns point-in-time z-scores."
|
|
21541
|
+
},
|
|
21542
|
+
{
|
|
21543
|
+
name: "points",
|
|
21544
|
+
in: "query",
|
|
21545
|
+
required: false,
|
|
21546
|
+
schema: { type: "integer", minimum: 2, maximum: 500, default: 120 },
|
|
21547
|
+
description: "Maximum chart points per factor. The first and last observations are preserved when downsampling."
|
|
21548
|
+
},
|
|
21549
|
+
{
|
|
21550
|
+
name: "date_from",
|
|
21551
|
+
in: "query",
|
|
21552
|
+
required: false,
|
|
21553
|
+
schema: { type: "string", format: "date", minimum: "2015-01-01" },
|
|
21554
|
+
description: "Optional inclusive ISO start date. Must be on or after 2015-01-01 and overrides range for returned sparkline bounds."
|
|
21555
|
+
},
|
|
21556
|
+
{
|
|
21557
|
+
name: "date_to",
|
|
21558
|
+
in: "query",
|
|
21559
|
+
required: false,
|
|
21560
|
+
schema: { type: "string", format: "date", minimum: "2015-01-01" },
|
|
21561
|
+
description: "Optional inclusive ISO end date. Must be on or after 2015-01-01 and on or before the latest complete XNYS market date."
|
|
21562
|
+
},
|
|
21563
|
+
{ name: "format", in: "query", schema: { type: "string", enum: ["json", "csv"], default: "json" }, description: "Return JSON by default or a table-ready CSV export with one row per factor/date sparkline point." }
|
|
21564
|
+
]),
|
|
21565
|
+
...jsonFactorResponseWithCsv("FactorSparklineList")
|
|
21566
|
+
}
|
|
19178
21567
|
},
|
|
19179
21568
|
"/v1/factors/returns/intraday": {
|
|
19180
21569
|
get: {
|
|
19181
|
-
summary: "Return intraday factor snapshots for
|
|
19182
|
-
|
|
21570
|
+
summary: "Return intraday factor snapshots for dashboards using the current benchmark proxy surface and freshness metadata",
|
|
21571
|
+
parameters: factorResponseParams(),
|
|
21572
|
+
...jsonFactorResponse("FactorIntradaySnapshotList")
|
|
19183
21573
|
}
|
|
19184
21574
|
},
|
|
19185
21575
|
"/v1/factors/dashboard": {
|
|
19186
21576
|
get: {
|
|
19187
|
-
summary: "Return a one-call
|
|
19188
|
-
|
|
21577
|
+
summary: "Return a one-call factor dashboard with intraday, regime, rotation, spotlight-security, and optional model-portfolio drill-down sections",
|
|
21578
|
+
parameters: factorResponseParams(),
|
|
21579
|
+
...jsonFactorResponse("FactorDashboard")
|
|
19189
21580
|
}
|
|
19190
21581
|
},
|
|
19191
21582
|
"/v1/factors/regime-performance": {
|
|
19192
21583
|
get: {
|
|
19193
21584
|
summary: "Return regime-conditioned factor rankings that blend the active macro backdrop with current factor state",
|
|
19194
|
-
|
|
21585
|
+
parameters: factorResponseParams(),
|
|
21586
|
+
...jsonFactorResponse("FactorRegimePerformanceList")
|
|
19195
21587
|
}
|
|
19196
21588
|
},
|
|
19197
21589
|
"/v1/factors/exposures": {
|
|
19198
|
-
get: {
|
|
21590
|
+
get: {
|
|
21591
|
+
summary: "Return security, portfolio, or watchlist factor exposures with model metadata and provenance",
|
|
21592
|
+
parameters: factorResponseParams([
|
|
21593
|
+
{ name: "symbols", in: "query", required: true, schema: { type: "string" }, description: "Comma-separated symbols to load exposures for. `tickers` is accepted as an alias." },
|
|
21594
|
+
{ name: "factors", in: "query", schema: { type: "string" }, description: "Comma-separated factor keys or aliases." },
|
|
21595
|
+
{ name: "keys", in: "query", schema: { type: "string" }, description: "Alias for factors." },
|
|
21596
|
+
{ name: "category", in: "query", schema: { type: "string" }, description: "Optional launch factor category filter." },
|
|
21597
|
+
{ name: "lookback", in: "query", schema: { type: "string", default: "6m" }, description: "Exposure lookback window." },
|
|
21598
|
+
{ name: "model", in: "query", schema: { type: "string" }, description: "Optional factor exposure model selector." }
|
|
21599
|
+
]),
|
|
21600
|
+
...jsonFactorResponse("FactorExposureList")
|
|
21601
|
+
}
|
|
19199
21602
|
},
|
|
19200
21603
|
"/v1/stocks/{ticker}/loadings": {
|
|
19201
21604
|
get: {
|
|
19202
21605
|
summary: "Return stock-level factor loadings for a single ticker using the latest stored exposure model",
|
|
19203
|
-
|
|
21606
|
+
parameters: factorResponseParams([
|
|
21607
|
+
{ name: "ticker", in: "path", required: true, schema: { type: "string" }, description: "Ticker symbol." }
|
|
21608
|
+
]),
|
|
21609
|
+
...jsonFactorResponse("FactorExposureList")
|
|
19204
21610
|
}
|
|
19205
21611
|
},
|
|
19206
21612
|
"/v1/factors/correlations": {
|
|
19207
|
-
get: {
|
|
21613
|
+
get: {
|
|
21614
|
+
summary: "Return factor-to-factor and factor-to-security correlation surfaces for strategy and risk workflows",
|
|
21615
|
+
parameters: factorResponseParams(),
|
|
21616
|
+
...jsonFactorResponse("FactorCorrelationList")
|
|
21617
|
+
}
|
|
19208
21618
|
},
|
|
19209
21619
|
"/v1/factors/screen": {
|
|
19210
|
-
get: {
|
|
21620
|
+
get: {
|
|
21621
|
+
summary: "Return factor screens ranked by recent strength so agents can run factor-rotation and cross-factor ranking workflows",
|
|
21622
|
+
parameters: factorResponseParams(),
|
|
21623
|
+
...jsonFactorResponse("FactorReturnList")
|
|
21624
|
+
}
|
|
21625
|
+
},
|
|
21626
|
+
"/v1/factors/extreme-moves": {
|
|
21627
|
+
get: {
|
|
21628
|
+
summary: "Return factor moves ranked by unusual z-score or absolute return with direction, threshold, and trust metadata",
|
|
21629
|
+
parameters: factorResponseParams([
|
|
21630
|
+
{ name: "factors", in: "query", schema: { type: "string" }, description: "Comma-separated canonical factor keys or supported public aliases." },
|
|
21631
|
+
{ name: "keys", in: "query", schema: { type: "string" }, description: "Alias for factors." },
|
|
21632
|
+
{ name: "category", in: "query", schema: { type: "string" }, description: "Optional launch factor category filter such as style, sector, or industry." },
|
|
21633
|
+
{ name: "window", in: "query", schema: { type: "string", enum: ["1d", "5d", "10d", "1m", "3m", "6m", "1y"], default: "1m" }, description: "Return window used to score the move." },
|
|
21634
|
+
{ name: "lookback", in: "query", schema: { type: "string", default: "6m" }, description: "History lookback used to compute z-scores. Automatically widens when shorter than window." },
|
|
21635
|
+
{ name: "side", in: "query", schema: { type: "string", enum: ["both", "up", "down", "flat"], default: "both" }, description: "Filter by move direction." },
|
|
21636
|
+
{ name: "direction", in: "query", schema: { type: "string", enum: ["both", "up", "down", "flat"] }, description: "Alias for side, useful for dashboard filters that label move direction directly." },
|
|
21637
|
+
{ name: "sort", in: "query", schema: { type: "string", enum: ["abs_z_score", "abs_scaled_return"], default: "abs_z_score" }, description: "Ranking metric for unusual moves." },
|
|
21638
|
+
{ name: "min_z_score", in: "query", schema: { type: "number", minimum: 0, default: 0 }, description: "Optional absolute z-score floor. Defaults to 0 so the endpoint always returns the top ranked moves." },
|
|
21639
|
+
{ name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 100, default: 25 }, description: "Maximum number of ranked factor moves." }
|
|
21640
|
+
]),
|
|
21641
|
+
...jsonFactorResponse("FactorExtremeMoveList")
|
|
21642
|
+
}
|
|
21643
|
+
},
|
|
21644
|
+
"/v1/factors/extreme-pairs": {
|
|
21645
|
+
get: {
|
|
21646
|
+
summary: "Return factor pairs ranked by unusual rolling spread divergence with direction, threshold, and trust metadata",
|
|
21647
|
+
parameters: factorResponseParams([
|
|
21648
|
+
{ name: "factors", in: "query", schema: { type: "string" }, description: "Comma-separated canonical factor keys or supported public aliases used to generate pair combinations." },
|
|
21649
|
+
{ name: "keys", in: "query", schema: { type: "string" }, description: "Alias for factors." },
|
|
21650
|
+
{ name: "category", in: "query", schema: { type: "string" }, description: "Optional launch factor category filter such as style, sector, or industry." },
|
|
21651
|
+
{ name: "window", in: "query", schema: { type: "string", enum: ["1d", "5d", "10d", "21d", "63d", "126d", "252d", "1m", "3m", "6m", "1y"], default: "21d" }, description: "Rolling spread window. Calendar aliases map to trading-day pair windows." },
|
|
21652
|
+
{ name: "lookback", in: "query", schema: { type: "string", default: "6m" }, description: "History lookback used to score rolling spread z-scores. Automatically widens when shorter than window." },
|
|
21653
|
+
{ name: "side", in: "query", schema: { type: "string", enum: ["both", "factor1", "factor2", "flat"], default: "both" }, description: "Filter by which side of the pair outperformed over the latest window." },
|
|
21654
|
+
{ name: "direction", in: "query", schema: { type: "string", enum: ["both", "factor1", "factor2", "flat"] }, description: "Alias for side." },
|
|
21655
|
+
{ name: "sort", in: "query", schema: { type: "string", enum: ["abs_z_score", "abs_spread_return"], default: "abs_z_score" }, description: "Ranking metric for pair divergence." },
|
|
21656
|
+
{ name: "min_z_score", in: "query", schema: { type: "number", minimum: 0, default: 0 }, description: "Optional absolute z-score floor. Defaults to 0 so the endpoint always returns the top ranked pairs." },
|
|
21657
|
+
{ name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 100, default: 25 }, description: "Maximum number of ranked factor pairs." }
|
|
21658
|
+
]),
|
|
21659
|
+
...jsonFactorResponse("FactorExtremePairList")
|
|
21660
|
+
}
|
|
21661
|
+
},
|
|
21662
|
+
"/v1/factors/valuations": {
|
|
21663
|
+
get: {
|
|
21664
|
+
summary: "Return valuation-factor opportunity signals ranked from SecAPI-owned factor return state with trust metadata",
|
|
21665
|
+
parameters: factorResponseParams([
|
|
21666
|
+
{ name: "factors", in: "query", schema: { type: "string" }, description: "Comma-separated valuation factor keys or supported public aliases. Defaults to launch valuation factors." },
|
|
21667
|
+
{ name: "keys", in: "query", schema: { type: "string" }, description: "Alias for factors." },
|
|
21668
|
+
{ name: "category", in: "query", schema: { type: "string" }, description: "Optional category filter. Valuation defaults are style factors." },
|
|
21669
|
+
{ name: "window", in: "query", schema: { type: "string", enum: ["1d", "5d", "10d", "1m", "3m", "6m", "1y"], default: "1m" }, description: "Return window used to score the valuation-factor signal." },
|
|
21670
|
+
{ name: "lookback", in: "query", schema: { type: "string", default: "6m" }, description: "History lookback used to compute factor z-scores. Automatically widens when shorter than window." },
|
|
21671
|
+
{ name: "side", in: "query", schema: { type: "string", enum: ["all", "tailwind", "headwind", "neutral"], default: "all" }, description: "Filter by valuation-factor signal direction." },
|
|
21672
|
+
{ name: "signal", in: "query", schema: { type: "string", enum: ["all", "tailwind", "headwind", "neutral"] }, description: "Alias for side." },
|
|
21673
|
+
{ name: "weighting_mode", in: "query", schema: { type: "string", enum: ["long_short_equal", "long_leg_focus", "short_leg_focus"], default: "long_short_equal" }, description: "Valuation lens used to transform the factor z-score. The default uses the native long-high-metric / short-low-metric factor; short_leg_focus flips the signal lens for the short leg." },
|
|
21674
|
+
{ name: "weighting", in: "query", schema: { type: "string", enum: ["long_short_equal", "long_leg_focus", "short_leg_focus"] }, description: "Alias for weighting_mode." },
|
|
21675
|
+
{ name: "sort", in: "query", schema: { type: "string", enum: ["opportunity_score", "abs_z_score", "factor_key"], default: "opportunity_score" }, description: "Ranking metric for valuation-factor opportunities. With side=headwind, opportunity_score ranks the strongest headwinds first while opportunityScore remains signed." },
|
|
21676
|
+
{ name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 100, default: 25 }, description: "Maximum number of valuation factor rows." },
|
|
21677
|
+
{ name: "format", in: "query", schema: { type: "string", enum: ["json", "csv"], default: "json" }, description: "Return JSON by default or a CSV export for spreadsheet workflows." }
|
|
21678
|
+
]),
|
|
21679
|
+
...jsonFactorResponseWithCsv("FactorValuationList")
|
|
21680
|
+
}
|
|
21681
|
+
},
|
|
21682
|
+
"/v1/factors/valuations/stocks": {
|
|
21683
|
+
get: {
|
|
21684
|
+
summary: "Return stock candidates exposed to a valuation-factor signal using latest materialized factor exposures",
|
|
21685
|
+
parameters: factorResponseParams([
|
|
21686
|
+
{ name: "factor", in: "query", schema: { type: "string" }, description: "Valuation factor key or alias to drill into. If omitted, the top valuation factor is selected." },
|
|
21687
|
+
{ name: "factorKey", in: "query", schema: { type: "string" }, description: "Alias for factor." },
|
|
21688
|
+
{ name: "key", in: "query", schema: { type: "string" }, description: "Alias for factor." },
|
|
21689
|
+
{ name: "factors", in: "query", schema: { type: "string" }, description: "Comma-separated valuation factor keys used when factor is omitted; the top valuation row is selected." },
|
|
21690
|
+
{ name: "keys", in: "query", schema: { type: "string" }, description: "Alias for factors." },
|
|
21691
|
+
{ name: "category", in: "query", schema: { type: "string" }, description: "Optional valuation factor category filter." },
|
|
21692
|
+
{ name: "window", in: "query", schema: { type: "string", enum: ["1d", "5d", "10d", "1m", "3m", "6m", "1y"], default: "1m" }, description: "Return window used for the factor valuation signal." },
|
|
21693
|
+
{ name: "lookback", in: "query", schema: { type: "string", default: "6m" }, description: "Exposure lookback and valuation z-score lookback." },
|
|
21694
|
+
{ name: "signal", in: "query", schema: { type: "string", enum: ["all", "tailwind", "headwind", "neutral"] }, description: "Optional factor-level valuation signal filter when selecting the top factor." },
|
|
21695
|
+
{ name: "stance", in: "query", schema: { type: "string", enum: ["beneficiaries", "at_risk", "both"] }, description: "Stock view: beneficiaries of the factor signal, stocks at risk from it, or both. When omitted, SEC API chooses beneficiaries for tailwind/neutral factors and at_risk for headwind factors." },
|
|
21696
|
+
{ name: "side", in: "query", schema: { type: "string" }, description: "Alias for stance; also accepts long, short, all." },
|
|
21697
|
+
{ name: "direction", in: "query", schema: { type: "string" }, description: "Alias for stance." },
|
|
21698
|
+
{ name: "weighting_mode", in: "query", schema: { type: "string", enum: ["long_short_equal", "long_leg_focus", "short_leg_focus"], default: "long_short_equal" }, description: "Valuation lens used before ranking exposed stocks. Must match the factor-valuation workflow for consistent drilldowns." },
|
|
21699
|
+
{ name: "weighting", in: "query", schema: { type: "string", enum: ["long_short_equal", "long_leg_focus", "short_leg_focus"] }, description: "Alias for weighting_mode." },
|
|
21700
|
+
{ name: "sort", in: "query", schema: { type: "string", enum: ["score", "abs_beta", "symbol"], default: "score" }, description: "Ranking metric for stock candidates." },
|
|
21701
|
+
{ name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 100, default: 25 }, description: "Maximum number of stock candidates." },
|
|
21702
|
+
{ name: "format", in: "query", schema: { type: "string", enum: ["json", "csv"], default: "json" }, description: "Return JSON by default or a CSV export for spreadsheet workflows." }
|
|
21703
|
+
]),
|
|
21704
|
+
...jsonFactorResponseWithCsv("FactorValuationStockList")
|
|
21705
|
+
}
|
|
19211
21706
|
},
|
|
19212
21707
|
"/v1/factors/decomposition": {
|
|
19213
|
-
get: {
|
|
21708
|
+
get: {
|
|
21709
|
+
summary: "Return factor-attribution decomposition for a security over a bounded lookback window with explained return, alpha, and methodology metadata",
|
|
21710
|
+
parameters: factorResponseParams([
|
|
21711
|
+
{ name: "symbol", in: "query", required: true, schema: { type: "string" }, description: "Ticker symbol to decompose. `ticker` is accepted as an alias." },
|
|
21712
|
+
{ name: "factors", in: "query", schema: { type: "string" }, description: "Comma-separated factor keys or aliases." },
|
|
21713
|
+
{ name: "keys", in: "query", schema: { type: "string" }, description: "Alias for factors." },
|
|
21714
|
+
{ name: "category", in: "query", schema: { type: "string" }, description: "Optional launch factor category filter." },
|
|
21715
|
+
{ name: "window", in: "query", schema: { type: "string", default: "1m" }, description: "Return window used for decomposition." },
|
|
21716
|
+
{ name: "lookback", in: "query", schema: { type: "string", default: "6m" }, description: "History lookback used for exposures and factor returns." }
|
|
21717
|
+
]),
|
|
21718
|
+
...jsonFactorResponse("FactorDecomposition")
|
|
21719
|
+
}
|
|
19214
21720
|
},
|
|
19215
21721
|
"/v1/factors/related-stocks": {
|
|
19216
|
-
get: {
|
|
21722
|
+
get: {
|
|
21723
|
+
summary: "Return related stocks ranked by factor-overlap similarity for peer discovery and hedge ideation",
|
|
21724
|
+
parameters: factorResponseParams([
|
|
21725
|
+
{ name: "symbol", in: "query", required: true, schema: { type: "string" }, description: "Ticker symbol to find related stocks for. `ticker` is accepted as an alias." },
|
|
21726
|
+
{ name: "candidates", in: "query", schema: { type: "string" }, description: "Optional comma-separated candidate universe." },
|
|
21727
|
+
{ name: "factors", in: "query", schema: { type: "string" }, description: "Comma-separated factor keys or aliases." },
|
|
21728
|
+
{ name: "keys", in: "query", schema: { type: "string" }, description: "Alias for factors." },
|
|
21729
|
+
{ name: "category", in: "query", schema: { type: "string" }, description: "Optional launch factor category filter." },
|
|
21730
|
+
{ name: "lookback", in: "query", schema: { type: "string", default: "6m" }, description: "Exposure lookback window." },
|
|
21731
|
+
{ name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 25, default: 5 }, description: "Maximum related securities to return." }
|
|
21732
|
+
]),
|
|
21733
|
+
...jsonFactorResponse("RelatedSecurityList")
|
|
21734
|
+
}
|
|
19217
21735
|
},
|
|
19218
21736
|
"/v1/factors/similarity-pack": {
|
|
19219
21737
|
get: {
|
|
19220
21738
|
summary: "Return a custom thematic similarity pack that combines factor-overlap peers with deterministic filing/news signatures and naming workflow metadata",
|
|
19221
|
-
|
|
21739
|
+
parameters: factorResponseParams([
|
|
21740
|
+
{ name: "symbol", in: "query", required: true, schema: { type: "string" }, description: "Anchor ticker symbol. `ticker` is accepted as an alias; `symbols` can also provide the anchor as its first item." },
|
|
21741
|
+
{ name: "symbols", in: "query", schema: { type: "string" }, description: "Comma-separated anchor and optional candidate symbols. The first symbol is used as the anchor when symbol is omitted." },
|
|
21742
|
+
{ name: "candidates", in: "query", schema: { type: "string" }, description: "Optional comma-separated candidate universe." },
|
|
21743
|
+
{ name: "lookback", in: "query", schema: { type: "string", default: "6m" }, description: "Exposure and context lookback window." },
|
|
21744
|
+
{ name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 25, default: 5 }, description: "Maximum peers to return." }
|
|
21745
|
+
]),
|
|
21746
|
+
...jsonFactorResponse("FactorSimilarityPack")
|
|
19222
21747
|
}
|
|
19223
21748
|
},
|
|
19224
21749
|
"/v1/factors/pairs": {
|
|
19225
|
-
get: {
|
|
21750
|
+
get: {
|
|
21751
|
+
summary: "Return pairwise factor spread data including cumulative spread, average, volatility, and daily series for two specified factors",
|
|
21752
|
+
parameters: factorResponseParams([
|
|
21753
|
+
{ name: "factor1", in: "query", required: true, schema: { type: "string" }, description: "First factor key. The shorter f1 alias is also accepted at runtime." },
|
|
21754
|
+
{ name: "factor2", in: "query", required: true, schema: { type: "string" }, description: "Second factor key. The shorter f2 alias is also accepted at runtime." },
|
|
21755
|
+
{ name: "f1", in: "query", schema: { type: "string" }, description: "Runtime alias for factor1." },
|
|
21756
|
+
{ name: "f2", in: "query", schema: { type: "string" }, description: "Runtime alias for factor2." },
|
|
21757
|
+
{ name: "window", in: "query", schema: { type: "string", default: "1m" }, description: "Rolling spread window." },
|
|
21758
|
+
{ name: "lookback", in: "query", schema: { type: "string", default: "6m" }, description: "History lookback used to compute the spread." }
|
|
21759
|
+
]),
|
|
21760
|
+
...jsonFactorResponse("FactorPairSpreadList")
|
|
21761
|
+
}
|
|
19226
21762
|
},
|
|
19227
21763
|
"/v1/factors/pair-history/{f1}/{f2}": {
|
|
19228
|
-
get: {
|
|
21764
|
+
get: {
|
|
21765
|
+
summary: "Return historical spread between two specific factors identified by path parameters with windowed series data",
|
|
21766
|
+
parameters: factorResponseParams([
|
|
21767
|
+
{ name: "f1", in: "path", required: true, schema: { type: "string" }, description: "First factor key." },
|
|
21768
|
+
{ name: "f2", in: "path", required: true, schema: { type: "string" }, description: "Second factor key." },
|
|
21769
|
+
{ name: "window", in: "query", schema: { type: "string", default: "1m" }, description: "Rolling spread window." },
|
|
21770
|
+
{ name: "lookback", in: "query", schema: { type: "string", default: "6m" }, description: "History lookback used to compute the spread." }
|
|
21771
|
+
]),
|
|
21772
|
+
...jsonFactorResponse("FactorPairSpreadList")
|
|
21773
|
+
}
|
|
19229
21774
|
},
|
|
19230
21775
|
"/v1/factors/bulk-download": {
|
|
19231
|
-
get: {
|
|
21776
|
+
get: {
|
|
21777
|
+
summary: "Return available factor returns data in bulk with daily series for commercial plan bulk-download workflows",
|
|
21778
|
+
parameters: factorResponseParams([
|
|
21779
|
+
{ name: "factors", in: "query", schema: { type: "string" }, description: "Required unless category is provided. Comma-separated factor keys or aliases." },
|
|
21780
|
+
{ name: "keys", in: "query", schema: { type: "string" }, description: "Alias for factors. Required unless category is provided." },
|
|
21781
|
+
{ name: "category", in: "query", schema: { type: "string" }, description: "Required unless factors or keys is provided. Optional launch factor category filter." },
|
|
21782
|
+
{ name: "window", in: "query", schema: { type: "string", default: "1m" }, description: "Return window for summary fields." },
|
|
21783
|
+
{ name: "lookback", in: "query", schema: { type: "string", default: "12m" }, description: "History lookback for returned series." },
|
|
21784
|
+
{ name: "format", in: "query", schema: { type: "string", enum: ["json", "csv"], default: "json" }, description: "Return JSON by default or a long-table CSV export with one row per factor/date." }
|
|
21785
|
+
], { responseModeDefault: "standard" }),
|
|
21786
|
+
...jsonFactorResponseWithCsv("FactorBulkReturnList")
|
|
21787
|
+
}
|
|
19232
21788
|
},
|
|
19233
21789
|
"/v1/factors/custom": {
|
|
19234
21790
|
post: {
|
|
19235
21791
|
summary: "Discover a custom thematic factor pack from factor-overlap peers plus deterministic filing/news signatures",
|
|
21792
|
+
parameters: factorResponseParams(),
|
|
19236
21793
|
...jsonRequestBody("FactorCustomDiscoveryRequest"),
|
|
19237
|
-
...
|
|
21794
|
+
...jsonFactorResponse("FactorSimilarityPack")
|
|
19238
21795
|
}
|
|
19239
21796
|
},
|
|
19240
21797
|
"/v1/portfolio/analyze": {
|
|
19241
21798
|
post: {
|
|
19242
21799
|
summary: "Return factor exposures, attribution, and hedge suggestions for a portfolio in one deterministic response",
|
|
21800
|
+
parameters: factorResponseParams(),
|
|
19243
21801
|
...jsonRequestBody("PortfolioIntelligenceRequest"),
|
|
19244
|
-
...
|
|
21802
|
+
...jsonFactorResponse("PortfolioAnalysis")
|
|
21803
|
+
}
|
|
21804
|
+
},
|
|
21805
|
+
"/v1/portfolio/attribution": {
|
|
21806
|
+
post: {
|
|
21807
|
+
summary: "Return factor return attribution for a portfolio with explained return, alpha, and compact contribution rows",
|
|
21808
|
+
parameters: factorResponseParams(),
|
|
21809
|
+
...jsonRequestBody("PortfolioAttributionRequest"),
|
|
21810
|
+
...jsonFactorResponse("PortfolioAttribution")
|
|
19245
21811
|
}
|
|
19246
21812
|
},
|
|
19247
21813
|
"/v1/model-portfolios/{portfolioId}/factor-view": {
|
|
19248
21814
|
get: {
|
|
19249
21815
|
summary: "Return a model-portfolio factor view with aggregate analysis and per-position exposures for drill-down workflows",
|
|
19250
|
-
|
|
21816
|
+
parameters: factorResponseParams([
|
|
21817
|
+
{ name: "portfolioId", in: "path", required: true, schema: { type: "string" }, description: "Saved model portfolio identifier." }
|
|
21818
|
+
]),
|
|
21819
|
+
...jsonFactorResponse("ModelPortfolioFactorView")
|
|
21820
|
+
}
|
|
21821
|
+
},
|
|
21822
|
+
"/v1/models/factor-analysis": {
|
|
21823
|
+
post: {
|
|
21824
|
+
summary: "Return model factor analysis for submitted Model Builder or saved-model holdings with optional attribution, hedge, and optimizer sections",
|
|
21825
|
+
parameters: factorResponseParams(),
|
|
21826
|
+
...jsonRequestBody("ModelFactorAnalysisRequest"),
|
|
21827
|
+
...jsonFactorResponse("ModelFactorAnalysis")
|
|
19251
21828
|
}
|
|
19252
21829
|
},
|
|
19253
21830
|
"/v1/portfolio/stress-test": {
|
|
19254
21831
|
post: {
|
|
19255
21832
|
summary: "Run portfolio stress scenarios across factor and macro shock definitions with compact traceable outputs",
|
|
21833
|
+
parameters: factorResponseParams(),
|
|
19256
21834
|
...jsonRequestBody("PortfolioStressTestRequest"),
|
|
19257
|
-
...
|
|
21835
|
+
...jsonFactorResponse("PortfolioStressTest")
|
|
21836
|
+
}
|
|
21837
|
+
},
|
|
21838
|
+
"/v1/portfolio/hedge": {
|
|
21839
|
+
post: {
|
|
21840
|
+
summary: "Return bounded benchmark-instrument factor hedge candidates for a portfolio with compact residual exposure and trust metadata",
|
|
21841
|
+
parameters: factorResponseParams(),
|
|
21842
|
+
...jsonRequestBody("PortfolioHedgeRequest"),
|
|
21843
|
+
...jsonFactorResponse("PortfolioHedge")
|
|
19258
21844
|
}
|
|
19259
21845
|
},
|
|
19260
21846
|
"/v1/portfolio/optimize": {
|
|
19261
21847
|
post: {
|
|
19262
|
-
summary: "Return
|
|
19263
|
-
|
|
19264
|
-
...
|
|
21848
|
+
summary: "Return bounded factor-aware optimizer scenario candidates for factor-neutral, min-drawdown, or regime-aware objectives",
|
|
21849
|
+
parameters: factorResponseParams(),
|
|
21850
|
+
...jsonRequestBody("PortfolioOptimizeRequest"),
|
|
21851
|
+
...jsonFactorResponse("PortfolioAnalysis")
|
|
19265
21852
|
}
|
|
19266
21853
|
},
|
|
19267
21854
|
"/v1/strategies/factor-rotation": {
|
|
19268
|
-
post: {
|
|
21855
|
+
post: {
|
|
21856
|
+
summary: "Return factor-rotation recommendations informed by macro regime context and factor state",
|
|
21857
|
+
parameters: factorResponseParams(),
|
|
21858
|
+
...jsonRequestBody("FactorStrategyRequest"),
|
|
21859
|
+
...jsonFactorResponse("FactorRotationStrategy")
|
|
21860
|
+
}
|
|
19269
21861
|
},
|
|
19270
21862
|
"/v1/strategies/regime-screen": {
|
|
19271
|
-
post: {
|
|
21863
|
+
post: {
|
|
21864
|
+
summary: "Return regime-aware security screens with factor, macro, and filing-aware filters",
|
|
21865
|
+
parameters: factorResponseParams(),
|
|
21866
|
+
...jsonRequestBody("FactorStrategyRequest"),
|
|
21867
|
+
...jsonFactorResponse("FactorRegimeScreen")
|
|
21868
|
+
}
|
|
19272
21869
|
},
|
|
19273
21870
|
"/v1/intelligence/query": {
|
|
19274
21871
|
post: {
|
|
@@ -19323,7 +21920,7 @@ var openApiDocument = {
|
|
|
19323
21920
|
post: {
|
|
19324
21921
|
summary: "Return a one-call portfolio intelligence bundle with exposures, stress scenarios, events, and hedge ideas",
|
|
19325
21922
|
...jsonRequestBody("PortfolioIntelligenceRequest"),
|
|
19326
|
-
...
|
|
21923
|
+
...jsonFactorResponse("PortfolioAnalysis")
|
|
19327
21924
|
}
|
|
19328
21925
|
},
|
|
19329
21926
|
"/v1/intelligence/watchlist": {
|
|
@@ -19377,30 +21974,116 @@ var openApiDocument = {
|
|
|
19377
21974
|
get: { summary: "Return normalized SEC company facts for an issuer, concept, and optional form or unit" }
|
|
19378
21975
|
},
|
|
19379
21976
|
"/v1/statements": {
|
|
19380
|
-
get: {
|
|
21977
|
+
get: {
|
|
21978
|
+
summary: "Return a normalized statement backed by SEC company facts",
|
|
21979
|
+
parameters: [
|
|
21980
|
+
{ name: "ticker", in: "query", required: false, schema: { type: "string" }, description: "Issuer ticker. Either ticker or cik is required." },
|
|
21981
|
+
{ name: "cik", in: "query", required: false, schema: { type: "string" }, description: "Issuer CIK. Either ticker or cik is required." },
|
|
21982
|
+
{ name: "statement", in: "query", required: false, schema: { type: "string" }, description: "Statement key such as income_statement, balance_sheet, or cash_flow_statement." },
|
|
21983
|
+
{ name: "period", in: "query", required: false, schema: { type: "string", enum: ["annual", "quarterly"] } },
|
|
21984
|
+
{ name: "limit", in: "query", required: false, schema: { type: "integer", minimum: 1, maximum: 40 } },
|
|
21985
|
+
{ name: "view", in: "query", required: false, schema: { type: "string", enum: ["default", "compact", "agent"] }, description: "Use compact for period-indexed row arrays. Default and agent preserve statement value provenance." }
|
|
21986
|
+
],
|
|
21987
|
+
responses: {
|
|
21988
|
+
"200": {
|
|
21989
|
+
description: "Successful response. view=compact returns CompactStatement; view=agent returns StatementAgentRecord; default returns Statement.",
|
|
21990
|
+
content: {
|
|
21991
|
+
"application/json": {
|
|
21992
|
+
schema: {
|
|
21993
|
+
oneOf: [schemaRef("Statement"), schemaRef("CompactStatement"), schemaRef("StatementAgentRecord")]
|
|
21994
|
+
}
|
|
21995
|
+
}
|
|
21996
|
+
}
|
|
21997
|
+
}
|
|
21998
|
+
}
|
|
21999
|
+
}
|
|
19381
22000
|
},
|
|
19382
22001
|
"/v1/statements/all": {
|
|
19383
|
-
get: {
|
|
22002
|
+
get: {
|
|
22003
|
+
summary: "Return the balance sheet, income statement, and cash flow statement as one normalized bundle",
|
|
22004
|
+
parameters: [
|
|
22005
|
+
{ name: "ticker", in: "query", required: false, schema: { type: "string" }, description: "Issuer ticker. Either ticker or cik is required." },
|
|
22006
|
+
{ name: "cik", in: "query", required: false, schema: { type: "string" }, description: "Issuer CIK. Either ticker or cik is required." },
|
|
22007
|
+
{ name: "period", in: "query", required: false, schema: { type: "string", enum: ["annual", "quarterly"] } },
|
|
22008
|
+
{ name: "limit", in: "query", required: false, schema: { type: "integer", minimum: 1, maximum: 40 } }
|
|
22009
|
+
],
|
|
22010
|
+
...jsonResponse("StatementBundle")
|
|
22011
|
+
}
|
|
19384
22012
|
},
|
|
19385
22013
|
"/v1/statements/{statement_key}": {
|
|
19386
|
-
get: {
|
|
22014
|
+
get: {
|
|
22015
|
+
summary: "Return a specific normalized statement keyed by statement type",
|
|
22016
|
+
parameters: [
|
|
22017
|
+
{ name: "statement_key", in: "path", required: true, schema: { type: "string" }, description: "Statement key such as income_statement, balance_sheet, or cash_flow_statement." },
|
|
22018
|
+
{ name: "ticker", in: "query", required: false, schema: { type: "string" }, description: "Issuer ticker. Either ticker or cik is required." },
|
|
22019
|
+
{ name: "cik", in: "query", required: false, schema: { type: "string" }, description: "Issuer CIK. Either ticker or cik is required." },
|
|
22020
|
+
{ name: "period", in: "query", required: false, schema: { type: "string", enum: ["annual", "quarterly"] } },
|
|
22021
|
+
{ name: "limit", in: "query", required: false, schema: { type: "integer", minimum: 1, maximum: 40 } },
|
|
22022
|
+
{ name: "view", in: "query", required: false, schema: { type: "string", enum: ["default", "compact", "agent"] }, description: "Use compact for period-indexed row arrays. Default and agent preserve statement value provenance." }
|
|
22023
|
+
],
|
|
22024
|
+
responses: {
|
|
22025
|
+
"200": {
|
|
22026
|
+
description: "Successful response. view=compact returns CompactStatement; view=agent returns StatementAgentRecord; default returns Statement.",
|
|
22027
|
+
content: {
|
|
22028
|
+
"application/json": {
|
|
22029
|
+
schema: {
|
|
22030
|
+
oneOf: [schemaRef("Statement"), schemaRef("CompactStatement"), schemaRef("StatementAgentRecord")]
|
|
22031
|
+
}
|
|
22032
|
+
}
|
|
22033
|
+
}
|
|
22034
|
+
}
|
|
22035
|
+
}
|
|
22036
|
+
}
|
|
19387
22037
|
},
|
|
19388
22038
|
"/v1/companies/income-statements": {
|
|
19389
22039
|
get: {
|
|
19390
22040
|
summary: "Return SEC XBRL-derived income statements for a ticker with EBITDA and share-count enrichment",
|
|
19391
|
-
|
|
22041
|
+
parameters: [
|
|
22042
|
+
{ name: "ticker", in: "query", required: true, schema: { type: "string" } },
|
|
22043
|
+
{ name: "period", in: "query", required: false, schema: { type: "string", enum: ["annual", "quarterly"] } },
|
|
22044
|
+
{ name: "limit", in: "query", required: false, schema: { type: "integer", minimum: 1, maximum: 40 } },
|
|
22045
|
+
{ name: "view", in: "query", required: false, schema: { type: "string", enum: ["compact"] }, description: "Use compact for period-indexed row arrays. Omit for the enriched company income-statement envelope." }
|
|
22046
|
+
],
|
|
22047
|
+
responses: {
|
|
22048
|
+
"200": {
|
|
22049
|
+
description: "Successful response. view=compact returns CompactStatement; default returns CompanyIncomeStatements.",
|
|
22050
|
+
content: { "application/json": { schema: { oneOf: [schemaRef("CompanyIncomeStatements"), schemaRef("CompactStatement")] } } }
|
|
22051
|
+
}
|
|
22052
|
+
}
|
|
19392
22053
|
}
|
|
19393
22054
|
},
|
|
19394
22055
|
"/v1/companies/balance-sheets": {
|
|
19395
22056
|
get: {
|
|
19396
22057
|
summary: "Return SEC XBRL-derived balance sheets for a ticker with normalized debt, equity, and cash fields",
|
|
19397
|
-
|
|
22058
|
+
parameters: [
|
|
22059
|
+
{ name: "ticker", in: "query", required: true, schema: { type: "string" } },
|
|
22060
|
+
{ name: "period", in: "query", required: false, schema: { type: "string", enum: ["annual", "quarterly"] } },
|
|
22061
|
+
{ name: "limit", in: "query", required: false, schema: { type: "integer", minimum: 1, maximum: 40 } },
|
|
22062
|
+
{ name: "view", in: "query", required: false, schema: { type: "string", enum: ["compact"] }, description: "Use compact for period-indexed row arrays. Omit for the enriched company balance-sheet envelope." }
|
|
22063
|
+
],
|
|
22064
|
+
responses: {
|
|
22065
|
+
"200": {
|
|
22066
|
+
description: "Successful response. view=compact returns CompactStatement; default returns CompanyBalanceSheets.",
|
|
22067
|
+
content: { "application/json": { schema: { oneOf: [schemaRef("CompanyBalanceSheets"), schemaRef("CompactStatement")] } } }
|
|
22068
|
+
}
|
|
22069
|
+
}
|
|
19398
22070
|
}
|
|
19399
22071
|
},
|
|
19400
22072
|
"/v1/companies/cash-flow-statements": {
|
|
19401
22073
|
get: {
|
|
19402
22074
|
summary: "Return SEC XBRL-derived cash flow statements for a ticker with free-cash-flow and dividend enrichment",
|
|
19403
|
-
|
|
22075
|
+
parameters: [
|
|
22076
|
+
{ name: "ticker", in: "query", required: true, schema: { type: "string" } },
|
|
22077
|
+
{ name: "period", in: "query", required: false, schema: { type: "string", enum: ["annual", "quarterly"] } },
|
|
22078
|
+
{ name: "limit", in: "query", required: false, schema: { type: "integer", minimum: 1, maximum: 40 } },
|
|
22079
|
+
{ name: "view", in: "query", required: false, schema: { type: "string", enum: ["compact"] }, description: "Use compact for period-indexed row arrays. Omit for the enriched company cash-flow envelope." }
|
|
22080
|
+
],
|
|
22081
|
+
responses: {
|
|
22082
|
+
"200": {
|
|
22083
|
+
description: "Successful response. view=compact returns CompactStatement; default returns CompanyCashFlowStatements.",
|
|
22084
|
+
content: { "application/json": { schema: { oneOf: [schemaRef("CompanyCashFlowStatements"), schemaRef("CompactStatement")] } } }
|
|
22085
|
+
}
|
|
22086
|
+
}
|
|
19404
22087
|
}
|
|
19405
22088
|
},
|
|
19406
22089
|
"/v1/companies/financials": {
|
|
@@ -19727,7 +22410,12 @@ var v1MaintenanceMaterializeInvestorDataPlaneBodySchema = exports_external.objec
|
|
|
19727
22410
|
includePortfolios: exports_external.union([exports_external.boolean(), exports_external.string()]).optional(),
|
|
19728
22411
|
includeAllFactorDecomposition: exports_external.union([exports_external.boolean(), exports_external.string()]).optional(),
|
|
19729
22412
|
precomputeRouteResponses: exports_external.union([exports_external.boolean(), exports_external.string()]).optional(),
|
|
19730
|
-
|
|
22413
|
+
materializePrerequisites: exports_external.union([exports_external.boolean(), exports_external.string()]).optional(),
|
|
22414
|
+
intradayWindows: exports_external.union([exports_external.array(exports_external.string()), exports_external.string()]).optional(),
|
|
22415
|
+
stockBasketInputPath: exports_external.string().optional(),
|
|
22416
|
+
requiredStockBasketStartDate: exports_external.string().optional(),
|
|
22417
|
+
stockBasketRequiredStartDateByFactorKey: exports_external.record(exports_external.string(), exports_external.string()).optional(),
|
|
22418
|
+
stockBasketStartToleranceDays: exports_external.union([exports_external.number(), exports_external.string()]).optional()
|
|
19731
22419
|
}).optional(),
|
|
19732
22420
|
factorIntraday: exports_external.object({
|
|
19733
22421
|
categories: exports_external.union([exports_external.array(exports_external.string()), exports_external.string()]).optional(),
|
|
@@ -19850,6 +22538,19 @@ var accountCreateApiKeyBodySchema = exports_external.object({
|
|
|
19850
22538
|
livemode: exports_external.boolean().nullish(),
|
|
19851
22539
|
label: exports_external.string().nullish()
|
|
19852
22540
|
}).passthrough();
|
|
22541
|
+
var accountUpdateDashboardProfileBodySchema = exports_external.object({
|
|
22542
|
+
displayName: exports_external.string().trim().min(1).max(120).nullable()
|
|
22543
|
+
}).strict();
|
|
22544
|
+
var accountUpdateDashboardOrganizationBodySchema = exports_external.object({
|
|
22545
|
+
name: exports_external.string().trim().min(1).max(120)
|
|
22546
|
+
}).strict();
|
|
22547
|
+
var accountUpdateDashboardAppearanceBodySchema = exports_external.object({
|
|
22548
|
+
theme: exports_external.enum(["dark", "system"]).optional(),
|
|
22549
|
+
density: exports_external.enum(["comfortable", "compact"]).optional()
|
|
22550
|
+
}).strict();
|
|
22551
|
+
var accountRequestDeletionBodySchema = exports_external.object({
|
|
22552
|
+
reason: exports_external.string().trim().max(500).nullable().optional()
|
|
22553
|
+
}).strict();
|
|
19853
22554
|
var AGENT_CHAT_TICKET_VERSION = 1;
|
|
19854
22555
|
var AGENT_CHAT_TICKET_SERVICE_PRINCIPALS = ["browser", "eval"];
|
|
19855
22556
|
var agentChatTicketEnvelopeSchema = exports_external.object({
|
|
@@ -19954,7 +22655,7 @@ var APP_ONLY_DATABASE_URL_PARAMS = new Set([
|
|
|
19954
22655
|
]);
|
|
19955
22656
|
var DEFAULT_BASE_URL = "https://api.secapi.ai";
|
|
19956
22657
|
var DEFAULT_API_VERSION = "2026-03-19";
|
|
19957
|
-
var SDK_VERSION = "0.
|
|
22658
|
+
var SDK_VERSION = "0.5.0";
|
|
19958
22659
|
var POSTHOG_CAPTURE_HOST = "https://us.i.posthog.com";
|
|
19959
22660
|
var SAFE_RETRY_METHODS = new Set(["GET", "HEAD", "OPTIONS"]);
|
|
19960
22661
|
var RETRYABLE_STATUSES = new Set([408, 429, 502, 503, 504]);
|
|
@@ -20097,6 +22798,14 @@ function buildUrl(path, params) {
|
|
|
20097
22798
|
const search = buildSearchParams(params);
|
|
20098
22799
|
return search.size > 0 ? `${url2.pathname}?${search.toString()}` : url2.pathname;
|
|
20099
22800
|
}
|
|
22801
|
+
function withRequiredInclude(params, required2) {
|
|
22802
|
+
const existing = params.include;
|
|
22803
|
+
const includes = Array.isArray(existing) ? existing.map(String) : typeof existing === "string" ? existing.split(",") : [];
|
|
22804
|
+
const normalized = new Set(includes.map((entry) => entry.trim().toLowerCase()).filter(Boolean));
|
|
22805
|
+
if (!normalized.has(required2))
|
|
22806
|
+
includes.push(required2);
|
|
22807
|
+
return { ...params, include: includes.join(",") };
|
|
22808
|
+
}
|
|
20100
22809
|
function methodOf(init) {
|
|
20101
22810
|
return (init.method ?? "GET").toUpperCase();
|
|
20102
22811
|
}
|
|
@@ -20573,6 +23282,32 @@ class SecApiClient {
|
|
|
20573
23282
|
body: JSON.stringify(body)
|
|
20574
23283
|
}, undefined, options);
|
|
20575
23284
|
}
|
|
23285
|
+
async createMonitor(body, options) {
|
|
23286
|
+
return this.request("/v1/monitors", {
|
|
23287
|
+
method: "POST",
|
|
23288
|
+
headers: { "content-type": "application/json" },
|
|
23289
|
+
body: JSON.stringify(body)
|
|
23290
|
+
}, undefined, options);
|
|
23291
|
+
}
|
|
23292
|
+
async monitorMatches(monitorId, params = {}) {
|
|
23293
|
+
return this.get(`/v1/monitors/${encodeURIComponent(monitorId)}/matches`, params);
|
|
23294
|
+
}
|
|
23295
|
+
async callMcpTool(toolName, args = {}, options = {}) {
|
|
23296
|
+
const { id, ...requestOptions } = options;
|
|
23297
|
+
return this.request("/mcp", {
|
|
23298
|
+
method: "POST",
|
|
23299
|
+
headers: { "content-type": "application/json" },
|
|
23300
|
+
body: JSON.stringify({
|
|
23301
|
+
jsonrpc: "2.0",
|
|
23302
|
+
id: id ?? randomId(),
|
|
23303
|
+
method: "tools/call",
|
|
23304
|
+
params: {
|
|
23305
|
+
name: toolName,
|
|
23306
|
+
arguments: args
|
|
23307
|
+
}
|
|
23308
|
+
})
|
|
23309
|
+
}, undefined, requestOptions);
|
|
23310
|
+
}
|
|
20576
23311
|
async rotateWebhookEndpointSecret(webhookId, options) {
|
|
20577
23312
|
return this.request(`/v1/webhook_endpoints/${webhookId}/rotate_secret`, {
|
|
20578
23313
|
method: "POST"
|
|
@@ -20628,6 +23363,9 @@ class SecApiClient {
|
|
|
20628
23363
|
async latestFiling(params) {
|
|
20629
23364
|
return this.get("/v1/filings/latest", params);
|
|
20630
23365
|
}
|
|
23366
|
+
async agentLatestFiling(params) {
|
|
23367
|
+
return this.latestFiling({ ...params, view: "agent" });
|
|
23368
|
+
}
|
|
20631
23369
|
async renderLatestFiling(params) {
|
|
20632
23370
|
return this.get("/v1/filings/latest/render", params);
|
|
20633
23371
|
}
|
|
@@ -20635,6 +23373,9 @@ class SecApiClient {
|
|
|
20635
23373
|
const { sectionKey, ...rest } = params;
|
|
20636
23374
|
return this.get(`/v1/filings/latest/sections/${sectionKey}`, rest);
|
|
20637
23375
|
}
|
|
23376
|
+
async agentSection(params) {
|
|
23377
|
+
return this.latestSection({ ...params, mode: "compact" });
|
|
23378
|
+
}
|
|
20638
23379
|
async latestRiskCategories(params = {}) {
|
|
20639
23380
|
return this.get("/v1/filings/latest/risk-categories", params);
|
|
20640
23381
|
}
|
|
@@ -20651,6 +23392,12 @@ class SecApiClient {
|
|
|
20651
23392
|
async searchSections(params) {
|
|
20652
23393
|
return this.get("/v1/sections/search", params);
|
|
20653
23394
|
}
|
|
23395
|
+
async semanticSearch(params) {
|
|
23396
|
+
return this.get("/v1/search/semantic", params);
|
|
23397
|
+
}
|
|
23398
|
+
async searchFulltext(params) {
|
|
23399
|
+
return this.get("/v1/search/fulltext", params);
|
|
23400
|
+
}
|
|
20654
23401
|
async segmentedRevenues(params = {}) {
|
|
20655
23402
|
return this.get("/v1/statements/segmented-revenues", params);
|
|
20656
23403
|
}
|
|
@@ -20720,6 +23467,9 @@ class SecApiClient {
|
|
|
20720
23467
|
async form144Filings(params = {}) {
|
|
20721
23468
|
return this.get("/v1/forms/144", params);
|
|
20722
23469
|
}
|
|
23470
|
+
async agentForm144(params = {}) {
|
|
23471
|
+
return this.form144Filings({ ...params, view: "agent" });
|
|
23472
|
+
}
|
|
20723
23473
|
async companySubsidiaries(params = {}) {
|
|
20724
23474
|
return this.get("/v1/companies/subsidiaries", params);
|
|
20725
23475
|
}
|
|
@@ -20729,6 +23479,9 @@ class SecApiClient {
|
|
|
20729
23479
|
async marketCalendar(params = {}) {
|
|
20730
23480
|
return this.get("/v1/market/calendar", params);
|
|
20731
23481
|
}
|
|
23482
|
+
async marketEarningsCalendar(params = {}) {
|
|
23483
|
+
return this.get("/v1/market/earnings-calendar", params);
|
|
23484
|
+
}
|
|
20732
23485
|
async marketSnapshots(params) {
|
|
20733
23486
|
return this.get("/v1/market/snapshots", params);
|
|
20734
23487
|
}
|
|
@@ -20774,9 +23527,15 @@ class SecApiClient {
|
|
|
20774
23527
|
async factorHistory(factorKey, params = {}) {
|
|
20775
23528
|
return this.get(`/v1/factors/history/${encodeURIComponent(factorKey)}`, params);
|
|
20776
23529
|
}
|
|
23530
|
+
async factorHistoryCsv(factorKey, params = {}) {
|
|
23531
|
+
return this.get(`/v1/factors/history/${encodeURIComponent(factorKey)}`, { ...params, format: "csv" });
|
|
23532
|
+
}
|
|
20777
23533
|
async factorSparklines(params = {}) {
|
|
20778
23534
|
return this.get("/v1/factors/sparklines", params);
|
|
20779
23535
|
}
|
|
23536
|
+
async factorSparklinesCsv(params = {}) {
|
|
23537
|
+
return this.get("/v1/factors/sparklines", { ...params, format: "csv" });
|
|
23538
|
+
}
|
|
20780
23539
|
async factorReturnsIntraday(params = {}) {
|
|
20781
23540
|
return this.get("/v1/factors/returns/intraday", params);
|
|
20782
23541
|
}
|
|
@@ -20801,9 +23560,15 @@ class SecApiClient {
|
|
|
20801
23560
|
async factorValuations(params = {}) {
|
|
20802
23561
|
return this.get("/v1/factors/valuations", params);
|
|
20803
23562
|
}
|
|
23563
|
+
async factorValuationsCsv(params = {}) {
|
|
23564
|
+
return this.get("/v1/factors/valuations", { ...params, format: "csv" });
|
|
23565
|
+
}
|
|
20804
23566
|
async factorValuationStocks(params = {}) {
|
|
20805
23567
|
return this.get("/v1/factors/valuations/stocks", params);
|
|
20806
23568
|
}
|
|
23569
|
+
async factorValuationStocksCsv(params = {}) {
|
|
23570
|
+
return this.get("/v1/factors/valuations/stocks", { ...params, format: "csv" });
|
|
23571
|
+
}
|
|
20807
23572
|
async factorExposures(params) {
|
|
20808
23573
|
return this.get("/v1/factors/exposures", params);
|
|
20809
23574
|
}
|
|
@@ -20828,6 +23593,9 @@ class SecApiClient {
|
|
|
20828
23593
|
async factorBulkDownload(params = {}) {
|
|
20829
23594
|
return this.get("/v1/factors/bulk-download", params);
|
|
20830
23595
|
}
|
|
23596
|
+
async factorBulkDownloadCsv(params = {}) {
|
|
23597
|
+
return this.get("/v1/factors/bulk-download", { ...params, format: "csv" });
|
|
23598
|
+
}
|
|
20831
23599
|
async factorCustom(body, params = {}, options) {
|
|
20832
23600
|
return this.request(buildUrl("/v1/factors/custom", params), {
|
|
20833
23601
|
method: "POST",
|
|
@@ -20853,11 +23621,12 @@ class SecApiClient {
|
|
|
20853
23621
|
return this.get(`/v1/model-portfolios/${encodeURIComponent(portfolioId)}/factor-view`, params);
|
|
20854
23622
|
}
|
|
20855
23623
|
async modelFactorAnalysis(body, params = {}, options) {
|
|
20856
|
-
|
|
23624
|
+
const urlParams = withRequiredInclude(params, "trust");
|
|
23625
|
+
return this.request(buildUrl("/v1/models/factor-analysis", urlParams), {
|
|
20857
23626
|
method: "POST",
|
|
20858
23627
|
headers: { "content-type": "application/json" },
|
|
20859
23628
|
body: JSON.stringify(body)
|
|
20860
|
-
},
|
|
23629
|
+
}, modelFactorAnalysisSchema, mergeRequestOptions(requestOptionsFromParams(params), options));
|
|
20861
23630
|
}
|
|
20862
23631
|
async portfolioOptimize(body, params = {}, options) {
|
|
20863
23632
|
return this.request(buildUrl("/v1/portfolio/optimize", params), {
|
|
@@ -20871,7 +23640,7 @@ class SecApiClient {
|
|
|
20871
23640
|
method: "POST",
|
|
20872
23641
|
headers: { "content-type": "application/json" },
|
|
20873
23642
|
body: JSON.stringify(body)
|
|
20874
|
-
},
|
|
23643
|
+
}, portfolioHedgeSchema, mergeRequestOptions(requestOptionsFromParams(params), options));
|
|
20875
23644
|
}
|
|
20876
23645
|
async portfolioStressTest(body, params = {}, options) {
|
|
20877
23646
|
return this.request(buildUrl("/v1/portfolio/stress-test", params), {
|
|
@@ -20959,6 +23728,9 @@ class SecApiClient {
|
|
|
20959
23728
|
async statementByKey(statementKey, params) {
|
|
20960
23729
|
return this.get(`/v1/statements/${statementKey}`, params);
|
|
20961
23730
|
}
|
|
23731
|
+
async agentStatement(statementKey, params) {
|
|
23732
|
+
return this.statementByKey(statementKey, { ...params, view: "agent" });
|
|
23733
|
+
}
|
|
20962
23734
|
async companyIncomeStatements(params) {
|
|
20963
23735
|
return this.get("/v1/companies/income-statements", params);
|
|
20964
23736
|
}
|
|
@@ -20983,6 +23755,12 @@ class SecApiClient {
|
|
|
20983
23755
|
async latest13F(params) {
|
|
20984
23756
|
return this.get("/v1/owners/13f", params);
|
|
20985
23757
|
}
|
|
23758
|
+
async institutionalHolders(params) {
|
|
23759
|
+
return this.get("/v1/owners/institutional/ticker", params);
|
|
23760
|
+
}
|
|
23761
|
+
async agentInstitutionalHolders(params) {
|
|
23762
|
+
return this.institutionalHolders({ ...params, view: "agent" });
|
|
23763
|
+
}
|
|
20986
23764
|
async list13FFilings(params) {
|
|
20987
23765
|
return this.get("/v1/owners/13f/filings", params);
|
|
20988
23766
|
}
|
|
@@ -21194,7 +23972,7 @@ class SecApiFilingStream {
|
|
|
21194
23972
|
|
|
21195
23973
|
// src/index.ts
|
|
21196
23974
|
var args = process.argv.slice(2);
|
|
21197
|
-
var baseUrl = envCredential("SECAPI_BASE_URL", "SECAPI_API_BASE_URL", "OMNI_DATASTREAM_BASE_URL") ?? "https://api.secapi.ai";
|
|
23975
|
+
var baseUrl = envCredential("SECAPI_BASE_URL", "SECAPI_API_BASE_URL", "OMNI_DATASTREAM_BASE_URL", "OMNI_DATASTREAM_API_BASE_URL") ?? "https://api.secapi.ai";
|
|
21198
23976
|
var STDIN_FLAG_NAME = "--api-key-stdin";
|
|
21199
23977
|
var STDIN_BEARER_FLAG_NAME = "--bearer-token-stdin";
|
|
21200
23978
|
var REJECTED_CREDENTIAL_FLAGS = new Set(["--api-key", "--bearer-token"]);
|
|
@@ -21214,7 +23992,7 @@ function formatPersonasHuman() {
|
|
|
21214
23992
|
console.log(` ${DIM}${meta3.summary}${RESET}`);
|
|
21215
23993
|
}
|
|
21216
23994
|
console.log("");
|
|
21217
|
-
console.log(`${DIM}Run 'secapi agents prompts list --persona <slug>' to see prompts for a persona.
|
|
23995
|
+
console.log(`${DIM}Run 'secapi agents prompts list --persona <slug>' to see prompts for a persona. ${RESET}`);
|
|
21218
23996
|
}
|
|
21219
23997
|
function formatPromptsListHuman(persona, prompts, totalCount) {
|
|
21220
23998
|
if (persona) {
|
|
@@ -21298,6 +24076,11 @@ function hasFlag(name) {
|
|
|
21298
24076
|
function print(value) {
|
|
21299
24077
|
console.log(JSON.stringify(value, null, 2));
|
|
21300
24078
|
}
|
|
24079
|
+
function printRaw(value) {
|
|
24080
|
+
process.stdout.write(value.endsWith(`
|
|
24081
|
+
`) ? value : `${value}
|
|
24082
|
+
`);
|
|
24083
|
+
}
|
|
21301
24084
|
function getNumberFlag(name) {
|
|
21302
24085
|
const raw = getFlag(name);
|
|
21303
24086
|
if (raw === undefined)
|
|
@@ -21323,6 +24106,85 @@ function getNullableIntegerFlag(name) {
|
|
|
21323
24106
|
function getListFlag(name) {
|
|
21324
24107
|
return getFlag(name)?.split(",").map((value) => value.trim()).filter(Boolean);
|
|
21325
24108
|
}
|
|
24109
|
+
function getBooleanFlag(name) {
|
|
24110
|
+
if (!hasFlag(name))
|
|
24111
|
+
return;
|
|
24112
|
+
const raw = getFlag(name);
|
|
24113
|
+
if (raw === undefined || raw.startsWith("--"))
|
|
24114
|
+
return true;
|
|
24115
|
+
const normalized = raw.trim().toLowerCase();
|
|
24116
|
+
if (["1", "true", "yes", "on"].includes(normalized))
|
|
24117
|
+
return true;
|
|
24118
|
+
if (["0", "false", "no", "off"].includes(normalized))
|
|
24119
|
+
return false;
|
|
24120
|
+
throw new Error(`${name} must be true or false`);
|
|
24121
|
+
}
|
|
24122
|
+
function parseJsonValue(raw, label) {
|
|
24123
|
+
try {
|
|
24124
|
+
return JSON.parse(raw);
|
|
24125
|
+
} catch (error51) {
|
|
24126
|
+
throw new Error(`${label} must be valid JSON`);
|
|
24127
|
+
}
|
|
24128
|
+
}
|
|
24129
|
+
function getJsonInput(jsonFlag, fileFlag, label) {
|
|
24130
|
+
const inline = getFlag(jsonFlag);
|
|
24131
|
+
const file2 = getFlag(fileFlag);
|
|
24132
|
+
if (inline && file2)
|
|
24133
|
+
throw new Error(`Use only one of ${jsonFlag} or ${fileFlag}`);
|
|
24134
|
+
if (inline)
|
|
24135
|
+
return parseJsonValue(inline, label);
|
|
24136
|
+
if (file2)
|
|
24137
|
+
return parseJsonValue(readFileSync(file2, "utf8"), label);
|
|
24138
|
+
return;
|
|
24139
|
+
}
|
|
24140
|
+
function getObjectInput(jsonFlag, fileFlag, label) {
|
|
24141
|
+
const value = getJsonInput(jsonFlag, fileFlag, label);
|
|
24142
|
+
if (value === undefined)
|
|
24143
|
+
return;
|
|
24144
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
24145
|
+
throw new Error(`${label} must be a JSON object`);
|
|
24146
|
+
}
|
|
24147
|
+
return value;
|
|
24148
|
+
}
|
|
24149
|
+
function getArrayInput(jsonFlag, fileFlag, label) {
|
|
24150
|
+
const value = getJsonInput(jsonFlag, fileFlag, label);
|
|
24151
|
+
if (value === undefined)
|
|
24152
|
+
return;
|
|
24153
|
+
if (!Array.isArray(value)) {
|
|
24154
|
+
throw new Error(`${label} must be a JSON array`);
|
|
24155
|
+
}
|
|
24156
|
+
return value;
|
|
24157
|
+
}
|
|
24158
|
+
function getRequiredHoldings() {
|
|
24159
|
+
const holdings = getArrayInput("--holdings-json", "--holdings-file", "holdings");
|
|
24160
|
+
if (!holdings)
|
|
24161
|
+
throw new Error("--holdings-json or --holdings-file is required");
|
|
24162
|
+
return holdings;
|
|
24163
|
+
}
|
|
24164
|
+
function factorResponseParams2() {
|
|
24165
|
+
return {
|
|
24166
|
+
response_mode: getFlag("--response-mode") ?? getFlag("--view"),
|
|
24167
|
+
include: getListFlag("--include") ?? getListFlag("--expand")
|
|
24168
|
+
};
|
|
24169
|
+
}
|
|
24170
|
+
function factorKeySelectionParams() {
|
|
24171
|
+
return {
|
|
24172
|
+
keys: getListFlag("--keys") ?? getListFlag("--factors"),
|
|
24173
|
+
category: getFlag("--category"),
|
|
24174
|
+
window: getFlag("--window"),
|
|
24175
|
+
lookback: getFlag("--lookback"),
|
|
24176
|
+
...factorResponseParams2()
|
|
24177
|
+
};
|
|
24178
|
+
}
|
|
24179
|
+
function portfolioWorkflowBody() {
|
|
24180
|
+
return {
|
|
24181
|
+
country: getFlag("--country"),
|
|
24182
|
+
lookback: getFlag("--lookback"),
|
|
24183
|
+
category: getFlag("--category"),
|
|
24184
|
+
keys: getListFlag("--keys") ?? getListFlag("--factors"),
|
|
24185
|
+
holdings: getRequiredHoldings()
|
|
24186
|
+
};
|
|
24187
|
+
}
|
|
21326
24188
|
function rejectedCredentialFlag(arg) {
|
|
21327
24189
|
const flag = arg.includes("=") ? arg.slice(0, arg.indexOf("=")) : arg;
|
|
21328
24190
|
return REJECTED_CREDENTIAL_FLAGS.has(flag) ? flag : null;
|
|
@@ -21394,8 +24256,21 @@ function humanClient(credentials) {
|
|
|
21394
24256
|
baseUrl
|
|
21395
24257
|
});
|
|
21396
24258
|
}
|
|
24259
|
+
function cliVersion() {
|
|
24260
|
+
try {
|
|
24261
|
+
const pkgUrl = new URL("../package.json", import.meta.url);
|
|
24262
|
+
const pkg = JSON.parse(readFileSync(pkgUrl, "utf8"));
|
|
24263
|
+
if (typeof pkg.version === "string" && pkg.version)
|
|
24264
|
+
return pkg.version;
|
|
24265
|
+
} catch {}
|
|
24266
|
+
return "unknown";
|
|
24267
|
+
}
|
|
21397
24268
|
async function main() {
|
|
21398
24269
|
rejectCredentialArgvFlags();
|
|
24270
|
+
if (args[0] === "--version" || args[0] === "-v" || args[0] === "version") {
|
|
24271
|
+
printRaw(cliVersion());
|
|
24272
|
+
return;
|
|
24273
|
+
}
|
|
21399
24274
|
const credentials = await resolveCredentials();
|
|
21400
24275
|
const [group = "help", command = ""] = args;
|
|
21401
24276
|
const apiClient = defaultClient(credentials);
|
|
@@ -21554,7 +24429,7 @@ async function main() {
|
|
|
21554
24429
|
if (group === "agents" && command === "prompts") {
|
|
21555
24430
|
const subverb = args[2];
|
|
21556
24431
|
if (!subverb || subverb.startsWith("-")) {
|
|
21557
|
-
throw new Error("Usage: secapi agents prompts <list|read|copy> [...]
|
|
24432
|
+
throw new Error("Usage: secapi agents prompts <list|read|copy> [...]");
|
|
21558
24433
|
}
|
|
21559
24434
|
if (subverb === "list") {
|
|
21560
24435
|
const personaFlag = getFlag("--persona");
|
|
@@ -21585,7 +24460,7 @@ async function main() {
|
|
|
21585
24460
|
if (subverb === "read") {
|
|
21586
24461
|
const id = args[3];
|
|
21587
24462
|
if (!id || id.startsWith("-")) {
|
|
21588
|
-
throw new Error("Usage: secapi agents prompts read <id>. Run 'secapi agents prompts list' to see IDs.
|
|
24463
|
+
throw new Error("Usage: secapi agents prompts read <id>. Run 'secapi agents prompts list' to see IDs. ");
|
|
21589
24464
|
}
|
|
21590
24465
|
const prompt = getPrompt(id);
|
|
21591
24466
|
if (!prompt) {
|
|
@@ -21601,7 +24476,7 @@ async function main() {
|
|
|
21601
24476
|
if (subverb === "copy") {
|
|
21602
24477
|
const id = args[3];
|
|
21603
24478
|
if (!id || id.startsWith("-")) {
|
|
21604
|
-
throw new Error("Usage: secapi agents prompts copy <id>. Pipe to clipboard via | pbcopy (macOS), | xclip -selection clipboard (Linux), or | clip (Windows).
|
|
24479
|
+
throw new Error("Usage: secapi agents prompts copy <id>. Pipe to clipboard via | pbcopy (macOS), | xclip -selection clipboard (Linux), or | clip (Windows). ");
|
|
21605
24480
|
}
|
|
21606
24481
|
const prompt = getPrompt(id);
|
|
21607
24482
|
if (!prompt) {
|
|
@@ -21758,6 +24633,35 @@ async function main() {
|
|
|
21758
24633
|
}));
|
|
21759
24634
|
return;
|
|
21760
24635
|
}
|
|
24636
|
+
if (group === "search" && command === "fulltext") {
|
|
24637
|
+
const q = getFlag("--q") ?? getFlag("--query");
|
|
24638
|
+
if (!q)
|
|
24639
|
+
throw new Error("--q or --query is required");
|
|
24640
|
+
print(await apiClient.searchFulltext({
|
|
24641
|
+
q,
|
|
24642
|
+
ticker: getFlag("--ticker"),
|
|
24643
|
+
cik: getFlag("--cik"),
|
|
24644
|
+
form: getFlag("--form"),
|
|
24645
|
+
limit: getNumberFlag("--limit")
|
|
24646
|
+
}));
|
|
24647
|
+
return;
|
|
24648
|
+
}
|
|
24649
|
+
if (group === "search" && command === "semantic") {
|
|
24650
|
+
const q = getFlag("--q") ?? getFlag("--query");
|
|
24651
|
+
if (!q)
|
|
24652
|
+
throw new Error("--q or --query is required");
|
|
24653
|
+
print(await apiClient.semanticSearch({
|
|
24654
|
+
q,
|
|
24655
|
+
ticker: getFlag("--ticker"),
|
|
24656
|
+
cik: getFlag("--cik"),
|
|
24657
|
+
form: getFlag("--form"),
|
|
24658
|
+
filing_year: getNumberFlag("--filing-year"),
|
|
24659
|
+
mode: getFlag("--mode"),
|
|
24660
|
+
limit: getNumberFlag("--limit"),
|
|
24661
|
+
view: getFlag("--view")
|
|
24662
|
+
}));
|
|
24663
|
+
return;
|
|
24664
|
+
}
|
|
21761
24665
|
if (group === "sections" && command === "get") {
|
|
21762
24666
|
print(await apiClient.latestSection({
|
|
21763
24667
|
ticker: getFlag("--ticker"),
|
|
@@ -21909,7 +24813,7 @@ async function main() {
|
|
|
21909
24813
|
if (group === "dilution" && command === "event") {
|
|
21910
24814
|
const eventId = getFlag("--event-id");
|
|
21911
24815
|
if (!eventId)
|
|
21912
|
-
throw new Error("Usage: secapi dilution event --event-id <id> [--view agent]
|
|
24816
|
+
throw new Error("Usage: secapi dilution event --event-id <id> [--view agent]");
|
|
21913
24817
|
print(await apiClient.dilutionEventDetail(eventId, { view: getFlag("--view") }));
|
|
21914
24818
|
return;
|
|
21915
24819
|
}
|
|
@@ -22028,7 +24932,7 @@ async function main() {
|
|
|
22028
24932
|
if (group === "dilution" && command === "score") {
|
|
22029
24933
|
const ticker = getFlag("--ticker");
|
|
22030
24934
|
if (!ticker)
|
|
22031
|
-
throw new Error("Usage: secapi dilution score --ticker <symbol> [--view agent]
|
|
24935
|
+
throw new Error("Usage: secapi dilution score --ticker <symbol> [--view agent]");
|
|
22032
24936
|
print(await apiClient.dilutionScore({ ticker, view: getFlag("--view") }));
|
|
22033
24937
|
return;
|
|
22034
24938
|
}
|
|
@@ -22164,6 +25068,59 @@ async function main() {
|
|
|
22164
25068
|
}));
|
|
22165
25069
|
return;
|
|
22166
25070
|
}
|
|
25071
|
+
if (group === "strategies" && command === "factor-rotation") {
|
|
25072
|
+
print(await apiClient.strategyFactorRotation({
|
|
25073
|
+
country: getFlag("--country"),
|
|
25074
|
+
category: getFlag("--category"),
|
|
25075
|
+
window: getFlag("--window"),
|
|
25076
|
+
lookback: getFlag("--lookback"),
|
|
25077
|
+
limit: getNumberFlag("--limit")
|
|
25078
|
+
}));
|
|
25079
|
+
return;
|
|
25080
|
+
}
|
|
25081
|
+
if (group === "strategies" && command === "regime-screen") {
|
|
25082
|
+
print(await apiClient.strategyRegimeScreen({
|
|
25083
|
+
country: getFlag("--country"),
|
|
25084
|
+
category: getFlag("--category"),
|
|
25085
|
+
window: getFlag("--window"),
|
|
25086
|
+
lookback: getFlag("--lookback"),
|
|
25087
|
+
limit: getNumberFlag("--limit")
|
|
25088
|
+
}));
|
|
25089
|
+
return;
|
|
25090
|
+
}
|
|
25091
|
+
if (group === "factors" && command === "history") {
|
|
25092
|
+
const factorKey = getFlag("--factor") ?? getFlag("--factor-key") ?? getFlag("--key");
|
|
25093
|
+
if (!factorKey)
|
|
25094
|
+
throw new Error("--factor, --factor-key, or --key is required");
|
|
25095
|
+
const params = {
|
|
25096
|
+
range: getFlag("--range"),
|
|
25097
|
+
lookback: getFlag("--lookback"),
|
|
25098
|
+
window: getFlag("--window"),
|
|
25099
|
+
date_from: getFlag("--date-from") ?? getFlag("--date_from"),
|
|
25100
|
+
date_to: getFlag("--date-to") ?? getFlag("--date_to"),
|
|
25101
|
+
...factorResponseParams2()
|
|
25102
|
+
};
|
|
25103
|
+
if (getFlag("--format") === "csv")
|
|
25104
|
+
printRaw(await apiClient.factorHistoryCsv(factorKey, params));
|
|
25105
|
+
else
|
|
25106
|
+
print(await apiClient.factorHistory(factorKey, params));
|
|
25107
|
+
return;
|
|
25108
|
+
}
|
|
25109
|
+
if (group === "factors" && command === "sparklines") {
|
|
25110
|
+
const params = {
|
|
25111
|
+
...factorKeySelectionParams(),
|
|
25112
|
+
range: getFlag("--range"),
|
|
25113
|
+
date_from: getFlag("--date-from") ?? getFlag("--date_from"),
|
|
25114
|
+
date_to: getFlag("--date-to") ?? getFlag("--date_to"),
|
|
25115
|
+
metric: getFlag("--metric"),
|
|
25116
|
+
points: getNumberFlag("--points") ?? getNumberFlag("--point-limit") ?? getNumberFlag("--pointLimit") ?? getNumberFlag("--point_limit")
|
|
25117
|
+
};
|
|
25118
|
+
if (getFlag("--format") === "csv")
|
|
25119
|
+
printRaw(await apiClient.factorSparklinesCsv(params));
|
|
25120
|
+
else
|
|
25121
|
+
print(await apiClient.factorSparklines(params));
|
|
25122
|
+
return;
|
|
25123
|
+
}
|
|
22167
25124
|
if (group === "factors" && command === "returns-intraday") {
|
|
22168
25125
|
print(await apiClient.factorReturnsIntraday({
|
|
22169
25126
|
keys: getListFlag("--keys"),
|
|
@@ -22181,7 +25138,8 @@ async function main() {
|
|
|
22181
25138
|
limit: getNumberFlag("--limit"),
|
|
22182
25139
|
ticker: getFlag("--ticker"),
|
|
22183
25140
|
portfolioId: getFlag("--portfolio-id"),
|
|
22184
|
-
keys: getListFlag("--keys")
|
|
25141
|
+
keys: getListFlag("--keys"),
|
|
25142
|
+
...factorResponseParams2()
|
|
22185
25143
|
}));
|
|
22186
25144
|
return;
|
|
22187
25145
|
}
|
|
@@ -22194,6 +25152,114 @@ async function main() {
|
|
|
22194
25152
|
}));
|
|
22195
25153
|
return;
|
|
22196
25154
|
}
|
|
25155
|
+
if (group === "factors" && command === "extreme-moves") {
|
|
25156
|
+
print(await apiClient.factorExtremeMoves({
|
|
25157
|
+
keys: getListFlag("--keys"),
|
|
25158
|
+
category: getFlag("--category"),
|
|
25159
|
+
window: getFlag("--window"),
|
|
25160
|
+
lookback: getFlag("--lookback"),
|
|
25161
|
+
side: getFlag("--side"),
|
|
25162
|
+
direction: getFlag("--direction"),
|
|
25163
|
+
sort: getFlag("--sort"),
|
|
25164
|
+
min_z_score: getNumberFlag("--min-z-score") ?? getNumberFlag("--min_z_score"),
|
|
25165
|
+
minAbsZScore: getNumberFlag("--min-abs-z-score") ?? getNumberFlag("--minAbsZScore"),
|
|
25166
|
+
limit: getNumberFlag("--limit"),
|
|
25167
|
+
response_mode: getFlag("--response-mode"),
|
|
25168
|
+
include: getListFlag("--include")
|
|
25169
|
+
}));
|
|
25170
|
+
return;
|
|
25171
|
+
}
|
|
25172
|
+
if (group === "factors" && command === "extreme-pairs") {
|
|
25173
|
+
print(await apiClient.factorExtremePairs({
|
|
25174
|
+
keys: getListFlag("--keys"),
|
|
25175
|
+
category: getFlag("--category"),
|
|
25176
|
+
window: getFlag("--window"),
|
|
25177
|
+
lookback: getFlag("--lookback"),
|
|
25178
|
+
side: getFlag("--side"),
|
|
25179
|
+
direction: getFlag("--direction"),
|
|
25180
|
+
sort: getFlag("--sort"),
|
|
25181
|
+
min_z_score: getNumberFlag("--min-z-score") ?? getNumberFlag("--min_z_score"),
|
|
25182
|
+
minAbsZScore: getNumberFlag("--min-abs-z-score") ?? getNumberFlag("--minAbsZScore"),
|
|
25183
|
+
limit: getNumberFlag("--limit"),
|
|
25184
|
+
response_mode: getFlag("--response-mode"),
|
|
25185
|
+
include: getListFlag("--include")
|
|
25186
|
+
}));
|
|
25187
|
+
return;
|
|
25188
|
+
}
|
|
25189
|
+
if (group === "factors" && command === "valuations") {
|
|
25190
|
+
const params = {
|
|
25191
|
+
keys: getListFlag("--keys") ?? getListFlag("--factors"),
|
|
25192
|
+
category: getFlag("--category"),
|
|
25193
|
+
window: getFlag("--window"),
|
|
25194
|
+
lookback: getFlag("--lookback"),
|
|
25195
|
+
side: getFlag("--side"),
|
|
25196
|
+
signal: getFlag("--signal"),
|
|
25197
|
+
sort: getFlag("--sort"),
|
|
25198
|
+
weighting_mode: getFlag("--weighting-mode"),
|
|
25199
|
+
weighting: getFlag("--weighting"),
|
|
25200
|
+
limit: getNumberFlag("--limit"),
|
|
25201
|
+
response_mode: getFlag("--response-mode") ?? getFlag("--view"),
|
|
25202
|
+
include: getListFlag("--include") ?? getListFlag("--expand")
|
|
25203
|
+
};
|
|
25204
|
+
if (getFlag("--format") === "csv")
|
|
25205
|
+
printRaw(await apiClient.factorValuationsCsv(params));
|
|
25206
|
+
else
|
|
25207
|
+
print(await apiClient.factorValuations(params));
|
|
25208
|
+
return;
|
|
25209
|
+
}
|
|
25210
|
+
if (group === "factors" && command === "valuation-stocks") {
|
|
25211
|
+
const params = {
|
|
25212
|
+
factor: getFlag("--factor"),
|
|
25213
|
+
factorKey: getFlag("--factor-key") ?? getFlag("--factorKey"),
|
|
25214
|
+
key: getFlag("--key"),
|
|
25215
|
+
keys: getListFlag("--keys") ?? getListFlag("--factors"),
|
|
25216
|
+
category: getFlag("--category"),
|
|
25217
|
+
window: getFlag("--window"),
|
|
25218
|
+
lookback: getFlag("--lookback"),
|
|
25219
|
+
signal: getFlag("--signal"),
|
|
25220
|
+
weighting_mode: getFlag("--weighting-mode"),
|
|
25221
|
+
weighting: getFlag("--weighting"),
|
|
25222
|
+
stance: getFlag("--stance"),
|
|
25223
|
+
side: getFlag("--side"),
|
|
25224
|
+
direction: getFlag("--direction"),
|
|
25225
|
+
sort: getFlag("--sort"),
|
|
25226
|
+
limit: getNumberFlag("--limit"),
|
|
25227
|
+
response_mode: getFlag("--response-mode") ?? getFlag("--view"),
|
|
25228
|
+
include: getListFlag("--include") ?? getListFlag("--expand")
|
|
25229
|
+
};
|
|
25230
|
+
if (getFlag("--format") === "csv")
|
|
25231
|
+
printRaw(await apiClient.factorValuationStocksCsv(params));
|
|
25232
|
+
else
|
|
25233
|
+
print(await apiClient.factorValuationStocks(params));
|
|
25234
|
+
return;
|
|
25235
|
+
}
|
|
25236
|
+
if (group === "factors" && command === "pairs") {
|
|
25237
|
+
print(await apiClient.factorPairs({
|
|
25238
|
+
factor1: getFlag("--factor1"),
|
|
25239
|
+
factor2: getFlag("--factor2"),
|
|
25240
|
+
f1: getFlag("--f1"),
|
|
25241
|
+
f2: getFlag("--f2"),
|
|
25242
|
+
window: getFlag("--window"),
|
|
25243
|
+
lookback: getFlag("--lookback"),
|
|
25244
|
+
response_mode: getFlag("--response-mode"),
|
|
25245
|
+
include: getListFlag("--include")
|
|
25246
|
+
}));
|
|
25247
|
+
return;
|
|
25248
|
+
}
|
|
25249
|
+
if (group === "factors" && command === "pair-history") {
|
|
25250
|
+
const f1 = getFlag("--factor1") ?? getFlag("--f1");
|
|
25251
|
+
const f2 = getFlag("--factor2") ?? getFlag("--f2");
|
|
25252
|
+
if (!f1 || !f2)
|
|
25253
|
+
throw new Error("--factor1/--f1 and --factor2/--f2 are required");
|
|
25254
|
+
print(await apiClient.factorPairHistory(f1, f2, {
|
|
25255
|
+
window: getFlag("--window"),
|
|
25256
|
+
lookback: getFlag("--lookback"),
|
|
25257
|
+
range: getFlag("--range"),
|
|
25258
|
+
response_mode: getFlag("--response-mode"),
|
|
25259
|
+
include: getListFlag("--include")
|
|
25260
|
+
}));
|
|
25261
|
+
return;
|
|
25262
|
+
}
|
|
22197
25263
|
if (group === "factors" && command === "decomposition") {
|
|
22198
25264
|
const symbol2 = getFlag("--ticker") ?? getFlag("--symbol");
|
|
22199
25265
|
if (!symbol2)
|
|
@@ -22217,9 +25283,22 @@ async function main() {
|
|
|
22217
25283
|
}));
|
|
22218
25284
|
return;
|
|
22219
25285
|
}
|
|
25286
|
+
if (group === "factors" && command === "similarity-pack") {
|
|
25287
|
+
const symbol2 = getFlag("--ticker") ?? getFlag("--symbol");
|
|
25288
|
+
if (!symbol2)
|
|
25289
|
+
throw new Error("--ticker or --symbol is required");
|
|
25290
|
+
print(await apiClient.factorSimilarityPack({
|
|
25291
|
+
symbol: symbol2,
|
|
25292
|
+
candidates: getListFlag("--candidates"),
|
|
25293
|
+
lookback: getFlag("--lookback"),
|
|
25294
|
+
limit: getNumberFlag("--limit")
|
|
25295
|
+
}));
|
|
25296
|
+
return;
|
|
25297
|
+
}
|
|
22220
25298
|
if (group === "factors" && command === "catalog") {
|
|
22221
25299
|
print(await apiClient.factorCatalog({
|
|
22222
|
-
category: getFlag("--category")
|
|
25300
|
+
category: getFlag("--category"),
|
|
25301
|
+
...factorResponseParams2()
|
|
22223
25302
|
}));
|
|
22224
25303
|
return;
|
|
22225
25304
|
}
|
|
@@ -22232,6 +25311,32 @@ async function main() {
|
|
|
22232
25311
|
}));
|
|
22233
25312
|
return;
|
|
22234
25313
|
}
|
|
25314
|
+
if (group === "factors" && command === "exposures") {
|
|
25315
|
+
const symbols = getListFlag("--symbols") ?? getListFlag("--tickers");
|
|
25316
|
+
if (!symbols?.length)
|
|
25317
|
+
throw new Error("--symbols or --tickers is required");
|
|
25318
|
+
print(await apiClient.factorExposures({
|
|
25319
|
+
symbols,
|
|
25320
|
+
...factorKeySelectionParams(),
|
|
25321
|
+
model: getFlag("--model")
|
|
25322
|
+
}));
|
|
25323
|
+
return;
|
|
25324
|
+
}
|
|
25325
|
+
if (group === "factors" && command === "bulk-download") {
|
|
25326
|
+
const params = factorKeySelectionParams();
|
|
25327
|
+
if (getFlag("--format") === "csv")
|
|
25328
|
+
printRaw(await apiClient.factorBulkDownloadCsv(params));
|
|
25329
|
+
else
|
|
25330
|
+
print(await apiClient.factorBulkDownload(params));
|
|
25331
|
+
return;
|
|
25332
|
+
}
|
|
25333
|
+
if (group === "factors" && command === "custom") {
|
|
25334
|
+
const body = getObjectInput("--body-json", "--body-file", "custom factor request") ?? getObjectInput("--query-json", "--query-file", "custom factor request");
|
|
25335
|
+
if (!body)
|
|
25336
|
+
throw new Error("--body-json, --body-file, --query-json, or --query-file is required");
|
|
25337
|
+
print(await apiClient.factorCustom(body, factorResponseParams2()));
|
|
25338
|
+
return;
|
|
25339
|
+
}
|
|
22235
25340
|
if (group === "factors" && command === "correlations") {
|
|
22236
25341
|
print(await apiClient.factorCorrelations({
|
|
22237
25342
|
keys: getListFlag("--keys"),
|
|
@@ -22250,6 +25355,50 @@ async function main() {
|
|
|
22250
25355
|
}));
|
|
22251
25356
|
return;
|
|
22252
25357
|
}
|
|
25358
|
+
if (group === "portfolio" && command === "analyze") {
|
|
25359
|
+
print(await apiClient.portfolioAnalyze({
|
|
25360
|
+
...portfolioWorkflowBody(),
|
|
25361
|
+
benchmarkLabel: getFlag("--benchmark-label"),
|
|
25362
|
+
benchmarkHoldings: getArrayInput("--benchmark-holdings-json", "--benchmark-holdings-file", "benchmark holdings"),
|
|
25363
|
+
whatIfLabel: getFlag("--what-if-label"),
|
|
25364
|
+
whatIfHoldings: getArrayInput("--what-if-holdings-json", "--what-if-holdings-file", "what-if holdings")
|
|
25365
|
+
}, factorResponseParams2()));
|
|
25366
|
+
return;
|
|
25367
|
+
}
|
|
25368
|
+
if (group === "portfolio" && command === "attribution") {
|
|
25369
|
+
print(await apiClient.portfolioAttribution({
|
|
25370
|
+
...portfolioWorkflowBody(),
|
|
25371
|
+
window: getFlag("--window"),
|
|
25372
|
+
frequency: getFlag("--frequency"),
|
|
25373
|
+
exportFormat: getFlag("--export-format")
|
|
25374
|
+
}, factorResponseParams2()));
|
|
25375
|
+
return;
|
|
25376
|
+
}
|
|
25377
|
+
if (group === "portfolio" && command === "hedge") {
|
|
25378
|
+
print(await apiClient.portfolioHedge({
|
|
25379
|
+
...portfolioWorkflowBody(),
|
|
25380
|
+
objective: getFlag("--objective"),
|
|
25381
|
+
mode: getFlag("--mode"),
|
|
25382
|
+
constraints: getObjectInput("--constraints-json", "--constraints-file", "hedge constraints")
|
|
25383
|
+
}, factorResponseParams2()));
|
|
25384
|
+
return;
|
|
25385
|
+
}
|
|
25386
|
+
if (group === "portfolio" && command === "optimize") {
|
|
25387
|
+
print(await apiClient.portfolioOptimize({
|
|
25388
|
+
...portfolioWorkflowBody(),
|
|
25389
|
+
objective: getFlag("--objective"),
|
|
25390
|
+
maxHedges: getNumberFlag("--max-hedges") ?? getNumberFlag("--maxHedges"),
|
|
25391
|
+
constraints: getObjectInput("--constraints-json", "--constraints-file", "optimizer constraints")
|
|
25392
|
+
}, factorResponseParams2()));
|
|
25393
|
+
return;
|
|
25394
|
+
}
|
|
25395
|
+
if (group === "portfolio" && command === "stress-test") {
|
|
25396
|
+
print(await apiClient.portfolioStressTest({
|
|
25397
|
+
...portfolioWorkflowBody(),
|
|
25398
|
+
scenarioKey: getFlag("--scenario-key")
|
|
25399
|
+
}, factorResponseParams2()));
|
|
25400
|
+
return;
|
|
25401
|
+
}
|
|
22253
25402
|
if (group === "stocks" && command === "loadings") {
|
|
22254
25403
|
const ticker = getFlag("--ticker");
|
|
22255
25404
|
if (!ticker)
|
|
@@ -22268,10 +25417,36 @@ async function main() {
|
|
|
22268
25417
|
print(await apiClient.modelPortfolioFactorView(portfolioId, {
|
|
22269
25418
|
keys: getListFlag("--keys"),
|
|
22270
25419
|
category: getFlag("--category"),
|
|
22271
|
-
lookback: getFlag("--lookback")
|
|
25420
|
+
lookback: getFlag("--lookback"),
|
|
25421
|
+
...factorResponseParams2()
|
|
22272
25422
|
}));
|
|
22273
25423
|
return;
|
|
22274
25424
|
}
|
|
25425
|
+
if (group === "models" && command === "factor-analysis") {
|
|
25426
|
+
const model = getObjectInput("--model-json", "--model-file", "model") ?? {
|
|
25427
|
+
id: getFlag("--model-id"),
|
|
25428
|
+
label: getFlag("--label"),
|
|
25429
|
+
source: getFlag("--source")
|
|
25430
|
+
};
|
|
25431
|
+
print(await apiClient.modelFactorAnalysis({
|
|
25432
|
+
model,
|
|
25433
|
+
country: getFlag("--country"),
|
|
25434
|
+
lookback: getFlag("--lookback"),
|
|
25435
|
+
window: getFlag("--window"),
|
|
25436
|
+
category: getFlag("--category"),
|
|
25437
|
+
keys: getListFlag("--keys") ?? getListFlag("--factors"),
|
|
25438
|
+
include: {
|
|
25439
|
+
attribution: getBooleanFlag("--include-attribution"),
|
|
25440
|
+
hedge: getBooleanFlag("--include-hedge"),
|
|
25441
|
+
optimizer: getBooleanFlag("--include-optimizer"),
|
|
25442
|
+
positionViews: getBooleanFlag("--include-position-views")
|
|
25443
|
+
},
|
|
25444
|
+
hedge: getObjectInput("--hedge-json", "--hedge-file", "hedge options"),
|
|
25445
|
+
optimizer: getObjectInput("--optimizer-json", "--optimizer-file", "optimizer options"),
|
|
25446
|
+
holdings: getRequiredHoldings()
|
|
25447
|
+
}, factorResponseParams2()));
|
|
25448
|
+
return;
|
|
25449
|
+
}
|
|
22275
25450
|
if (group === "intelligence" && command === "footnotes-query") {
|
|
22276
25451
|
print(await apiClient.intelligenceFootnotesQuery({
|
|
22277
25452
|
ticker: getFlag("--ticker"),
|
|
@@ -22389,144 +25564,169 @@ async function main() {
|
|
|
22389
25564
|
"Compatibility alias: omni-sec",
|
|
22390
25565
|
"",
|
|
22391
25566
|
"Commands:",
|
|
22392
|
-
"
|
|
22393
|
-
"
|
|
22394
|
-
"
|
|
22395
|
-
"
|
|
22396
|
-
"
|
|
22397
|
-
"
|
|
22398
|
-
"
|
|
22399
|
-
"
|
|
22400
|
-
"
|
|
22401
|
-
"
|
|
22402
|
-
"
|
|
25567
|
+
" secapi health",
|
|
25568
|
+
" secapi me",
|
|
25569
|
+
" secapi org show",
|
|
25570
|
+
" secapi billing show",
|
|
25571
|
+
" secapi dashboard overview",
|
|
25572
|
+
" secapi billing quote --meter-class section_extract --units 10",
|
|
25573
|
+
" secapi billing budget --spend-cap-cents 900 --soft-cap-cents 500 --approval-threshold-cents 750",
|
|
25574
|
+
" secapi billing checkout --plan personal",
|
|
25575
|
+
" secapi billing portal",
|
|
25576
|
+
" secapi agent bootstrap-token --label ci --scopes read:sec --ttl-seconds 900",
|
|
25577
|
+
" secapi agent bootstrap --token agbt_... --label first-agent-key",
|
|
22403
25578
|
"",
|
|
22404
25579
|
" # Agent prompt library",
|
|
22405
|
-
"
|
|
22406
|
-
"
|
|
22407
|
-
"
|
|
22408
|
-
"
|
|
22409
|
-
"
|
|
22410
|
-
"
|
|
22411
|
-
"
|
|
22412
|
-
"
|
|
22413
|
-
" SECAPI_API_KEY=...
|
|
22414
|
-
" SECAPI_OPERATOR_API_KEY=...
|
|
22415
|
-
" OMNI_DATASTREAM_API_KEY=... omni-sec api-keys list #
|
|
22416
|
-
` printf '%s' "$SECAPI_API_KEY" |
|
|
22417
|
-
"
|
|
22418
|
-
"
|
|
22419
|
-
"
|
|
22420
|
-
"
|
|
22421
|
-
"
|
|
22422
|
-
"
|
|
22423
|
-
"
|
|
22424
|
-
"
|
|
22425
|
-
"
|
|
22426
|
-
"
|
|
22427
|
-
"
|
|
22428
|
-
"
|
|
22429
|
-
"
|
|
22430
|
-
"
|
|
22431
|
-
"
|
|
22432
|
-
"
|
|
22433
|
-
"
|
|
22434
|
-
"
|
|
22435
|
-
"
|
|
22436
|
-
"
|
|
22437
|
-
"
|
|
22438
|
-
"
|
|
22439
|
-
"
|
|
22440
|
-
"
|
|
22441
|
-
"
|
|
22442
|
-
"
|
|
22443
|
-
"
|
|
22444
|
-
"
|
|
22445
|
-
|
|
22446
|
-
|
|
22447
|
-
"
|
|
22448
|
-
"
|
|
22449
|
-
"
|
|
22450
|
-
"
|
|
22451
|
-
"
|
|
25580
|
+
" secapi agents personas",
|
|
25581
|
+
" secapi agents prompts list",
|
|
25582
|
+
" secapi agents prompts list --persona law-firm",
|
|
25583
|
+
" secapi agents prompts list --persona investment-manager --json",
|
|
25584
|
+
" secapi agents prompts list --include-v2",
|
|
25585
|
+
" secapi agents prompts read law-firm-enforcement-history",
|
|
25586
|
+
" secapi agents prompts copy investment-manager-factor-decomposition | pbcopy",
|
|
25587
|
+
" secapi api-keys list",
|
|
25588
|
+
" SECAPI_API_KEY=... secapi api-keys list",
|
|
25589
|
+
" SECAPI_OPERATOR_API_KEY=... secapi admin orgs --limit 20",
|
|
25590
|
+
" OMNI_DATASTREAM_API_KEY=... omni-sec api-keys list # compatibility env + binary alias",
|
|
25591
|
+
` printf '%s' "$SECAPI_API_KEY" | secapi api-keys list ${STDIN_FLAG_NAME}`,
|
|
25592
|
+
" secapi usage show",
|
|
25593
|
+
" secapi limits show",
|
|
25594
|
+
" secapi events list --kind event --limit 10",
|
|
25595
|
+
" secapi events export --kind webhook_delivery --format json",
|
|
25596
|
+
" secapi diagnostics request --request-id req_...",
|
|
25597
|
+
" secapi diagnostics deliveries-summary --limit 50",
|
|
25598
|
+
" secapi admin orgs --limit 20",
|
|
25599
|
+
" secapi admin org --org-id org_...",
|
|
25600
|
+
" secapi admin request --org-id org_... --request-id req_...",
|
|
25601
|
+
" secapi admin deliveries-summary --org-id org_... --limit 20",
|
|
25602
|
+
" secapi observability show",
|
|
25603
|
+
" secapi observability export --limit 20",
|
|
25604
|
+
" secapi api-keys create --label local-dev --scopes read:sec,write:artifacts",
|
|
25605
|
+
" secapi webhooks list",
|
|
25606
|
+
" secapi webhooks create --destination-url https://example.com/hooks/sec --event-types artifact.created,artifact.reconciled",
|
|
25607
|
+
" secapi webhooks rotate-secret --webhook-id wh_...",
|
|
25608
|
+
" secapi webhooks deliveries --webhook-id wh_... --limit 10",
|
|
25609
|
+
" secapi webhooks replay-delivery --webhook-id wh_... --delivery-id wdel_...",
|
|
25610
|
+
" secapi streams list",
|
|
25611
|
+
" secapi streams create --event-types artifact.created,artifact.reconciled --transport poll",
|
|
25612
|
+
" secapi streams events --stream-id strm_... --limit 10",
|
|
25613
|
+
" secapi entities resolve --ticker AAPL",
|
|
25614
|
+
" secapi filings search --ticker AAPL --form 10-K",
|
|
25615
|
+
" secapi filings search --q risk factors --form 10-K",
|
|
25616
|
+
" secapi filings latest --ticker AAPL --form 10-K",
|
|
25617
|
+
" secapi filings render --ticker AAPL --form 10-K",
|
|
25618
|
+
" secapi sections search --ticker AAPL --q risk --form 10-K",
|
|
25619
|
+
" secapi sections get --ticker AAPL --form 10-K --section item_1a",
|
|
25620
|
+
' secapi search fulltext --q "supply chain" --form 10-K --limit 10',
|
|
25621
|
+
' secapi search semantic --q "revenue concentration risk" --ticker AAPL --mode hybrid [--view agent]',
|
|
25622
|
+
" secapi facts get --ticker AAPL --tag Assets --form 10-K",
|
|
25623
|
+
" secapi statements get --ticker AAPL --statement balance_sheet --period annual",
|
|
25624
|
+
" secapi owners 13f --cik 0001067983 --limit 25 [--view agent]",
|
|
25625
|
+
" secapi owners compare-13f --cik 0001067983 --limit 25",
|
|
25626
|
+
" secapi insiders list --ticker AAPL --limit 10 [--view agent]",
|
|
25627
|
+
" secapi compensation list --ticker AAPL --limit 10 [--view agent]",
|
|
25628
|
+
" secapi compensation compare --ticker AAPL --limit 10",
|
|
22452
25629
|
"",
|
|
22453
25630
|
" # Agent-mode endpoints (add --view agent for compact shape)",
|
|
22454
|
-
"
|
|
22455
|
-
"
|
|
22456
|
-
"
|
|
22457
|
-
"
|
|
22458
|
-
"
|
|
22459
|
-
"
|
|
22460
|
-
"
|
|
25631
|
+
" secapi forms 144 --ticker AAPL --limit 10 [--view agent]",
|
|
25632
|
+
" secapi offerings list --ticker NVDA --limit 10 [--view agent]",
|
|
25633
|
+
" secapi events ma --ticker MSFT --limit 10 [--view agent]",
|
|
25634
|
+
" secapi events enforcement --query fraud --limit 10 [--view agent]",
|
|
25635
|
+
" secapi events voting-results --ticker MSFT --limit 10 [--view agent]",
|
|
25636
|
+
" secapi funds nport-holdings --ticker VTI --limit 25 [--view agent]",
|
|
25637
|
+
" secapi companies subsidiaries --ticker AAPL [--view agent]",
|
|
22461
25638
|
"",
|
|
22462
25639
|
" # Dilution endpoints — all support --view agent except `coverage`",
|
|
22463
|
-
"
|
|
22464
|
-
"
|
|
22465
|
-
"
|
|
22466
|
-
"
|
|
22467
|
-
"
|
|
22468
|
-
"
|
|
22469
|
-
"
|
|
22470
|
-
"
|
|
22471
|
-
"
|
|
22472
|
-
"
|
|
22473
|
-
"
|
|
22474
|
-
"
|
|
22475
|
-
"
|
|
22476
|
-
"
|
|
22477
|
-
"
|
|
22478
|
-
"
|
|
22479
|
-
"
|
|
22480
|
-
"
|
|
22481
|
-
"
|
|
22482
|
-
"
|
|
25640
|
+
" secapi dilution events --ticker BBBB --is-atm true --limit 10 [--view agent]",
|
|
25641
|
+
" secapi dilution event --event-id evt_... [--view agent]",
|
|
25642
|
+
" secapi dilution warrants --ticker BBBB --limit 10 [--view agent]",
|
|
25643
|
+
" secapi dilution convertibles --ticker BBBB --limit 10 [--view agent]",
|
|
25644
|
+
" secapi dilution rofr --ticker BBBB --limit 10 [--view agent]",
|
|
25645
|
+
" secapi dilution lockups --ticker BBBB --limit 10 [--view agent]",
|
|
25646
|
+
" secapi dilution cash-position --ticker BBBB --limit 5 [--view agent]",
|
|
25647
|
+
" secapi dilution corporate-actions --ticker BBBB --action-type reverse_split [--view agent]",
|
|
25648
|
+
" secapi dilution nasdaq-compliance --status active --limit 10 [--view agent]",
|
|
25649
|
+
" secapi dilution ratings --overall-risk high --limit 10 [--view agent]",
|
|
25650
|
+
" secapi dilution reverse-splits --ticker BBBB --limit 5 [--view agent]",
|
|
25651
|
+
" secapi dilution score --ticker BBBB [--view agent]",
|
|
25652
|
+
" secapi dilution share-float-history --ticker BBBB --limit 12 [--view agent]",
|
|
25653
|
+
" secapi dilution coverage [--ticker BBBB]",
|
|
25654
|
+
" secapi artifacts bundle --ticker AAPL --form 10-K --section item_1a",
|
|
25655
|
+
" secapi artifacts list --kind markdown_bundle --limit 10",
|
|
25656
|
+
" secapi artifacts summary",
|
|
25657
|
+
" secapi artifacts manifest --artifact-id art_...",
|
|
25658
|
+
" secapi artifacts export --artifact-id art_... --format json",
|
|
25659
|
+
" secapi artifacts reconcile --artifact-id art_...",
|
|
22483
25660
|
"",
|
|
22484
25661
|
" # Macro",
|
|
22485
|
-
"
|
|
22486
|
-
"
|
|
22487
|
-
"
|
|
22488
|
-
"
|
|
22489
|
-
"
|
|
22490
|
-
"
|
|
25662
|
+
" secapi macro high-signal-pack --country JP",
|
|
25663
|
+
" secapi macro regimes --country US --lookback 18m",
|
|
25664
|
+
" secapi macro indicators --country US --indicator GDP",
|
|
25665
|
+
" secapi macro releases --country US",
|
|
25666
|
+
" secapi macro calendar --country US --days 30",
|
|
25667
|
+
" secapi macro forecasts --country US",
|
|
22491
25668
|
"",
|
|
22492
25669
|
" # Factors",
|
|
22493
|
-
"
|
|
22494
|
-
"
|
|
22495
|
-
"
|
|
22496
|
-
"
|
|
22497
|
-
"
|
|
22498
|
-
"
|
|
22499
|
-
"
|
|
22500
|
-
"
|
|
22501
|
-
"
|
|
25670
|
+
" secapi factors catalog --category style",
|
|
25671
|
+
" secapi factors returns --keys MOMENTUM,VALUE --window 1m",
|
|
25672
|
+
" secapi factors history --factor VALUE --range 1y --include trust,series",
|
|
25673
|
+
" secapi factors sparklines --keys MOMENTUM,VALUE --range 1y --points 64",
|
|
25674
|
+
" secapi factors returns-intraday --window 1m",
|
|
25675
|
+
" secapi factors dashboard --country US --category style --ticker AAPL",
|
|
25676
|
+
" secapi factors screen --category style --limit 10",
|
|
25677
|
+
" secapi factors extreme-moves --category style --window 1d --min-z-score 2 --limit 10",
|
|
25678
|
+
" secapi factors extreme-pairs --category style --window 1m --min-z-score 1 --limit 10",
|
|
25679
|
+
" secapi factors valuations --category style --signal tailwind --sort opportunity_score --limit 10",
|
|
25680
|
+
" secapi factors valuation-stocks --factor VALUE --stance beneficiaries --limit 25",
|
|
25681
|
+
" secapi factors pairs --factor1 VALUE --factor2 MOMENTUM --window 1m",
|
|
25682
|
+
" secapi factors pair-history --factor1 VALUE --factor2 MOMENTUM --include series",
|
|
25683
|
+
" secapi factors decomposition --ticker AAPL",
|
|
25684
|
+
" secapi factors related-stocks --ticker AAPL --limit 10",
|
|
25685
|
+
" secapi factors similarity-pack --ticker AAPL --limit 10",
|
|
25686
|
+
" secapi factors exposures --symbols AAPL,MSFT --keys QUALITY,MOMENTUM",
|
|
25687
|
+
" secapi factors bulk-download --keys VALUE,MOMENTUM --format csv",
|
|
25688
|
+
` secapi factors custom --body-json '{"symbol":"AAPL","candidates":["MSFT"]}'`,
|
|
25689
|
+
" secapi factors correlations --keys MOMENTUM,VALUE",
|
|
25690
|
+
" secapi factors regime-performance --country US",
|
|
25691
|
+
"",
|
|
25692
|
+
" # Portfolio factor workflows",
|
|
25693
|
+
` secapi portfolio analyze --holdings-json '[{"symbol":"AAPL","weight":0.6},{"symbol":"MSFT","weight":0.4}]'`,
|
|
25694
|
+
" secapi portfolio attribution --holdings-file holdings.json --window 1m --frequency weekly",
|
|
25695
|
+
` secapi portfolio hedge --holdings-file holdings.json --objective min_drawdown --constraints-json '{"maxHedges":2}'`,
|
|
25696
|
+
` secapi portfolio optimize --holdings-file holdings.json --objective regime_aware --constraints-json '{"maxCandidates":3}'`,
|
|
25697
|
+
" secapi portfolio stress-test --holdings-file holdings.json --scenario-key higher_for_longer",
|
|
25698
|
+
"",
|
|
25699
|
+
" # Factor strategies",
|
|
25700
|
+
" secapi strategies factor-rotation --country US --category style --limit 5",
|
|
25701
|
+
" secapi strategies regime-screen --country US --lookback 6m",
|
|
22502
25702
|
"",
|
|
22503
25703
|
" # Stocks",
|
|
22504
|
-
"
|
|
25704
|
+
" secapi stocks loadings --ticker AAPL",
|
|
22505
25705
|
"",
|
|
22506
25706
|
" # Model Portfolios",
|
|
22507
|
-
"
|
|
25707
|
+
" secapi model-portfolios factor-view --portfolio-id us_megacap_platforms",
|
|
25708
|
+
" secapi models factor-analysis --holdings-file holdings.json --label 'AI leaders' --include-optimizer true",
|
|
22508
25709
|
"",
|
|
22509
25710
|
" # Intelligence",
|
|
22510
|
-
"
|
|
22511
|
-
"
|
|
22512
|
-
"
|
|
22513
|
-
"
|
|
25711
|
+
" secapi intelligence security --ticker AAPL",
|
|
25712
|
+
" secapi intelligence company --ticker AAPL",
|
|
25713
|
+
" secapi intelligence earnings-preview --ticker AAPL",
|
|
25714
|
+
" secapi intelligence footnotes-query --ticker AAPL --topics lease,debt_covenant",
|
|
22514
25715
|
"",
|
|
22515
25716
|
" # Companies (canonical financials)",
|
|
22516
|
-
"
|
|
22517
|
-
"
|
|
22518
|
-
"
|
|
22519
|
-
"
|
|
22520
|
-
"
|
|
22521
|
-
"
|
|
22522
|
-
"
|
|
22523
|
-
"
|
|
25717
|
+
" secapi companies financials --ticker AAPL --period annual",
|
|
25718
|
+
" secapi companies ratios --ticker AAPL --period annual",
|
|
25719
|
+
" secapi companies income-statements --ticker AAPL",
|
|
25720
|
+
" secapi companies balance-sheets --ticker AAPL",
|
|
25721
|
+
" secapi companies cash-flow-statements --ticker AAPL",
|
|
25722
|
+
" secapi companies resolve --ticker AAPL",
|
|
25723
|
+
" secapi companies resolve --figi BBG000B9XRY4",
|
|
25724
|
+
" secapi companies search --q Apple --limit 5",
|
|
22524
25725
|
"",
|
|
22525
25726
|
"Environment:",
|
|
22526
|
-
" Preferred: SECAPI_API_KEY, SECAPI_BEARER_TOKEN, SECAPI_BASE_URL, SECAPI_API_BASE_URL, SECAPI_OPERATOR_API_KEY"
|
|
22527
|
-
" Compatibility fallbacks: OMNI_DATASTREAM_API_KEY, OMNI_DATASTREAM_BEARER_TOKEN, OMNI_DATASTREAM_BASE_URL, OMNI_OPERATOR_API_KEY, OMNI_DATASTREAM_OPERATOR_API_KEY"
|
|
25727
|
+
" Preferred: SECAPI_API_KEY, SECAPI_BEARER_TOKEN, SECAPI_BASE_URL, SECAPI_API_BASE_URL, SECAPI_OPERATOR_API_KEY"
|
|
22528
25728
|
];
|
|
22529
|
-
console.log(commandHelpLines.map((line) => line
|
|
25729
|
+
console.log(commandHelpLines.map((line) => line).join(`
|
|
22530
25730
|
`));
|
|
22531
25731
|
}
|
|
22532
25732
|
main().catch((error51) => {
|