Skip to content

feat: raw mode preserve original formats#49

Open
alexandretrotel wants to merge 9 commits intopmxt-dev:mainfrom
alexandretrotel:feat/raw-mode-preserve-original-formats
Open

feat: raw mode preserve original formats#49
alexandretrotel wants to merge 9 commits intopmxt-dev:mainfrom
alexandretrotel:feat/raw-mode-preserve-original-formats

Conversation

@alexandretrotel
Copy link

The goal if this PR is to add a raw mode that allows to skip price normalization if user wants the raw data from the original exchange.

For this, I've made the following changes.

Changes

  • Added mode request option support (normalized by default, and raw as an opt-in).
  • Implemented raw mode behavior across exchanges where price normalization was happening:
    • Kalshi
    • Myriad
    • Baozi
  • Also, I've added exchange-specific price helper modules and reused them to reduce duplicated conversion logic. (it's a bit out of the scope but felt it was necessary).
  • Updated TypeScript & Python SDK.
  • Added tests for new helpers.
  • Slightly, updated docs and migration material to explain raw mode usage.

Refactor

I've also refactored some code as noted above. Here are the main changes. Of course, not everything here is really needed specifically for this issue but helps making the codebase better over the long term.

  • Centralized raw/normalized conversion rules in helper files instead of repeated inline math.
  • Standardized optional-argument handling when appending request options.
  • Improved Python typing in new raw-mode code paths (reduced Any, explicit datetime handling, etc).

Test

I've updated tests too but I need API keys for proper testing, I guess the CI will ensure proper testing and I might fix some code if it doesn't pass.

  • Kalshi/Myriad/Baozi price helpers
  • TypeScript SDK args helper
  • Python SDK raw-mode args

@realfishsam
Copy link
Contributor

I'll review asap.

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.

2 participants