@yottagraph-app/aether-instructions 1.1.7 → 1.1.9

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.
Files changed (37) hide show
  1. package/commands/build_my_app.md +2 -2
  2. package/commands/update_instructions.md +30 -23
  3. package/package.json +1 -1
  4. package/rules/aether.mdc +1 -1
  5. package/rules/api.mdc +10 -15
  6. package/skills/data-model/SKILL.md +58 -0
  7. package/skills/data-model/edgar/DATA_DICTIONARY.md +306 -0
  8. package/skills/data-model/edgar/schema.yaml +1893 -0
  9. package/skills/data-model/fdic/DATA_DICTIONARY.md +243 -0
  10. package/skills/data-model/fdic/schema.yaml +356 -0
  11. package/skills/data-model/fred/DATA_DICTIONARY.md +313 -0
  12. package/skills/data-model/fred/schema.yaml +155 -0
  13. package/skills/data-model/gleif/DATA_DICTIONARY.md +211 -0
  14. package/skills/data-model/gleif/schema.yaml +254 -0
  15. package/skills/data-model/newsdata/schema.yaml +650 -0
  16. package/skills/data-model/overview.md +77 -0
  17. package/skills/data-model/polymarket/DATA_DICTIONARY.md +384 -0
  18. package/skills/data-model/polymarket/schema.yaml +601 -0
  19. package/skills/data-model/sanctions/DATA_DICTIONARY.md +140 -0
  20. package/skills/data-model/sanctions/schema.yaml +153 -0
  21. package/skills/data-model/stocks/DATA_DICTIONARY.md +122 -0
  22. package/skills/data-model/stocks/schema.yaml +131 -0
  23. package/skills/data-model/system_schema.yaml +71 -0
  24. package/skills/data-model/wikipedia/DATA_DICTIONARY.md +185 -0
  25. package/skills/data-model/wikipedia/schema.yaml +255 -0
  26. package/skills/elemental-api/SKILL.md +37 -0
  27. package/skills/elemental-api/articles.md +386 -0
  28. package/skills/elemental-api/entities.md +393 -0
  29. package/skills/elemental-api/events.md +145 -0
  30. package/skills/elemental-api/find.md +279 -0
  31. package/skills/elemental-api/graph.md +239 -0
  32. package/skills/elemental-api/llm.md +18 -0
  33. package/skills/elemental-api/overview.md +51 -0
  34. package/skills/elemental-api/relationships.md +310 -0
  35. package/skills/elemental-api/schema.md +379 -0
  36. package/skills/elemental-api/sentiment.md +93 -0
  37. package/skills/elemental-api/server.md +186 -0
@@ -0,0 +1,77 @@
1
+ # Data Model Overview
2
+
3
+ The Lovelace knowledge graph is populated by multiple fetch sources. This document explains how to navigate the per-source documentation.
4
+
5
+ ## Source Index
6
+
7
+ Use this table to find which source to consult for different types of information:
8
+
9
+ | Looking for... | Check these sources |
10
+ |----------------|---------------------|
11
+ | Public company data, SEC filings | edgar |
12
+ | Bank and financial institution data | fdic |
13
+ | Macroeconomic indicators, rates | fred |
14
+ | Legal Entity Identifiers (LEI), corporate ownership | gleif |
15
+ | News articles and press releases | newsdata |
16
+ | Prediction markets | polymarket |
17
+ | Sanctions lists, compliance data | sanctions |
18
+ | Stock prices, OHLCV market data | stocks |
19
+ | People, places, organizations (general knowledge) | wikipedia |
20
+
21
+ ## Documentation Structure
22
+
23
+ Each source directory contains:
24
+
25
+ | File | Purpose |
26
+ |------|---------|
27
+ | `DATA_DICTIONARY.md` | Human-readable documentation of entity types, properties, relationships, and data pipelines |
28
+ | `schema.yaml` | Machine-readable schema definition |
29
+
30
+ Not all sources have both files. Check `SKILL.md` for which files each source provides.
31
+
32
+ ## Common Concepts
33
+
34
+ All sources share these concepts:
35
+
36
+ - **Flavors**: Entity types (e.g., `organization`, `person`). Some are namespaced like `sec::10_k`.
37
+ - **Properties**: Fields on entities with types, descriptions, and domain flavors.
38
+ - **Relationships**: Links between entities (e.g., `issued_by`, `works_at`).
39
+ - **Strong IDs**: Properties that uniquely identify entities across sources (e.g., `company_cik`, `lei`).
40
+
41
+ ## How Sources Interact
42
+
43
+ Entities from different sources can merge when they share a **strong ID**. For example, an organization from EDGAR and the same organization from sanctions will merge if they share an `lei` value.
44
+
45
+ Each source's DATA_DICTIONARY.md documents:
46
+ - Which entity types it creates
47
+ - What strong IDs it uses for resolution
48
+ - How its entities relate to other sources
49
+
50
+ ## Schema Structure
51
+
52
+ Each `schema.yaml` follows this structure:
53
+
54
+ ```yaml
55
+ name: "source_name"
56
+ description: "What this source provides"
57
+
58
+ extraction:
59
+ flavors: closed # or open - whether new flavors can be added
60
+ properties: closed
61
+ relationships: closed
62
+
63
+ flavors:
64
+ - name: "entity_type"
65
+ mergeability: not_mergeable # or mergeable
66
+ strong_id_properties: ["prop_name"]
67
+
68
+ properties:
69
+ - name: "property_name"
70
+ type: string
71
+ domain_flavors: ["entity_type"]
72
+
73
+ relationships:
74
+ - name: "relationship_name"
75
+ domain_flavors: ["source_type"]
76
+ target_flavors: ["target_type"]
77
+ ```
@@ -0,0 +1,384 @@
1
+ # Data Dictionary: Polymarket
2
+
3
+ ## Purpose
4
+
5
+ Polymarket is a prediction market platform where users trade on the outcomes of real-world events. The Lovelace Polymarket pipeline polls the [Gamma API](https://gamma-api.polymarket.com) for active and recently closed events, extracts real-world entities from event text via LLM, and atomizes both the LLM extraction results and structured market data (prices, volumes, outcomes) into Records.
6
+
7
+ Events are polled on a configurable interval (default: every 15 minutes). Each poll fetches all active events (paginated by volume, up to 10,000) and the top 1,000 recently closed events. LLM extraction is skipped for events whose title and description have not changed since the previous poll cycle. Series data is fetched from the `/series` endpoint for events that belong to a recurring series.
8
+
9
+ The pipeline has two data paths:
10
+ - **LLM extraction**: event title, description, market questions, category, and tags are composed into a document and sent to an LLM to extract real-world entities (people, organizations, locations, etc.), relationships, events, and sentiment.
11
+ - **Structured atomization**: event metadata, market statistics, and series data are atomized directly from the Gamma API JSON response without LLM involvement.
12
+
13
+ `Record.Source`: `polymarket`
14
+
15
+ ---
16
+
17
+ ## Entity Types
18
+
19
+ ### `prediction_event`
20
+
21
+ A Polymarket prediction event containing one or more tradeable markets. Events are the top-level container for related prediction questions.
22
+
23
+ - Primary key: `polymarket_id` (Gamma API event ID)
24
+ - Entity resolver: not mergeable. Strong ID = Gamma API event ID.
25
+
26
+ ### `prediction_market`
27
+
28
+ A single tradeable prediction market (question) within a Polymarket event. Each market has its own order book, outcomes, and pricing.
29
+
30
+ - Primary key: `polymarket_id` (Gamma API market ID)
31
+ - Entity resolver: not mergeable. Strong ID = Gamma API market ID.
32
+
33
+ ### `prediction_series`
34
+
35
+ A series of related Polymarket prediction events that recur over time (e.g., weekly Bitcoin price markets).
36
+
37
+ - Primary key: `polymarket_id` (Gamma API series ID)
38
+ - Entity resolver: not mergeable. Strong ID = Gamma API series ID.
39
+
40
+ ### `person`
41
+
42
+ A real, named person such as a politician, executive, athlete, or public figure mentioned in a prediction event.
43
+
44
+ - Primary key: entity name as extracted by the LLM
45
+ - Entity resolver: named entity, mergeable. No strong ID; resolved by name and context snippets from the event text.
46
+
47
+ ### `organization`
48
+
49
+ A company, institution, government body, sports team, sports league, political party, or other named organization mentioned in a prediction event.
50
+
51
+ - Primary key: entity name as extracted by the LLM
52
+ - Entity resolver: named entity, mergeable. No strong ID; resolved by name and context snippets.
53
+
54
+ ### `location`
55
+
56
+ A specific named geographic location (country, state, city, region) mentioned in a prediction event.
57
+
58
+ - Primary key: entity name as extracted by the LLM
59
+ - Entity resolver: named entity, mergeable. No strong ID; resolved by name and context snippets.
60
+
61
+ ### `financial_instrument`
62
+
63
+ A specific tradeable asset (cryptocurrency, stock, ETF, commodity future) mentioned in a prediction event. Betting lines, spreads, and over/under totals are not financial instruments.
64
+
65
+ - Primary key: entity name as extracted by the LLM
66
+ - Entity resolver: named entity, mergeable. No strong ID; resolved by name and context snippets.
67
+
68
+ ### `product`
69
+
70
+ A specific named product, technology, software, AI model, movie, TV show, or other creative or commercial work mentioned in a prediction event.
71
+
72
+ - Primary key: entity name as extracted by the LLM
73
+ - Entity resolver: named entity, mergeable. No strong ID; resolved by name and context snippets.
74
+
75
+ ### `competition`
76
+
77
+ A named recurring competition, championship, tournament, or award ceremony mentioned in a prediction event.
78
+
79
+ - Primary key: entity name as extracted by the LLM
80
+ - Entity resolver: named entity, mergeable. No strong ID; resolved by name and context snippets.
81
+
82
+ ### `conflict`
83
+
84
+ A named geopolitical or military conflict, war, or crisis mentioned in a prediction event.
85
+
86
+ - Primary key: entity name as extracted by the LLM
87
+ - Entity resolver: named entity, mergeable. No strong ID; resolved by name and context snippets.
88
+
89
+ ### `event`
90
+
91
+ An extracted event category representing a predicted real-world occurrence (e.g., "Election outcome", "IPO", "Geopolitical event"). Uses the shared `event` flavor from the common schema.
92
+
93
+ - Primary key: event name as extracted by the LLM
94
+ - Entity resolver: not mergeable.
95
+
96
+ ---
97
+
98
+ ## Properties
99
+
100
+ ### Prediction Event Properties
101
+
102
+ #### Identity (source: structured Gamma API data)
103
+
104
+ * `polymarket_id`
105
+ * Definition: the unique Polymarket identifier for this event.
106
+ * Examples: `"903"`, `"21485"`
107
+ * Derivation: `id` field from the Gamma API `/events` response. Also serves as the entity's strong ID for resolution.
108
+
109
+ * `title`
110
+ * Definition: the title of the prediction event.
111
+ * Examples: `"Presidential Election Winner 2024"`, `"Bitcoin above $100k by end of year?"`
112
+ * Derivation: `title` field from the Gamma API `/events` response.
113
+
114
+ * `event_description`
115
+ * Definition: the full description text of the prediction event.
116
+ * Derivation: `description` field from the Gamma API `/events` response.
117
+
118
+ * `category`
119
+ * Definition: the Polymarket-assigned category for the event.
120
+ * Examples: `"Politics"`, `"Crypto"`, `"Sports"`, `"Pop Culture"`, `"Science"`
121
+ * Derivation: `category` field from the Gamma API `/events` response.
122
+
123
+ * `event_status`
124
+ * Definition: the current lifecycle status of the event.
125
+ * Examples: `"active"`, `"closed"`, `"archived"`
126
+ * Derivation: computed from the `active`, `closed`, and `archived` boolean fields in the API response. Priority: archived > closed > active.
127
+
128
+ * `slug`
129
+ * Definition: URL slug for the event on Polymarket.
130
+ * Examples: `"presidential-election-winner-2024"`, `"will-bitcoin-hit-100k"`
131
+ * Derivation: `slug` field from the Gamma API `/events` response.
132
+
133
+ * `url`
134
+ * Definition: full URL to the event page on Polymarket.
135
+ * Examples: `"https://polymarket.com/event/presidential-election-winner-2024"`
136
+ * Derivation: constructed as `https://polymarket.com/event/{slug}`.
137
+
138
+ * `has_tag`
139
+ * Definition: a categorization tag associated with the event. One atom per tag.
140
+ * Examples: `"Elections"`, `"Bitcoin"`, `"NBA"`, `"AI"`
141
+ * Derivation: each entry in the `tags` array from the Gamma API response (using the `label` field). LLM-extracted event categories are also added as tags.
142
+
143
+ #### Market Statistics (source: structured Gamma API data)
144
+
145
+ * `event_volume`
146
+ * Definition: total all-time trading volume for the event across all its markets.
147
+ * Examples: `50000000.0`, `1234567.0`
148
+ * Derivation: `volume` field from the Gamma API `/events` response. Unit: USD.
149
+
150
+ * `event_volume_24h`
151
+ * Definition: trading volume in the last 24 hours for the event.
152
+ * Derivation: `volume24hr` field from the Gamma API `/events` response. Unit: USD.
153
+
154
+ * `event_liquidity`
155
+ * Definition: current total liquidity available across the event's markets.
156
+ * Derivation: `liquidity` field from the Gamma API `/events` response. Unit: USD.
157
+
158
+ * `event_open_interest`
159
+ * Definition: total open interest (outstanding positions) across the event's markets.
160
+ * Derivation: `openInterest` field from the Gamma API `/events` response. Unit: USD.
161
+
162
+ #### Sentiment (source: LLM extraction)
163
+
164
+ * `sentiment`
165
+ * Definition: overall financial sentiment of the prediction market topic on a scale from -1.0 (strongly negative) to +1.0 (strongly positive).
166
+ * Examples: `0.5` (slightly positive), `-1.0` (strongly negative), `0.0` (neutral)
167
+ * Derivation: LLM classification from the composed event text (title, description, market questions, category, tags).
168
+ * Note: carries a `reasoning` attribute with the LLM's justification. Only set when the LLM has not previously extracted this event (or when the title/description has changed).
169
+
170
+ ---
171
+
172
+ ### Prediction Market Properties
173
+
174
+ #### Identity (source: structured Gamma API data)
175
+
176
+ * `polymarket_id`
177
+ * Definition: the unique Polymarket identifier for this market.
178
+ * Derivation: `id` field from each entry in the `markets` array of the Gamma API `/events` response. Also serves as the entity's strong ID.
179
+
180
+ * `question`
181
+ * Definition: the market question being predicted.
182
+ * Examples: `"Will Donald Trump win the 2024 Presidential Election?"`, `"Bitcoin above $100,000 on March 31?"`
183
+ * Derivation: `question` field from the market object in the API response.
184
+
185
+ * `outcomes`
186
+ * Definition: the possible outcomes for the market, as a comma-separated string.
187
+ * Examples: `"Yes, No"`, `"Trump, Biden, Other"`
188
+ * Derivation: `outcomes` field from the market object (JSON-encoded string from the API).
189
+
190
+ * `outcome_prices`
191
+ * Definition: current probability prices for each outcome, as a comma-separated string. Values sum to approximately 1.0.
192
+ * Examples: `"0.65, 0.35"`, `"0.48, 0.42, 0.10"`
193
+ * Derivation: `outcomePrices` field from the market object (JSON-encoded string from the API).
194
+
195
+ * `market_status`
196
+ * Definition: current status of the market.
197
+ * Examples: `"active"`, `"closed"`
198
+ * Derivation: computed from `active` and `closed` boolean fields. Priority: closed > active.
199
+
200
+ #### Trading Data (source: structured Gamma API data)
201
+
202
+ * `market_volume`
203
+ * Definition: total all-time trading volume for this market.
204
+ * Derivation: `volumeNum` field from the market object. Unit: USD.
205
+
206
+ * `market_volume_24h`
207
+ * Definition: trading volume in the last 24 hours.
208
+ * Derivation: `volume24hr` field from the market object. Unit: USD.
209
+
210
+ * `market_liquidity`
211
+ * Definition: current liquidity available in this market.
212
+ * Derivation: `liquidityNum` field from the market object. Unit: USD.
213
+
214
+ * `best_bid`
215
+ * Definition: highest current bid price (probability) for the "Yes" outcome.
216
+ * Examples: `0.62`, `0.05`
217
+ * Derivation: `bestBid` field from the market object. Range: 0.0 to 1.0.
218
+
219
+ * `best_ask`
220
+ * Definition: lowest current ask price (probability) for the "Yes" outcome.
221
+ * Examples: `0.65`, `0.08`
222
+ * Derivation: `bestAsk` field from the market object. Range: 0.0 to 1.0.
223
+
224
+ * `last_trade_price`
225
+ * Definition: price of the most recent trade in this market.
226
+ * Examples: `0.63`, `0.50`
227
+ * Derivation: `lastTradePrice` field from the market object. Range: 0.0 to 1.0.
228
+
229
+ * `spread`
230
+ * Definition: bid-ask spread for this market.
231
+ * Examples: `0.03`, `0.01`
232
+ * Derivation: `spread` field from the market object.
233
+
234
+ #### Sports and Grouped Markets (source: structured Gamma API data)
235
+
236
+ * `sports_market_type`
237
+ * Definition: type classification for sports-related markets.
238
+ * Examples: `"spread"`, `"total"`, `"moneyline"`
239
+ * Derivation: `sportsMarketType` field from the market object. Only present on sports markets.
240
+
241
+ * `line`
242
+ * Definition: the betting line for the market (spread value or over/under total).
243
+ * Examples: `-1.5` (spread), `6.5` (over/under), `220.5` (point total)
244
+ * Derivation: `line` field from the market object. Only emitted when non-zero.
245
+
246
+ * `group_item_threshold`
247
+ * Definition: threshold value for grouped market items such as price targets or stat lines.
248
+ * Examples: `"$100,000"`, `"250"`, `"3.5"`
249
+ * Derivation: `groupItemThreshold` field from the market object. Only present on grouped markets.
250
+
251
+ ---
252
+
253
+ ### Prediction Series Properties
254
+
255
+ All properties sourced from structured Gamma API data via the `/series` endpoint.
256
+
257
+ * `polymarket_id`
258
+ * Definition: the unique Polymarket identifier for this series.
259
+ * Derivation: `id` field from the Gamma API `/series` response. Also serves as the entity's strong ID.
260
+
261
+ * `series_title`
262
+ * Definition: title of the prediction series.
263
+ * Examples: `"Weekly Bitcoin Price"`, `"Daily Weather Markets"`
264
+ * Derivation: `title` field from the API response.
265
+
266
+ * `series_type`
267
+ * Definition: type classification of the series.
268
+ * Derivation: `seriesType` field from the API response.
269
+
270
+ * `series_recurrence`
271
+ * Definition: recurrence pattern of the series.
272
+ * Examples: `"daily"`, `"weekly"`
273
+ * Derivation: `recurrence` field from the API response.
274
+
275
+ * `series_status`
276
+ * Definition: current status of the series.
277
+ * Examples: `"active"`, `"closed"`, `"archived"`
278
+ * Derivation: computed from `active`, `closed`, and `archived` boolean fields. Priority: archived > closed > active.
279
+
280
+ * `slug`
281
+ * Definition: URL slug for the series on Polymarket.
282
+ * Derivation: `slug` field from the API response.
283
+
284
+ * `series_volume`
285
+ * Definition: total all-time trading volume across all events in the series.
286
+ * Derivation: `volume` field from the API response. Unit: USD.
287
+
288
+ * `series_volume_24h`
289
+ * Definition: 24-hour trading volume across all events in the series.
290
+ * Derivation: `volume24hr` field from the API response. Unit: USD.
291
+
292
+ * `series_liquidity`
293
+ * Definition: current liquidity across all events in the series.
294
+ * Derivation: `liquidity` field from the API response. Unit: USD.
295
+
296
+ ---
297
+
298
+ ### LLM-Extracted Entity Properties
299
+
300
+ These properties are set on LLM-extracted entities (`person`, `organization`, `location`, `financial_instrument`, `product`, `competition`, `conflict`).
301
+
302
+ * `entity_sentiment`
303
+ * Definition: financial sentiment for a specific entity in the context of the prediction market, from -1.0 (strongly negative) to +1.0 (strongly positive).
304
+ * Examples: `0.5` (the market implies favorable conditions for the entity)
305
+ * Derivation: LLM per-entity sentiment scoring from event text.
306
+ * Note: also carried as a `sentiment` attribute on the entity's `appears_in` atom.
307
+
308
+ ---
309
+
310
+ ### Event Properties
311
+
312
+ Event entities use the shared `event` flavor and carry standard event properties from the common schema.
313
+
314
+ * `category`
315
+ * Definition: the type of predicted event.
316
+ * Examples: `"Election outcome"`, `"IPO"`, `"Mergers & acquisitions"`, `"Geopolitical event"`, `"Sports outcome"`
317
+ * Derivation: LLM event category classification from event text.
318
+
319
+ * `likelihood`
320
+ * Definition: LLM-assessed likelihood of the event occurring.
321
+ * Derivation: LLM classification from event text.
322
+
323
+ * `date`
324
+ * Definition: expected date of the event, if determinable.
325
+ * Derivation: LLM extraction from event text.
326
+
327
+ * `description`
328
+ * Definition: brief description of the predicted event.
329
+ * Derivation: LLM extraction from event text.
330
+
331
+ * `participant`
332
+ * Definition: link from the event to an entity involved in it.
333
+ * Target flavors: `person`, `organization`, `location`, `financial_instrument`, `product`, `competition`, `conflict`
334
+ * Derivation: LLM extraction of event participants. Each participant carries `role` and `sentiment` attributes.
335
+
336
+ ---
337
+
338
+ ## Entity Relationships
339
+
340
+ ```
341
+ person/org/location/... ──[appears_in]──────────→ prediction_event (LLM-extracted entity appears in event)
342
+ person/org/location/... ──[appears_in]──────────→ prediction_market (entity name-matched to market question)
343
+ prediction_event ──[has_market]──────────→ prediction_market (event contains market)
344
+ prediction_event ──[belongs_to_series]───→ prediction_series (event is part of a series)
345
+ event ──[appears_in]──────────→ prediction_event (extracted event linked to prediction event)
346
+ event ──[participant]──────────→ person/org/location/... (event involves entity)
347
+ person ──[head_of]─────────────→ organization, location
348
+ person ──[works_at]────────────→ organization
349
+ person/org ──[invests_in]──────────→ organization, financial_instrument
350
+ person/org/location ──[competes_with]───────→ person, organization, location
351
+ person/org ──[competes_in]─────────→ competition
352
+ person/org/conflict ──[is_located_at]───────→ location
353
+ organization ──[acquires]────────────→ organization
354
+ person/org ──[partnered_with]──────→ person, organization
355
+ person/org ──[owns]────────────────→ organization, financial_instrument, product
356
+ organization ──[produces]────────────→ product
357
+ person/org/location ──[involved_in]─────────→ conflict
358
+ ```
359
+
360
+ The first four relationships are atomized from structured API data. All others are LLM-extracted from event text and constrained by the schema's domain/target flavor rules.
361
+
362
+ ---
363
+
364
+ ## Attributes
365
+
366
+ ### `appears_in` attributes
367
+
368
+ Carried on `appears_in` atoms linking LLM-extracted entities to `prediction_event` entities:
369
+
370
+ * `event_id` (string): the Polymarket event ID
371
+ * `sentiment` (float): entity-level sentiment in the context of this prediction event, from -1.0 to +1.0
372
+
373
+ ### `sentiment` attributes
374
+
375
+ Carried on document-level `sentiment` atoms on `prediction_event` entities:
376
+
377
+ * `reasoning` (string): the LLM's justification for the sentiment score
378
+
379
+ ### `participant` attributes
380
+
381
+ Carried on `participant` atoms linking `event` entities to their participants:
382
+
383
+ * `role` (string): the participant's role in the event
384
+ * `sentiment` (float): sentiment toward the participant in the event context