Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support changes of options snapshots and chain #446

Merged
merged 3 commits into from
Apr 26, 2024

Conversation

hiohiohio
Copy link
Contributor

Incompatible changes:

  • get_option_snapshot returns OptionsSnapshot instead of Snapshot
  • get_option_chain returns OptionsSnapshot instead of Snapshot

Context:

  • the options snapshot and options chain API endpoints returns options greeks and implied volatility
  • the options chain api endpoint accept new parameters to filter options contracts
  • this PR support those changes of api endpoints

Changes:

Copy link
Contributor

@gnvk gnvk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @hiohiohio !

@hiohiohio hiohiohio merged commit eae556d into master Apr 26, 2024
12 checks passed
@hiohiohio hiohiohio deleted the support-changes-of-options-snapshots-and-chain branch April 26, 2024 08:11
@@ -39,6 +39,8 @@
"minuteBar": "minute_bar",
"dailyBar": "daily_bar",
"prevDailyBar": "previous_daily_bar",
"impliedVolatility": "implied_volatility",
"greeks": "greeks",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hiohiohio "greeks": "greeks" doesn't look right. It's mapping to itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@impredicative thank you for the comment.
Yeah, it looks a confusing but. We are using this SNAPSHOT_MAPPING in the below [1] to create mapped_snapshot dict to convert raw_data dict into an object. Since we do not pass raw_data into an initializer of an object but mapped_snapshot only, we need to map required fields into mapped_snapshot dict.

*1

mapped_snapshot = {
SNAPSHOT_MAPPING.get(key): val
for key, val in raw_data.items()
if key in SNAPSHOT_MAPPING
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants