diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index a7f612e..2fb89a5 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -3,6 +3,7 @@ docs/Account.md docs/AccountApi.md docs/AccountApiKeys.md docs/AccountAsset.md +docs/AccountBinaryOptionsPosition.md docs/AccountLimits.md docs/AccountMetadata.md docs/AccountMetadatas.md @@ -195,6 +196,7 @@ lighter/models/__init__.py lighter/models/account.py lighter/models/account_api_keys.py lighter/models/account_asset.py +lighter/models/account_binary_options_position.py lighter/models/account_limits.py lighter/models/account_metadata.py lighter/models/account_metadatas.py diff --git a/README.md b/README.md index c409005..1239094 100644 --- a/README.md +++ b/README.md @@ -150,6 +150,7 @@ Class | Method | HTTP request | Description - [Account](docs/Account.md) + - [AccountBinaryOptionsPosition](docs/AccountBinaryOptionsPosition.md) - [AccountApiKeys](docs/AccountApiKeys.md) - [AccountAsset](docs/AccountAsset.md) - [AccountLimits](docs/AccountLimits.md) diff --git a/docs/AccountBinaryOptionsPosition.md b/docs/AccountBinaryOptionsPosition.md new file mode 100644 index 0000000..b433d25 --- /dev/null +++ b/docs/AccountBinaryOptionsPosition.md @@ -0,0 +1,33 @@ +# AccountBinaryOptionsPosition + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**market_id** | **int** | | +**entry_quote** | **str** | | +**avg_entry_price** | **str** | average price paid for the held outcome (YES price for sign 1, NO price for sign -1) | +**sign** | **int** | 1 holds the YES outcome, -1 holds the NO outcome | +**size** | **str** | magnitude only; combine with sign | + +## Example + +```python +from lighter.models.account_binary_options_position import AccountBinaryOptionsPosition + +# TODO update the JSON string below +json = "{}" +# create an instance of AccountBinaryOptionsPosition from a JSON string +account_binary_options_position_instance = AccountBinaryOptionsPosition.from_json(json) +# print the JSON string representation of the object +print(AccountBinaryOptionsPosition.to_json()) + +# convert the object into a dict +account_binary_options_position_dict = account_binary_options_position_instance.to_dict() +# create an instance of AccountBinaryOptionsPosition from a dict +account_binary_options_position_from_dict = AccountBinaryOptionsPosition.from_dict(account_binary_options_position_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DetailedAccount.md b/docs/DetailedAccount.md index 7d6275a..97667a0 100644 --- a/docs/DetailedAccount.md +++ b/docs/DetailedAccount.md @@ -39,6 +39,7 @@ Name | Type | Description | Notes **can_rfq_market_ids** | **List[str]** | | **metadata** | [**SubAccountMetadata**](SubAccountMetadata.md) | | **agent_enabled** | **bool** | | +**bo_positions** | [**List[AccountBinaryOptionsPosition]**](AccountBinaryOptionsPosition.md) | | [optional] ## Example diff --git a/docs/EventOrderBookEntry.md b/docs/EventOrderBookEntry.md index 2e76566..ffc8132 100644 --- a/docs/EventOrderBookEntry.md +++ b/docs/EventOrderBookEntry.md @@ -7,7 +7,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **symbol** | **str** | | **market_id** | **int** | | -**market_slot_id** | **int** | internal only: the reusable tree slot backing this market; never serialized, users only know market_id (the public market index) | **market_type** | **str** | | **base_asset_id** | **int** | | **quote_asset_id** | **int** | | diff --git a/docs/Order.md b/docs/Order.md index f1276d5..89e1ac0 100644 --- a/docs/Order.md +++ b/docs/Order.md @@ -44,6 +44,8 @@ Name | Type | Description | Notes **integrator_taker_fee** | **str** | | **order_flags** | **int** | | **order_version** | **int** | | +**market_symbol** | **str** | | +**market_kind** | **str** | | ## Example diff --git a/docs/OrderBook.md b/docs/OrderBook.md index cb88ca0..ab58f94 100644 --- a/docs/OrderBook.md +++ b/docs/OrderBook.md @@ -24,6 +24,16 @@ Name | Type | Description | Notes **is_taker_fee_enabled** | **bool** | | **created_at** | **str** | | **multiplier** | **str** | | +**start_timestamp** | **int** | | +**end_timestamp** | **int** | | +**settlement_type** | **int** | | +**settlement_price** | **int** | | +**settlement_cap** | **int** | | +**outcome** | **int** | | +**default_price** | **int** | | +**operator_account_index** | **int** | | +**is_frozen** | **bool** | | +**open_interest** | **str** | | ## Example diff --git a/docs/PerpsOrderBookDetail.md b/docs/PerpsOrderBookDetail.md index c9f6d56..074431b 100644 --- a/docs/PerpsOrderBookDetail.md +++ b/docs/PerpsOrderBookDetail.md @@ -49,6 +49,15 @@ Name | Type | Description | Notes **multiplier** | **str** | | **market_flags** | **int** | | **funding_premium_multiplier** | **int** | | +**start_timestamp** | **int** | | +**end_timestamp** | **int** | | +**settlement_type** | **int** | | +**settlement_price** | **int** | | +**settlement_cap** | **int** | | +**outcome** | **int** | | +**default_price** | **int** | | +**operator_account_index** | **int** | | +**is_frozen** | **bool** | | ## Example diff --git a/docs/SpotOrderBookDetail.md b/docs/SpotOrderBookDetail.md index cde90fe..8421cac 100644 --- a/docs/SpotOrderBookDetail.md +++ b/docs/SpotOrderBookDetail.md @@ -34,6 +34,16 @@ Name | Type | Description | Notes **is_taker_fee_enabled** | **bool** | | **created_at** | **str** | | **multiplier** | **str** | | +**start_timestamp** | **int** | | +**end_timestamp** | **int** | | +**settlement_type** | **int** | | +**settlement_price** | **int** | | +**settlement_cap** | **int** | | +**outcome** | **int** | | +**default_price** | **int** | | +**operator_account_index** | **int** | | +**is_frozen** | **bool** | | +**open_interest** | **str** | | ## Example diff --git a/docs/Trade.md b/docs/Trade.md index 0ba4aab..6f98e09 100644 --- a/docs/Trade.md +++ b/docs/Trade.md @@ -49,6 +49,8 @@ Name | Type | Description | Notes **maker_allocated_margin_usdc_after** | **int** | | **bid_order_version** | **int** | | **ask_order_version** | **int** | | +**market_symbol** | **str** | | +**market_kind** | **str** | | ## Example diff --git a/docs/UpDownCandle.md b/docs/UpDownCandle.md index 769f894..b05295d 100644 --- a/docs/UpDownCandle.md +++ b/docs/UpDownCandle.md @@ -13,7 +13,6 @@ Name | Type | Description | Notes **high** | **str** | | **low** | **str** | | **close** | **str** | | -**sample_count** | **int** | observations in the candle: orders live updates of the same bucket, not served | **provider** | **str** | provider feed of the last observation of the candle | **feed_id** | **str** | | diff --git a/lighter/__init__.py b/lighter/__init__.py index ab53d4d..6c1229e 100644 --- a/lighter/__init__.py +++ b/lighter/__init__.py @@ -48,6 +48,7 @@ # import models into sdk package from lighter.models.account import Account +from lighter.models.account_binary_options_position import AccountBinaryOptionsPosition from lighter.models.account_api_keys import AccountApiKeys from lighter.models.account_asset import AccountAsset from lighter.models.account_limits import AccountLimits diff --git a/lighter/api/order_api.py b/lighter/api/order_api.py index aa8e530..ef51c3f 100644 --- a/lighter/api/order_api.py +++ b/lighter/api/order_api.py @@ -2771,10 +2771,6 @@ def _export_historical_trades_serialize( # process the path parameters # process the query parameters - if authorization is not None: - - _query_params.append(('authorization', authorization)) - if auth is not None: _query_params.append(('auth', auth)) @@ -2788,6 +2784,8 @@ def _export_historical_trades_serialize( _query_params.append(('date', var_date)) # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization # process the form parameters # process the body parameter diff --git a/lighter/api/portfolio_api.py b/lighter/api/portfolio_api.py index 967d5d1..0b661d9 100644 --- a/lighter/api/portfolio_api.py +++ b/lighter/api/portfolio_api.py @@ -324,10 +324,6 @@ def _portfolio_bo_pnl_serialize( # process the path parameters # process the query parameters - if authorization is not None: - - _query_params.append(('authorization', authorization)) - if auth is not None: _query_params.append(('auth', auth)) @@ -349,6 +345,8 @@ def _portfolio_bo_pnl_serialize( _query_params.append(('limit', limit)) # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization # process the form parameters # process the body parameter diff --git a/lighter/models/__init__.py b/lighter/models/__init__.py index 979d0cb..0ef66c4 100644 --- a/lighter/models/__init__.py +++ b/lighter/models/__init__.py @@ -15,6 +15,7 @@ # import models into model package from lighter.models.account import Account +from lighter.models.account_binary_options_position import AccountBinaryOptionsPosition from lighter.models.account_api_keys import AccountApiKeys from lighter.models.account_asset import AccountAsset from lighter.models.account_limits import AccountLimits diff --git a/lighter/models/account_binary_options_position.py b/lighter/models/account_binary_options_position.py new file mode 100644 index 0000000..6878ca0 --- /dev/null +++ b/lighter/models/account_binary_options_position.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class AccountBinaryOptionsPosition(BaseModel): + """ + AccountBinaryOptionsPosition + """ # noqa: E501 + market_id: StrictInt + entry_quote: StrictStr + avg_entry_price: StrictStr = Field(description=" average price paid for the held outcome (YES price for sign 1, NO price for sign -1)") + sign: StrictInt = Field(description=" 1 holds the YES outcome, -1 holds the NO outcome") + size: StrictStr = Field(description=" magnitude only; combine with sign") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["market_id", "entry_quote", "avg_entry_price", "sign", "size"] + + @field_validator('sign') + def sign_validate_enum(cls, value): + """Validates the enum""" + if value not in set([-1, 1]): + raise ValueError("must be one of enum values (-1, 1)") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AccountBinaryOptionsPosition from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AccountBinaryOptionsPosition from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "market_id": obj.get("market_id"), + "entry_quote": obj.get("entry_quote"), + "avg_entry_price": obj.get("avg_entry_price"), + "sign": obj.get("sign"), + "size": obj.get("size") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/bo_outcome_pn_l.py b/lighter/models/bo_outcome_pn_l.py index f68af83..230da3c 100644 --- a/lighter/models/bo_outcome_pn_l.py +++ b/lighter/models/bo_outcome_pn_l.py @@ -18,7 +18,7 @@ import json from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List +from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -30,7 +30,7 @@ class BoOutcomePnL(BaseModel): symbol: StrictStr outcome: StrictInt end_timestamp: StrictInt - settlement_pnl: StrictStr + settlement_pnl: Optional[StrictStr] last_trade_id: StrictInt total_pnl: StrictStr additional_properties: Dict[str, Any] = {} @@ -89,6 +89,11 @@ def to_dict(self) -> Dict[str, Any]: for _key, _value in self.additional_properties.items(): _dict[_key] = _value + # set to None if settlement_pnl (nullable) is None + # and model_fields_set contains the field + if self.settlement_pnl is None and "settlement_pnl" in self.model_fields_set: + _dict['settlement_pnl'] = None + return _dict @classmethod diff --git a/lighter/models/detailed_account.py b/lighter/models/detailed_account.py index 7a0fea5..f21d02f 100644 --- a/lighter/models/detailed_account.py +++ b/lighter/models/detailed_account.py @@ -20,6 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from lighter.models.account_asset import AccountAsset +from lighter.models.account_binary_options_position import AccountBinaryOptionsPosition from lighter.models.account_position import AccountPosition from lighter.models.approved_integrator import ApprovedIntegrator from lighter.models.pending_unlock import PendingUnlock @@ -67,8 +68,9 @@ class DetailedAccount(BaseModel): can_rfq_market_ids: List[StrictStr] metadata: SubAccountMetadata agent_enabled: StrictBool + bo_positions: Optional[List[AccountBinaryOptionsPosition]] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "account_type", "account_trading_mode", "index", "l1_address", "cancel_all_time", "total_order_count", "total_isolated_order_count", "pending_order_count", "available_balance", "status", "collateral", "account_index", "name", "description", "can_invite", "referral_points_percentage", "positions", "assets", "total_asset_value", "cross_asset_value", "pool_info", "shares", "created_at", "transaction_time", "pending_unlocks", "approved_integrators", "can_rfq", "cross_initial_margin_requirement", "cross_maintenance_margin_requirement", "can_rfq_market_ids", "metadata", "agent_enabled"] + __properties: ClassVar[List[str]] = ["code", "message", "account_type", "account_trading_mode", "index", "l1_address", "cancel_all_time", "total_order_count", "total_isolated_order_count", "pending_order_count", "available_balance", "status", "collateral", "account_index", "name", "description", "can_invite", "referral_points_percentage", "positions", "assets", "total_asset_value", "cross_asset_value", "pool_info", "shares", "created_at", "transaction_time", "pending_unlocks", "approved_integrators", "can_rfq", "cross_initial_margin_requirement", "cross_maintenance_margin_requirement", "can_rfq_market_ids", "metadata", "agent_enabled", "bo_positions"] model_config = ConfigDict( populate_by_name=True, @@ -152,6 +154,13 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: _dict['metadata'] = self.metadata.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in bo_positions (list) + _items = [] + if self.bo_positions: + for _item in self.bo_positions: + if _item: + _items.append(_item.to_dict()) + _dict['bo_positions'] = _items # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -202,7 +211,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "cross_maintenance_margin_requirement": obj.get("cross_maintenance_margin_requirement"), "can_rfq_market_ids": obj.get("can_rfq_market_ids"), "metadata": SubAccountMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "agent_enabled": obj.get("agent_enabled") + "agent_enabled": obj.get("agent_enabled"), + "bo_positions": [AccountBinaryOptionsPosition.from_dict(_item) for _item in obj["bo_positions"]] if obj.get("bo_positions") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/event_order_book_entry.py b/lighter/models/event_order_book_entry.py index cc60a4c..4380960 100644 --- a/lighter/models/event_order_book_entry.py +++ b/lighter/models/event_order_book_entry.py @@ -29,7 +29,6 @@ class EventOrderBookEntry(BaseModel): """ # noqa: E501 symbol: StrictStr market_id: StrictInt - market_slot_id: StrictInt = Field(description=" internal only: the reusable tree slot backing this market; never serialized, users only know market_id (the public market index)", alias="marketSlotId") market_type: StrictStr base_asset_id: StrictInt quote_asset_id: StrictInt @@ -61,7 +60,7 @@ class EventOrderBookEntry(BaseModel): price_decimals: StrictInt stats: BinaryOptionMarketStats additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["symbol", "market_id", "marketSlotId", "market_type", "base_asset_id", "quote_asset_id", "status", "taker_fee", "is_taker_fee_enabled", "maker_fee", "is_maker_fee_enabled", "liquidation_fee", "min_base_amount", "min_quote_amount", "order_quote_limit", "supported_size_decimals", "supported_price_decimals", "supported_quote_decimals", "created_at", "multiplier", "start_timestamp", "end_timestamp", "open_interest", "outcome", "operator_account_index", "settlement_cap", "settlement_type", "settlement_price", "default_price", "is_frozen", "size_decimals", "price_decimals", "stats"] + __properties: ClassVar[List[str]] = ["symbol", "market_id", "market_type", "base_asset_id", "quote_asset_id", "status", "taker_fee", "is_taker_fee_enabled", "maker_fee", "is_maker_fee_enabled", "liquidation_fee", "min_base_amount", "min_quote_amount", "order_quote_limit", "supported_size_decimals", "supported_price_decimals", "supported_quote_decimals", "created_at", "multiplier", "start_timestamp", "end_timestamp", "open_interest", "outcome", "operator_account_index", "settlement_cap", "settlement_type", "settlement_price", "default_price", "is_frozen", "size_decimals", "price_decimals", "stats"] @field_validator('market_type') def market_type_validate_enum(cls, value): @@ -154,7 +153,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_construct(**{ "symbol": obj.get("symbol"), "market_id": obj.get("market_id"), - "marketSlotId": obj.get("marketSlotId"), "market_type": obj.get("market_type"), "base_asset_id": obj.get("base_asset_id"), "quote_asset_id": obj.get("quote_asset_id"), diff --git a/lighter/models/order.py b/lighter/models/order.py index 69a3ae8..a98148d 100644 --- a/lighter/models/order.py +++ b/lighter/models/order.py @@ -65,8 +65,10 @@ class Order(BaseModel): integrator_taker_fee: StrictStr order_flags: StrictInt order_version: StrictInt + market_symbol: StrictStr + market_kind: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["order_index", "client_order_index", "order_id", "client_order_id", "market_index", "owner_account_index", "initial_base_amount", "price", "nonce", "remaining_base_amount", "is_ask", "base_size", "base_price", "filled_base_amount", "filled_quote_amount", "side", "type", "time_in_force", "reduce_only", "trigger_price", "order_expiry", "status", "trigger_status", "trigger_time", "parent_order_index", "parent_order_id", "to_trigger_order_id_0", "to_trigger_order_id_1", "to_cancel_order_id_0", "block_height", "timestamp", "created_at", "updated_at", "transaction_time", "integrator_fee_collector_index", "integrator_maker_fee", "integrator_taker_fee", "order_flags", "order_version"] + __properties: ClassVar[List[str]] = ["order_index", "client_order_index", "order_id", "client_order_id", "market_index", "owner_account_index", "initial_base_amount", "price", "nonce", "remaining_base_amount", "is_ask", "base_size", "base_price", "filled_base_amount", "filled_quote_amount", "side", "type", "time_in_force", "reduce_only", "trigger_price", "order_expiry", "status", "trigger_status", "trigger_time", "parent_order_index", "parent_order_id", "to_trigger_order_id_0", "to_trigger_order_id_1", "to_cancel_order_id_0", "block_height", "timestamp", "created_at", "updated_at", "transaction_time", "integrator_fee_collector_index", "integrator_maker_fee", "integrator_taker_fee", "order_flags", "order_version", "market_symbol", "market_kind"] @field_validator('type') def type_validate_enum(cls, value): @@ -96,6 +98,13 @@ def trigger_status_validate_enum(cls, value): raise ValueError("must be one of enum values ('na', 'ready', 'mark-price', 'twap', 'parent-order')") return value + @field_validator('market_kind') + def market_kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['spot', 'bo', 'perps']): + raise ValueError("must be one of enum values ('spot', 'bo', 'perps')") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -192,7 +201,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "integrator_maker_fee": obj.get("integrator_maker_fee"), "integrator_taker_fee": obj.get("integrator_taker_fee"), "order_flags": obj.get("order_flags"), - "order_version": obj.get("order_version") + "order_version": obj.get("order_version"), + "market_symbol": obj.get("market_symbol"), + "market_kind": obj.get("market_kind") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/order_book.py b/lighter/models/order_book.py index 20444f0..0b7887e 100644 --- a/lighter/models/order_book.py +++ b/lighter/models/order_book.py @@ -45,21 +45,45 @@ class OrderBook(BaseModel): is_taker_fee_enabled: StrictBool created_at: StrictStr multiplier: StrictStr + start_timestamp: StrictInt + end_timestamp: StrictInt + settlement_type: StrictInt + settlement_price: StrictInt + settlement_cap: StrictInt + outcome: StrictInt + default_price: StrictInt + operator_account_index: StrictInt + is_frozen: StrictBool + open_interest: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["symbol", "market_id", "market_type", "base_asset_id", "quote_asset_id", "status", "taker_fee", "maker_fee", "liquidation_fee", "min_base_amount", "min_quote_amount", "supported_size_decimals", "supported_price_decimals", "supported_quote_decimals", "order_quote_limit", "is_maker_fee_enabled", "is_taker_fee_enabled", "created_at", "multiplier"] + __properties: ClassVar[List[str]] = ["symbol", "market_id", "market_type", "base_asset_id", "quote_asset_id", "status", "taker_fee", "maker_fee", "liquidation_fee", "min_base_amount", "min_quote_amount", "supported_size_decimals", "supported_price_decimals", "supported_quote_decimals", "order_quote_limit", "is_maker_fee_enabled", "is_taker_fee_enabled", "created_at", "multiplier", "start_timestamp", "end_timestamp", "settlement_type", "settlement_price", "settlement_cap", "outcome", "default_price", "operator_account_index", "is_frozen", "open_interest"] @field_validator('market_type') def market_type_validate_enum(cls, value): """Validates the enum""" - if value not in set(['perp', 'spot']): - raise ValueError("must be one of enum values ('perp', 'spot')") + if value not in set(['perp', 'spot', 'binary_options']): + raise ValueError("must be one of enum values ('perp', 'spot', 'binary_options')") return value @field_validator('status') def status_validate_enum(cls, value): """Validates the enum""" - if value not in set(['inactive', 'active']): - raise ValueError("must be one of enum values ('inactive', 'active')") + if value not in set(['inactive', 'active', 'in-settlement', 'waiting-for-settlement', 'settled']): + raise ValueError("must be one of enum values ('inactive', 'active', 'in-settlement', 'waiting-for-settlement', 'settled')") + return value + + @field_validator('settlement_type') + def settlement_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set([0, 1]): + raise ValueError("must be one of enum values (0, 1)") + return value + + @field_validator('outcome') + def outcome_validate_enum(cls, value): + """Validates the enum""" + if value not in set([0, 1, 2]): + raise ValueError("must be one of enum values (0, 1, 2)") return value model_config = ConfigDict( @@ -138,7 +162,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "is_maker_fee_enabled": obj.get("is_maker_fee_enabled"), "is_taker_fee_enabled": obj.get("is_taker_fee_enabled"), "created_at": obj.get("created_at"), - "multiplier": obj.get("multiplier") + "multiplier": obj.get("multiplier"), + "start_timestamp": obj.get("start_timestamp"), + "end_timestamp": obj.get("end_timestamp"), + "settlement_type": obj.get("settlement_type"), + "settlement_price": obj.get("settlement_price"), + "settlement_cap": obj.get("settlement_cap"), + "outcome": obj.get("outcome"), + "default_price": obj.get("default_price"), + "operator_account_index": obj.get("operator_account_index"), + "is_frozen": obj.get("is_frozen"), + "open_interest": obj.get("open_interest") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/perps_order_book_detail.py b/lighter/models/perps_order_book_detail.py index b77c4d1..56e321a 100644 --- a/lighter/models/perps_order_book_detail.py +++ b/lighter/models/perps_order_book_detail.py @@ -71,21 +71,44 @@ class PerpsOrderBookDetail(BaseModel): multiplier: StrictStr market_flags: StrictInt funding_premium_multiplier: StrictInt + start_timestamp: StrictInt + end_timestamp: StrictInt + settlement_type: StrictInt + settlement_price: StrictInt + settlement_cap: StrictInt + outcome: StrictInt + default_price: StrictInt + operator_account_index: StrictInt + is_frozen: StrictBool additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["symbol", "market_id", "market_type", "base_asset_id", "quote_asset_id", "status", "taker_fee", "maker_fee", "liquidation_fee", "min_base_amount", "min_quote_amount", "supported_size_decimals", "supported_price_decimals", "supported_quote_decimals", "order_quote_limit", "size_decimals", "price_decimals", "quote_multiplier", "default_initial_margin_fraction", "min_initial_margin_fraction", "maintenance_margin_fraction", "closeout_margin_fraction", "last_trade_price", "daily_trades_count", "daily_base_token_volume", "daily_quote_token_volume", "daily_price_low", "daily_price_high", "daily_price_change", "open_interest", "daily_chart", "market_config", "strategy_index", "is_maker_fee_enabled", "is_taker_fee_enabled", "funding_clamp_small", "funding_clamp_big", "base_interest_rate", "created_at", "mark_price", "index_price", "multiplier", "market_flags", "funding_premium_multiplier"] + __properties: ClassVar[List[str]] = ["symbol", "market_id", "market_type", "base_asset_id", "quote_asset_id", "status", "taker_fee", "maker_fee", "liquidation_fee", "min_base_amount", "min_quote_amount", "supported_size_decimals", "supported_price_decimals", "supported_quote_decimals", "order_quote_limit", "size_decimals", "price_decimals", "quote_multiplier", "default_initial_margin_fraction", "min_initial_margin_fraction", "maintenance_margin_fraction", "closeout_margin_fraction", "last_trade_price", "daily_trades_count", "daily_base_token_volume", "daily_quote_token_volume", "daily_price_low", "daily_price_high", "daily_price_change", "open_interest", "daily_chart", "market_config", "strategy_index", "is_maker_fee_enabled", "is_taker_fee_enabled", "funding_clamp_small", "funding_clamp_big", "base_interest_rate", "created_at", "mark_price", "index_price", "multiplier", "market_flags", "funding_premium_multiplier", "start_timestamp", "end_timestamp", "settlement_type", "settlement_price", "settlement_cap", "outcome", "default_price", "operator_account_index", "is_frozen"] @field_validator('market_type') def market_type_validate_enum(cls, value): """Validates the enum""" - if value not in set(['perp', 'spot']): - raise ValueError("must be one of enum values ('perp', 'spot')") + if value not in set(['perp', 'spot', 'binary_options']): + raise ValueError("must be one of enum values ('perp', 'spot', 'binary_options')") return value @field_validator('status') def status_validate_enum(cls, value): """Validates the enum""" - if value not in set(['inactive', 'active']): - raise ValueError("must be one of enum values ('inactive', 'active')") + if value not in set(['inactive', 'active', 'in-settlement', 'waiting-for-settlement', 'settled']): + raise ValueError("must be one of enum values ('inactive', 'active', 'in-settlement', 'waiting-for-settlement', 'settled')") + return value + + @field_validator('settlement_type') + def settlement_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set([0, 1]): + raise ValueError("must be one of enum values (0, 1)") + return value + + @field_validator('outcome') + def outcome_validate_enum(cls, value): + """Validates the enum""" + if value not in set([0, 1, 2]): + raise ValueError("must be one of enum values (0, 1, 2)") return value model_config = ConfigDict( @@ -192,7 +215,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "index_price": obj.get("index_price"), "multiplier": obj.get("multiplier"), "market_flags": obj.get("market_flags"), - "funding_premium_multiplier": obj.get("funding_premium_multiplier") + "funding_premium_multiplier": obj.get("funding_premium_multiplier"), + "start_timestamp": obj.get("start_timestamp"), + "end_timestamp": obj.get("end_timestamp"), + "settlement_type": obj.get("settlement_type"), + "settlement_price": obj.get("settlement_price"), + "settlement_cap": obj.get("settlement_cap"), + "outcome": obj.get("outcome"), + "default_price": obj.get("default_price"), + "operator_account_index": obj.get("operator_account_index"), + "is_frozen": obj.get("is_frozen") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/spot_order_book_detail.py b/lighter/models/spot_order_book_detail.py index b7330af..e303a20 100644 --- a/lighter/models/spot_order_book_detail.py +++ b/lighter/models/spot_order_book_detail.py @@ -55,21 +55,45 @@ class SpotOrderBookDetail(BaseModel): is_taker_fee_enabled: StrictBool created_at: StrictStr multiplier: StrictStr + start_timestamp: StrictInt + end_timestamp: StrictInt + settlement_type: StrictInt + settlement_price: StrictInt + settlement_cap: StrictInt + outcome: StrictInt + default_price: StrictInt + operator_account_index: StrictInt + is_frozen: StrictBool + open_interest: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["symbol", "market_id", "market_type", "base_asset_id", "quote_asset_id", "status", "taker_fee", "maker_fee", "liquidation_fee", "min_base_amount", "min_quote_amount", "order_quote_limit", "supported_size_decimals", "supported_price_decimals", "supported_quote_decimals", "size_decimals", "price_decimals", "last_trade_price", "daily_trades_count", "daily_base_token_volume", "daily_quote_token_volume", "daily_price_low", "daily_price_high", "daily_price_change", "daily_chart", "is_maker_fee_enabled", "is_taker_fee_enabled", "created_at", "multiplier"] + __properties: ClassVar[List[str]] = ["symbol", "market_id", "market_type", "base_asset_id", "quote_asset_id", "status", "taker_fee", "maker_fee", "liquidation_fee", "min_base_amount", "min_quote_amount", "order_quote_limit", "supported_size_decimals", "supported_price_decimals", "supported_quote_decimals", "size_decimals", "price_decimals", "last_trade_price", "daily_trades_count", "daily_base_token_volume", "daily_quote_token_volume", "daily_price_low", "daily_price_high", "daily_price_change", "daily_chart", "is_maker_fee_enabled", "is_taker_fee_enabled", "created_at", "multiplier", "start_timestamp", "end_timestamp", "settlement_type", "settlement_price", "settlement_cap", "outcome", "default_price", "operator_account_index", "is_frozen", "open_interest"] @field_validator('market_type') def market_type_validate_enum(cls, value): """Validates the enum""" - if value not in set(['perp', 'spot']): - raise ValueError("must be one of enum values ('perp', 'spot')") + if value not in set(['perp', 'spot', 'binary_options']): + raise ValueError("must be one of enum values ('perp', 'spot', 'binary_options')") return value @field_validator('status') def status_validate_enum(cls, value): """Validates the enum""" - if value not in set(['inactive', 'active']): - raise ValueError("must be one of enum values ('inactive', 'active')") + if value not in set(['inactive', 'active', 'in-settlement', 'waiting-for-settlement', 'settled']): + raise ValueError("must be one of enum values ('inactive', 'active', 'in-settlement', 'waiting-for-settlement', 'settled')") + return value + + @field_validator('settlement_type') + def settlement_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set([0, 1]): + raise ValueError("must be one of enum values (0, 1)") + return value + + @field_validator('outcome') + def outcome_validate_enum(cls, value): + """Validates the enum""" + if value not in set([0, 1, 2]): + raise ValueError("must be one of enum values (0, 1, 2)") return value model_config = ConfigDict( @@ -158,7 +182,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "is_maker_fee_enabled": obj.get("is_maker_fee_enabled"), "is_taker_fee_enabled": obj.get("is_taker_fee_enabled"), "created_at": obj.get("created_at"), - "multiplier": obj.get("multiplier") + "multiplier": obj.get("multiplier"), + "start_timestamp": obj.get("start_timestamp"), + "end_timestamp": obj.get("end_timestamp"), + "settlement_type": obj.get("settlement_type"), + "settlement_price": obj.get("settlement_price"), + "settlement_cap": obj.get("settlement_cap"), + "outcome": obj.get("outcome"), + "default_price": obj.get("default_price"), + "operator_account_index": obj.get("operator_account_index"), + "is_frozen": obj.get("is_frozen"), + "open_interest": obj.get("open_interest") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/trade.py b/lighter/models/trade.py index 04ee96b..73e2a43 100644 --- a/lighter/models/trade.py +++ b/lighter/models/trade.py @@ -70,8 +70,10 @@ class Trade(BaseModel): maker_allocated_margin_usdc_after: StrictInt bid_order_version: StrictInt ask_order_version: StrictInt + market_symbol: StrictStr + market_kind: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["trade_id", "tx_hash", "type", "market_id", "size", "price", "usd_amount", "ask_id", "bid_id", "ask_account_id", "bid_account_id", "is_maker_ask", "block_height", "timestamp", "taker_fee", "taker_position_size_before", "taker_entry_quote_before", "taker_initial_margin_fraction_before", "taker_position_sign_changed", "maker_fee", "maker_position_size_before", "maker_entry_quote_before", "maker_initial_margin_fraction_before", "maker_position_sign_changed", "transaction_time", "bid_account_pnl", "ask_account_pnl", "ask_client_id", "bid_client_id", "ask_client_id_str", "bid_client_id_str", "ask_id_str", "bid_id_str", "trade_id_str", "integrator_maker_fee", "integrator_maker_fee_collector_index", "integrator_taker_fee", "integrator_taker_fee_collector_index", "taker_allocated_margin_usdc_before", "taker_allocated_margin_usdc_after", "maker_allocated_margin_usdc_before", "maker_allocated_margin_usdc_after", "bid_order_version", "ask_order_version"] + __properties: ClassVar[List[str]] = ["trade_id", "tx_hash", "type", "market_id", "size", "price", "usd_amount", "ask_id", "bid_id", "ask_account_id", "bid_account_id", "is_maker_ask", "block_height", "timestamp", "taker_fee", "taker_position_size_before", "taker_entry_quote_before", "taker_initial_margin_fraction_before", "taker_position_sign_changed", "maker_fee", "maker_position_size_before", "maker_entry_quote_before", "maker_initial_margin_fraction_before", "maker_position_sign_changed", "transaction_time", "bid_account_pnl", "ask_account_pnl", "ask_client_id", "bid_client_id", "ask_client_id_str", "bid_client_id_str", "ask_id_str", "bid_id_str", "trade_id_str", "integrator_maker_fee", "integrator_maker_fee_collector_index", "integrator_taker_fee", "integrator_taker_fee_collector_index", "taker_allocated_margin_usdc_before", "taker_allocated_margin_usdc_after", "maker_allocated_margin_usdc_before", "maker_allocated_margin_usdc_after", "bid_order_version", "ask_order_version", "market_symbol", "market_kind"] @field_validator('type') def type_validate_enum(cls, value): @@ -80,6 +82,13 @@ def type_validate_enum(cls, value): raise ValueError("must be one of enum values ('trade', 'liquidation', 'deleverage', 'market-settlement')") return value + @field_validator('market_kind') + def market_kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['spot', 'bo', 'perps']): + raise ValueError("must be one of enum values ('spot', 'bo', 'perps')") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -181,7 +190,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "maker_allocated_margin_usdc_before": obj.get("maker_allocated_margin_usdc_before"), "maker_allocated_margin_usdc_after": obj.get("maker_allocated_margin_usdc_after"), "bid_order_version": obj.get("bid_order_version"), - "ask_order_version": obj.get("ask_order_version") + "ask_order_version": obj.get("ask_order_version"), + "market_symbol": obj.get("market_symbol"), + "market_kind": obj.get("market_kind") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/up_down_candle.py b/lighter/models/up_down_candle.py index 10a743e..78a7f3e 100644 --- a/lighter/models/up_down_candle.py +++ b/lighter/models/up_down_candle.py @@ -34,11 +34,10 @@ class UpDownCandle(BaseModel): high: StrictStr low: StrictStr close: StrictStr - sample_count: StrictInt = Field(description=" observations in the candle: orders live updates of the same bucket, not served", alias="sampleCount") provider: StrictStr = Field(description=" provider feed of the last observation of the candle") feed_id: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["symbol", "duration", "resolution", "timestamp", "open", "high", "low", "close", "sampleCount", "provider", "feed_id"] + __properties: ClassVar[List[str]] = ["symbol", "duration", "resolution", "timestamp", "open", "high", "low", "close", "provider", "feed_id"] model_config = ConfigDict( populate_by_name=True, @@ -106,7 +105,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "high": obj.get("high"), "low": obj.get("low"), "close": obj.get("close"), - "sampleCount": obj.get("sampleCount"), "provider": obj.get("provider"), "feed_id": obj.get("feed_id") }) diff --git a/openapi.json b/openapi.json index 59cd6cd..f9cda76 100644 --- a/openapi.json +++ b/openapi.json @@ -155,7 +155,8 @@ "enum": [ "all", "spot", - "perp" + "perp", + "bo" ], "default": "all" } @@ -267,7 +268,8 @@ "enum": [ "all", "spot", - "perp" + "perp", + "bo" ], "default": "all" } @@ -5144,7 +5146,7 @@ "parameters": [ { "name": "authorization", - "in": "query", + "in": "header", "description": " make required after integ is done", "required": false, "schema": { @@ -5522,7 +5524,7 @@ "parameters": [ { "name": "authorization", - "in": "query", + "in": "header", "description": " make required after integ is done", "required": false, "schema": { @@ -6971,6 +6973,12 @@ "agent_enabled": { "type": "boolean", "format": "boolean" + }, + "bo_positions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccountBinaryOptionsPosition" + } } }, "title": "DetailedAccount", @@ -7849,6 +7857,18 @@ "type": "integer", "format": "int64", "example": "1" + }, + "market_symbol": { + "type": "string", + "example": "ETH" + }, + "market_kind": { + "type": "string", + "enum": [ + "spot", + "bo", + "perps" + ] } }, "title": "Order", @@ -7891,7 +7911,9 @@ "created_at", "updated_at", "transaction_time", - "order_version" + "order_version", + "market_symbol", + "market_kind" ] }, "OrderBook": { @@ -7911,7 +7933,8 @@ "example": "perp", "enum": [ "perp", - "spot" + "spot", + "binary_options" ] }, "base_asset_id": { @@ -7929,7 +7952,10 @@ "example": "active", "enum": [ "inactive", - "active" + "active", + "in-settlement", + "waiting-for-settlement", + "settled" ] }, "taker_fee": { @@ -7986,6 +8012,70 @@ "multiplier": { "type": "string", "example": "1.000000000000000000" + }, + "start_timestamp": { + "type": "integer", + "format": "int64", + "example": 1640995200000 + }, + "end_timestamp": { + "type": "integer", + "format": "int64", + "example": 1640995200000 + }, + "settlement_type": { + "type": "integer", + "format": "int32", + "enum": [ + 0, + 1 + ], + "x-enum-varnames": [ + "Discrete", + "Continuous" + ] + }, + "settlement_price": { + "type": "integer", + "format": "int32", + "example": 10000 + }, + "settlement_cap": { + "type": "integer", + "format": "int32", + "example": 10000 + }, + "outcome": { + "type": "integer", + "format": "int32", + "enum": [ + 0, + 1, + 2 + ], + "x-enum-varnames": [ + "None", + "No", + "Yes" + ] + }, + "default_price": { + "type": "integer", + "format": "int32", + "example": 5000 + }, + "operator_account_index": { + "type": "integer", + "format": "int64", + "example": 1 + }, + "is_frozen": { + "type": "boolean", + "example": false + }, + "open_interest": { + "type": "string", + "example": "93.0" } }, "title": "OrderBook", @@ -8008,7 +8098,17 @@ "supported_price_decimals", "supported_quote_decimals", "created_at", - "multiplier" + "multiplier", + "start_timestamp", + "end_timestamp", + "settlement_type", + "settlement_price", + "settlement_cap", + "outcome", + "default_price", + "operator_account_index", + "is_frozen", + "open_interest" ] }, "PerpsOrderBookDetail": { @@ -8028,7 +8128,8 @@ "example": "perp", "enum": [ "perp", - "spot" + "spot", + "binary_options" ] }, "base_asset_id": { @@ -8046,7 +8147,10 @@ "example": "active", "enum": [ "inactive", - "active" + "active", + "in-settlement", + "waiting-for-settlement", + "settled" ] }, "taker_fee": { @@ -8222,6 +8326,66 @@ "type": "integer", "format": "uin16", "example": "100" + }, + "start_timestamp": { + "type": "integer", + "format": "int64", + "example": 1640995200000 + }, + "end_timestamp": { + "type": "integer", + "format": "int64", + "example": 1640995200000 + }, + "settlement_type": { + "type": "integer", + "format": "int32", + "enum": [ + 0, + 1 + ], + "x-enum-varnames": [ + "Discrete", + "Continuous" + ] + }, + "settlement_price": { + "type": "integer", + "format": "int32", + "example": 10000 + }, + "settlement_cap": { + "type": "integer", + "format": "int32", + "example": 10000 + }, + "outcome": { + "type": "integer", + "format": "int32", + "enum": [ + 0, + 1, + 2 + ], + "x-enum-varnames": [ + "None", + "No", + "Yes" + ] + }, + "default_price": { + "type": "integer", + "format": "int32", + "example": 5000 + }, + "operator_account_index": { + "type": "integer", + "format": "int64", + "example": 1 + }, + "is_frozen": { + "type": "boolean", + "example": false } }, "title": "PerpsOrderBookDetail", @@ -8269,7 +8433,16 @@ "funding_premium_multiplier", "funding_clamp_small", "funding_clamp_big", - "base_interest_rate" + "base_interest_rate", + "start_timestamp", + "end_timestamp", + "settlement_type", + "settlement_price", + "settlement_cap", + "outcome", + "default_price", + "operator_account_index", + "is_frozen" ] }, "OrderBookDetails": { @@ -8320,7 +8493,8 @@ "example": "spot", "enum": [ "perp", - "spot" + "spot", + "binary_options" ] }, "base_asset_id": { @@ -8338,7 +8512,10 @@ "example": "active", "enum": [ "inactive", - "active" + "active", + "in-settlement", + "waiting-for-settlement", + "settled" ] }, "taker_fee": { @@ -8448,6 +8625,70 @@ "multiplier": { "type": "string", "example": "1.000000000000000000" + }, + "start_timestamp": { + "type": "integer", + "format": "int64", + "example": 1640995200000 + }, + "end_timestamp": { + "type": "integer", + "format": "int64", + "example": 1640995200000 + }, + "settlement_type": { + "type": "integer", + "format": "int32", + "enum": [ + 0, + 1 + ], + "x-enum-varnames": [ + "Discrete", + "Continuous" + ] + }, + "settlement_price": { + "type": "integer", + "format": "int32", + "example": 10000 + }, + "settlement_cap": { + "type": "integer", + "format": "int32", + "example": 10000 + }, + "outcome": { + "type": "integer", + "format": "int32", + "enum": [ + 0, + 1, + 2 + ], + "x-enum-varnames": [ + "None", + "No", + "Yes" + ] + }, + "default_price": { + "type": "integer", + "format": "int32", + "example": 5000 + }, + "operator_account_index": { + "type": "integer", + "format": "int64", + "example": 1 + }, + "is_frozen": { + "type": "boolean", + "example": false + }, + "open_interest": { + "type": "string", + "example": "93.0" } }, "title": "SpotOrderBookDetail", @@ -8480,7 +8721,17 @@ "daily_price_low", "daily_price_high", "daily_price_change", - "daily_chart" + "daily_chart", + "start_timestamp", + "end_timestamp", + "settlement_type", + "settlement_price", + "settlement_cap", + "outcome", + "default_price", + "operator_account_index", + "is_frozen", + "open_interest" ] }, "OrderBookOrders": { @@ -9811,6 +10062,18 @@ "type": "integer", "format": "int64", "example": "1" + }, + "market_symbol": { + "type": "string", + "example": "ETH" + }, + "market_kind": { + "type": "string", + "enum": [ + "spot", + "bo", + "perps" + ] } }, "title": "Trade", @@ -9854,7 +10117,9 @@ "maker_allocated_margin_usdc_before", "maker_allocated_margin_usdc_after", "ask_order_version", - "bid_order_version" + "bid_order_version", + "market_symbol", + "market_kind" ] }, "Trades": { @@ -12848,11 +13113,6 @@ "format": "int64", "example": "1" }, - "marketSlotId": { - "type": "integer", - "format": "int16", - "description": " internal only: the reusable tree slot backing this market; never serialized, users only know market_id (the public market index)" - }, "market_type": { "type": "string", "enum": [ @@ -13022,7 +13282,6 @@ "required": [ "symbol", "market_id", - "marketSlotId", "market_type", "base_asset_id", "quote_asset_id", @@ -13259,7 +13518,8 @@ "format": "int64" }, "settlement_pnl": { - "type": "string" + "type": "string", + "nullable": true }, "last_trade_id": { "type": "integer", @@ -13349,11 +13609,6 @@ "type": "string", "example": "115340.123456789012345678" }, - "sampleCount": { - "type": "integer", - "format": "int64", - "description": " observations in the candle: orders live updates of the same bucket, not served" - }, "provider": { "type": "string", "example": "chainlink", @@ -13374,7 +13629,6 @@ "high", "low", "close", - "sampleCount", "provider", "feed_id" ] @@ -13500,6 +13754,51 @@ "required_lit_stakes", "fee_rate" ] + }, + "AccountBinaryOptionsPosition": { + "type": "object", + "properties": { + "market_id": { + "type": "integer", + "format": "int64", + "example": 1000 + }, + "entry_quote": { + "type": "string", + "example": "588.00" + }, + "avg_entry_price": { + "type": "string", + "example": "0.49", + "description": " average price paid for the held outcome (YES price for sign 1, NO price for sign -1)" + }, + "sign": { + "type": "integer", + "format": "int32", + "enum": [ + -1, + 1 + ], + "description": " 1 holds the YES outcome, -1 holds the NO outcome", + "x-enum-varnames": [ + "No", + "Yes" + ] + }, + "size": { + "type": "string", + "example": "1200", + "description": " magnitude only; combine with sign" + } + }, + "title": "AccountBinaryOptionsPosition", + "required": [ + "market_id", + "entry_quote", + "avg_entry_price", + "sign", + "size" + ] } } }