diff --git a/pyproject.toml b/pyproject.toml index be08aea..cf3623c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" urls = { "Homepage" = "https://github.com/ln-markets/sdk-python", "Repository" = "https://github.com/ln-markets/sdk-python", "Bug Tracker" = "https://github.com/ln-markets/sdk-python/issues" } name = "lnmarkets-sdk" -version = "0.1.0" +version = "0.1.1" description = "LN Markets API Python SDK" readme = "README.md" license = { text = "MIT" } diff --git a/src/lnmarkets_sdk/rest/v3/models/futures_isolated.py b/src/lnmarkets_sdk/rest/v3/models/futures_isolated.py index 8b9bc6d..b1cf065 100644 --- a/src/lnmarkets_sdk/rest/v3/models/futures_isolated.py +++ b/src/lnmarkets_sdk/rest/v3/models/futures_isolated.py @@ -78,6 +78,14 @@ class FuturesTrade(BaseModel, BaseConfig): running: SkipValidation[bool] side: SkipValidation[Literal["buy", "sell"]] stoploss: SkipValidation[float] + sum_cash_in_margin: SkipValidation[float] = Field( + default=0.0, + description="Total amount cashed in from margin over the trade lifetime", + ) + sum_cash_in_pl: SkipValidation[float] = Field( + default=0.0, + description="Total amount cashed in from PL over the trade lifetime", + ) sum_funding_fees: SkipValidation[float] takeprofit: SkipValidation[float] type: SkipValidation[Literal["limit", "market"]] diff --git a/src/lnmarkets_sdk/rest/v3/tests/test_integration.py b/src/lnmarkets_sdk/rest/v3/tests/test_integration.py index b56ac7a..6749bd3 100644 --- a/src/lnmarkets_sdk/rest/v3/tests/test_integration.py +++ b/src/lnmarkets_sdk/rest/v3/tests/test_integration.py @@ -393,6 +393,8 @@ async def test_new_trade(self): assert trade.opening_fee >= 0 assert trade.closing_fee >= 0 assert trade.sum_funding_fees is not None + assert trade.sum_cash_in_pl is not None + assert trade.sum_cash_in_margin is not None except Exception as e: pytest.skip("Could not create a new trade: " + str(e)) diff --git a/uv.lock b/uv.lock index 20457a3..d2b6b8c 100644 --- a/uv.lock +++ b/uv.lock @@ -196,7 +196,7 @@ wheels = [ [[package]] name = "lnmarkets-sdk" -version = "0.1.0" +version = "0.1.1" source = { editable = "." } dependencies = [ { name = "httpx" },