Skip to content

Commit

Permalink
add deribit provider and make some small changes to the standard mode…
Browse files Browse the repository at this point in the history
…l to allow for fractional volume and size
  • Loading branch information
deeleeramone committed Dec 7, 2024
1 parent bed3aa0 commit 7642c1d
Show file tree
Hide file tree
Showing 20 changed files with 2,819 additions and 108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
)
from typing import List, Union

from pydantic import Field, field_validator

from openbb_core.provider.abstract.query_params import QueryParams
from openbb_core.provider.utils.descriptions import (
DATA_DESCRIPTIONS,
QUERY_DESCRIPTIONS,
)
from openbb_core.provider.utils.options_chains_properties import OptionsChainsProperties
from pydantic import Field, field_validator


class OptionsChainsQueryParams(QueryParams):
Expand Down Expand Up @@ -151,10 +150,13 @@ class OptionsChainsData(OptionsChainsProperties):
json_schema_extra={"x-unit_measurement": "currency"},
)
option_type: List[str] = Field(description="Call or Put.")
open_interest: List[Union[int, None]] = Field(
contract_size: List[Union[int, float, None]] = Field(
default_factory=list, description="Number of underlying units per contract."
)
open_interest: List[Union[int, float, None]] = Field(
default_factory=list, description="Open interest on the contract."
)
volume: List[Union[int, None]] = Field(
volume: List[Union[int, float, None]] = Field(
default_factory=list, description=DATA_DESCRIPTIONS.get("volume", "")
)
theoretical_price: List[Union[float, None]] = Field(
Expand All @@ -167,7 +169,7 @@ class OptionsChainsData(OptionsChainsProperties):
description="Last trade price of the option.",
json_schema_extra={"x-unit_measurement": "currency"},
)
last_trade_size: List[Union[int, None]] = Field(
last_trade_size: List[Union[int, float, None]] = Field(
default_factory=list, description="Last trade size of the option."
)
last_trade_time: List[Union[datetime, None]] = Field(
Expand All @@ -183,7 +185,7 @@ class OptionsChainsData(OptionsChainsProperties):
description="Current bid price for the option.",
json_schema_extra={"x-unit_measurement": "currency"},
)
bid_size: List[Union[int, None]] = Field(
bid_size: List[Union[int, float, None]] = Field(
default_factory=list, description="Bid size for the option."
)
bid_time: List[Union[datetime, None]] = Field(
Expand All @@ -198,7 +200,7 @@ class OptionsChainsData(OptionsChainsProperties):
description="Current ask price for the option.",
json_schema_extra={"x-unit_measurement": "currency"},
)
ask_size: List[Union[int, None]] = Field(
ask_size: List[Union[int, float, None]] = Field(
default_factory=list, description="Ask size for the option."
)
ask_time: List[Union[datetime, None]] = Field(
Expand Down Expand Up @@ -263,7 +265,7 @@ class OptionsChainsData(OptionsChainsProperties):
description=DATA_DESCRIPTIONS.get("close", ""),
json_schema_extra={"x-unit_measurement": "currency"},
)
close_size: List[Union[int, None]] = Field(
close_size: List[Union[int, float, None]] = Field(
default_factory=list,
description="The closing trade size for the option that day.",
)
Expand All @@ -276,7 +278,7 @@ class OptionsChainsData(OptionsChainsProperties):
description="The closing bid price for the option that day.",
json_schema_extra={"x-unit_measurement": "currency"},
)
close_bid_size: List[Union[int, None]] = Field(
close_bid_size: List[Union[int, float, None]] = Field(
default_factory=list,
description="The closing bid size for the option that day.",
)
Expand All @@ -288,7 +290,7 @@ class OptionsChainsData(OptionsChainsProperties):
default_factory=list,
description="The closing ask price for the option that day.",
)
close_ask_size: List[Union[int, None]] = Field(
close_ask_size: List[Union[int, float, None]] = Field(
default_factory=list,
description="The closing ask size for the option that day.",
)
Expand Down
Loading

0 comments on commit 7642c1d

Please sign in to comment.