Open interest storage #42

Open
ntorres wants to merge 1 commits from max_pain_storage into max_pain_chart
Collaborator

storage.nativedb implemetation to store open interest data, used for max pain calculations (deribit)

# Define the structured dtype
dtype = np.dtype([
    ('time', int),
    ('oi', float),
    ('oi_calc', float),
])

# Parquet filename
col_sym_key = f'btc-{expiry_date.lower()}-{strike_price}-{option_type}'

So far this script appends the last row on each update for the instruments on separate files for a specifics expiry_date

Add write_oi() and _write_oi() interface and impl for writting in parquet the oi struct in storage.nativedb, also add mk_oi_shm_keyed_filepath() for managing shm file.

`storage.nativedb` implemetation to store open interest data, used for max pain calculations (deribit) # Define the structured dtype dtype = np.dtype([ ('time', int), ('oi', float), ('oi_calc', float), ]) # Parquet filename col_sym_key = f'btc-{expiry_date.lower()}-{strike_price}-{option_type}' So far this script appends the last row on each update for the instruments on separate files for a specifics expiry_date Add `write_oi()` and `_write_oi()` interface and impl for writting in parquet the oi struct in `storage.nativedb`, also add `mk_oi_shm_keyed_filepath()` for managing shm file.
ntorres added 1 commit 2025-03-05 00:20:28 +00:00
8f1e082c91 Add write_oi for open interest
In storage.nativedb mod is manage the write_parquet file, this is
a rudimentary way to write on file using parquet, meant just for
development purpose.

Add comments in max_pain to track the changes.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b max_pain_storage max_pain_chart
git pull origin max_pain_storage

Step 2:

Merge the changes and update on Gitea.
git checkout max_pain_chart
git merge --no-ff max_pain_storage
git push origin max_pain_chart
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
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: pikers/piker#42
There is no content yet.