/exchange returns an exchange called "INDEX" #55

Closed
opened 2026-04-03 16:46:00 +00:00 by fabioth · 4 comments
fabioth commented 2026-04-03 16:46:00 +00:00 (Migrated from gitlab.esvedra.one)
No description provided.
fabioth commented 2026-04-03 16:46:01 +00:00 (Migrated from gitlab.esvedra.one)

assigned to @gertjan

assigned to @gertjan
fabioth commented 2026-04-03 16:46:19 +00:00 (Migrated from gitlab.esvedra.one)

changed title from /exchange returns a exchange called "INDEX" to /exchange returns an exchange called "INDEX"

<p>changed title from <code class="idiff">/exchange returns a exchange called &quot;INDEX&quot;</code> to <code class="idiff">/exchange returns a<span class="idiff left right addition">n</span> exchange called &quot;INDEX&quot;</code></p>
gertjan commented 2026-04-04 12:53:15 +00:00 (Migrated from gitlab.esvedra.one)

❯ apparently the /assets/exchange endpoint returns an exchange called "INDEX". can you help me figure out what that is and why it's in there?

Searched for 4 patterns, read 1 file (ctrl+o to expand)

⏺️ Now let me check the Asset model and how exchange is populated, particularly for indexes:

Searched for 1 pattern (ctrl+o to expand)

⏺️ There it is. The Index model (src/models/assets.py:142) hard-codes exchange: str = "INDEX" as a default. So any market index asset (S&P 500, etc.) stored in MongoDB will have exchange =
"INDEX", and since get_exchanges() just does a distinct() on the exchange field across all active assets, it surfaces in the list.

It's not a real exchange — it's a sentinel value used to distinguish index assets. Whether that's intentional or an artifact worth cleaning up is up to you.

> ❯ apparently the /assets/exchange endpoint returns an exchange called "INDEX". can you help me figure out what that is and why it's in there? > > Searched for 4 patterns, read 1 file (ctrl+o to expand) > > :record_button: Now let me check the Asset model and how exchange is populated, particularly for indexes: > > Searched for 1 pattern (ctrl+o to expand) > > :record_button: There it is. The Index model (src/models/assets.py:142) hard-codes exchange: str = "INDEX" as a default. So any market index asset (S&P 500, etc.) stored in MongoDB will have exchange =\ > "INDEX", and since get_exchanges() just does a distinct() on the exchange field across all active assets, it surfaces in the list. > > It's not a real exchange — it's a sentinel value used to distinguish index assets. Whether that's intentional or an artifact worth cleaning up is up to you.
gertjan (Migrated from gitlab.esvedra.one) closed this issue 2026-04-09 15:10:26 +00:00
gertjan commented 2026-04-09 15:10:27 +00:00 (Migrated from gitlab.esvedra.one)
Fixed in https://gitlab.esvedra.one/gertjan/bodega/-/commit/a04901eb3118ad319e604c7acf67d80ae74baf6c
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
gertjan/bodega#55
No description provided.