From 1b69fd29dd5cef0550fd0f9ec883390064b8e175 Mon Sep 17 00:00:00 2001 From: mihai Date: Mon, 28 Sep 2026 12:49:19 +0000 Subject: [PATCH] Sync generated SDK with zklighter-perps-python#358 --- .openapi-generator/FILES | 10 + README.md | 8 + docs/AccountApi.md | 90 ++- docs/AccountMetadata.md | 1 + docs/DetailedAccount.md | 1 + docs/FundingApi.md | 2 +- docs/HistoricalTradesExportData.md | 32 ++ docs/LiqTrade.md | 2 + docs/LivepointsApi.md | 2 +- docs/Order.md | 1 + docs/OrderApi.md | 76 +++ docs/PerpsOrderBookDetail.md | 10 +- docs/PnlLeaderboard.md | 33 ++ docs/PnlLeaderboardEntry.md | 34 ++ docs/RFQMetadata.md | 1 + docs/Referral.md | 1 + docs/ReferralApi.md | 82 ++- docs/ReferralStat.md | 31 ++ docs/ReferralStats.md | 31 ++ docs/RiskParameters.md | 2 +- docs/SystemConfig.md | 3 +- docs/Token.md | 2 + lighter/__init__.py | 5 + lighter/api/account_api.py | 375 ++++++++++++- lighter/api/funding_api.py | 6 +- lighter/api/livepoints_api.py | 6 +- lighter/api/order_api.py | 312 +++++++++++ lighter/api/referral_api.py | 327 ++++++++++- lighter/models/__init__.py | 5 + lighter/models/account_metadata.py | 6 +- lighter/models/asset.py | 4 +- lighter/models/detailed_account.py | 6 +- .../models/historical_trades_export_data.py | 106 ++++ lighter/models/liq_trade.py | 8 +- lighter/models/order.py | 6 +- lighter/models/perps_order_book_detail.py | 12 +- lighter/models/pnl_leaderboard.py | 116 ++++ lighter/models/pnl_leaderboard_entry.py | 110 ++++ lighter/models/referral.py | 6 +- lighter/models/referral_stat.py | 108 ++++ lighter/models/referral_stats.py | 112 ++++ lighter/models/rfq_metadata.py | 6 +- lighter/models/risk_parameters.py | 4 +- lighter/models/system_config.py | 8 +- lighter/models/token.py | 10 +- openapi.json | 511 +++++++++++++++++- 46 files changed, 2550 insertions(+), 80 deletions(-) create mode 100644 docs/HistoricalTradesExportData.md create mode 100644 docs/PnlLeaderboard.md create mode 100644 docs/PnlLeaderboardEntry.md create mode 100644 docs/ReferralStat.md create mode 100644 docs/ReferralStats.md create mode 100644 lighter/models/historical_trades_export_data.py create mode 100644 lighter/models/pnl_leaderboard.py create mode 100644 lighter/models/pnl_leaderboard_entry.py create mode 100644 lighter/models/referral_stat.py create mode 100644 lighter/models/referral_stats.py diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 722ca2d7..3ab37341 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -44,6 +44,7 @@ docs/FundingApi.md docs/FundingRate.md docs/FundingRates.md docs/Fundings.md +docs/HistoricalTradesExportData.md docs/InfoApi.md docs/L1Metadata.md docs/L1ProviderInfo.md @@ -77,6 +78,8 @@ docs/PartnerStats.md docs/PendingUnlock.md docs/PerpsOrderBookDetail.md docs/PnLEntry.md +docs/PnlLeaderboard.md +docs/PnlLeaderboardEntry.md docs/PositionFunding.md docs/PositionFundings.md docs/PublicPoolInfo.md @@ -91,6 +94,8 @@ docs/ReferralCode.md docs/ReferralPointEntry.md docs/ReferralPoints.md docs/ReferralProgramKickback.md +docs/ReferralStat.md +docs/ReferralStats.md docs/ReferralTotals.md docs/ReqSetAccountMetadata.md docs/RespChangeAccountTier.md @@ -208,6 +213,7 @@ lighter/models/funding.py lighter/models/funding_rate.py lighter/models/funding_rates.py lighter/models/fundings.py +lighter/models/historical_trades_export_data.py lighter/models/l1_metadata.py lighter/models/l1_provider_info.py lighter/models/layer1_basic_info.py @@ -237,6 +243,8 @@ lighter/models/partner_stats.py lighter/models/pending_unlock.py lighter/models/perps_order_book_detail.py lighter/models/pn_l_entry.py +lighter/models/pnl_leaderboard.py +lighter/models/pnl_leaderboard_entry.py lighter/models/position_funding.py lighter/models/position_fundings.py lighter/models/public_pool_info.py @@ -247,6 +255,8 @@ lighter/models/referral_code.py lighter/models/referral_point_entry.py lighter/models/referral_points.py lighter/models/referral_program_kickback.py +lighter/models/referral_stat.py +lighter/models/referral_stats.py lighter/models/referral_totals.py lighter/models/req_set_account_metadata.py lighter/models/resp_change_account_tier.py diff --git a/README.md b/README.md index 48444b3e..226bf9a6 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,7 @@ Class | Method | HTTP request | Description *AccountApi* | [**lit_lease**](docs/AccountApi.md#lit_lease) | **POST** /api/v1/litLease | litLease *AccountApi* | [**partner_stats**](docs/AccountApi.md#partner_stats) | **GET** /api/v1/partnerStats | partnerStats *AccountApi* | [**pnl**](docs/AccountApi.md#pnl) | **GET** /api/v1/pnl | pnl +*AccountApi* | [**pnl_leaderboard**](docs/AccountApi.md#pnl_leaderboard) | **GET** /api/v1/pnlLeaderboard | pnlLeaderboard *AccountApi* | [**position_funding**](docs/AccountApi.md#position_funding) | **GET** /api/v1/positionFunding | positionFunding *AccountApi* | [**public_pools_metadata**](docs/AccountApi.md#public_pools_metadata) | **GET** /api/v1/publicPoolsMetadata | publicPoolsMetadata *AccountApi* | [**referral_user_referrals**](docs/AccountApi.md#referral_user_referrals) | **GET** /api/v1/referral/userReferrals | userReferrals @@ -110,6 +111,7 @@ Class | Method | HTTP request | Description *OrderApi* | [**asset_details**](docs/OrderApi.md#asset_details) | **GET** /api/v1/assetDetails | assetDetails *OrderApi* | [**exchange_metrics**](docs/OrderApi.md#exchange_metrics) | **GET** /api/v1/exchangeMetrics | exchangeMetrics *OrderApi* | [**exchange_stats**](docs/OrderApi.md#exchange_stats) | **GET** /api/v1/exchangeStats | exchangeStats +*OrderApi* | [**export_historical_trades**](docs/OrderApi.md#export_historical_trades) | **GET** /api/v1/export/historicalTrades | export_historicalTrades *OrderApi* | [**execute_stats**](docs/OrderApi.md#execute_stats) | **GET** /api/v1/executeStats | executeStats *OrderApi* | [**export**](docs/OrderApi.md#export) | **GET** /api/v1/export | export *OrderApi* | [**order_book_details**](docs/OrderApi.md#order_book_details) | **GET** /api/v1/orderBookDetails | orderBookDetails @@ -121,6 +123,7 @@ Class | Method | HTTP request | Description *ReferralApi* | [**referral_get**](docs/ReferralApi.md#referral_get) | **GET** /api/v1/referral/get | referral_get *ReferralApi* | [**referral_kickback_update**](docs/ReferralApi.md#referral_kickback_update) | **POST** /api/v1/referral/kickback/update | referral_kickback_update *ReferralApi* | [**referral_points**](docs/ReferralApi.md#referral_points) | **GET** /api/v1/referral/points | referral_points +*ReferralApi* | [**referral_stats**](docs/ReferralApi.md#referral_stats) | **GET** /api/v1/referral/stats | referral_stats *ReferralApi* | [**referral_update**](docs/ReferralApi.md#referral_update) | **POST** /api/v1/referral/update | referral_update *ReferralApi* | [**referral_use**](docs/ReferralApi.md#referral_use) | **POST** /api/v1/referral/use | referral_use *RootApi* | [**info**](docs/RootApi.md#info) | **GET** /info | info @@ -179,6 +182,7 @@ Class | Method | HTTP request | Description - [Funding](docs/Funding.md) - [FundingRate](docs/FundingRate.md) - [FundingRates](docs/FundingRates.md) + - [HistoricalTradesExportData](docs/HistoricalTradesExportData.md) - [Fundings](docs/Fundings.md) - [L1Metadata](docs/L1Metadata.md) - [L1ProviderInfo](docs/L1ProviderInfo.md) @@ -208,6 +212,8 @@ Class | Method | HTTP request | Description - [PartnerStats](docs/PartnerStats.md) - [PendingUnlock](docs/PendingUnlock.md) - [PerpsOrderBookDetail](docs/PerpsOrderBookDetail.md) + - [PnlLeaderboard](docs/PnlLeaderboard.md) + - [PnlLeaderboardEntry](docs/PnlLeaderboardEntry.md) - [PnLEntry](docs/PnLEntry.md) - [PositionFunding](docs/PositionFunding.md) - [PositionFundings](docs/PositionFundings.md) @@ -218,6 +224,8 @@ Class | Method | HTTP request | Description - [RFQMetadata](docs/RFQMetadata.md) - [RFQResponseEntry](docs/RFQResponseEntry.md) - [Referral](docs/Referral.md) + - [ReferralStat](docs/ReferralStat.md) + - [ReferralStats](docs/ReferralStats.md) - [ReferralCode](docs/ReferralCode.md) - [ReferralPointEntry](docs/ReferralPointEntry.md) - [ReferralPoints](docs/ReferralPoints.md) diff --git a/docs/AccountApi.md b/docs/AccountApi.md index 849797f3..2d6a440f 100644 --- a/docs/AccountApi.md +++ b/docs/AccountApi.md @@ -19,6 +19,7 @@ Method | HTTP request | Description [**lit_lease**](AccountApi.md#lit_lease) | **POST** /api/v1/litLease | litLease [**partner_stats**](AccountApi.md#partner_stats) | **GET** /api/v1/partnerStats | partnerStats [**pnl**](AccountApi.md#pnl) | **GET** /api/v1/pnl | pnl +[**pnl_leaderboard**](AccountApi.md#pnl_leaderboard) | **GET** /api/v1/pnlLeaderboard | pnlLeaderboard [**position_funding**](AccountApi.md#position_funding) | **GET** /api/v1/positionFunding | positionFunding [**public_pools_metadata**](AccountApi.md#public_pools_metadata) | **GET** /api/v1/publicPoolsMetadata | publicPoolsMetadata [**referral_user_referrals**](AccountApi.md#referral_user_referrals) | **GET** /api/v1/referral/userReferrals | userReferrals @@ -401,7 +402,7 @@ No authorization required changeAccountTier -Change account tier. You can only perform this action once every 24 hours, and with no orders or positions open. +Change account type (applies to both master, and subaccounts). Downgrades can be performed once every 24 hours. ### Example @@ -612,11 +613,11 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **leaderboard** -> Leaderboard leaderboard(type, authorization=authorization, l1_address=l1_address, competition_id=competition_id) +> Leaderboard leaderboard(type, authorization=authorization, l1_address=l1_address, competition_id=competition_id, auth=auth) leaderboard -Get points leaderboard. Type should be all. +Get points leaderboard ### Example @@ -642,10 +643,11 @@ async with lighter.ApiClient(configuration) as api_client: authorization = 'authorization_example' # str | (optional) l1_address = 'l1_address_example' # str | (optional) competition_id = 'competition_id_example' # str | (optional) + auth = 'auth_example' # str | (optional) try: # leaderboard - api_response = await api_instance.leaderboard(type, authorization=authorization, l1_address=l1_address, competition_id=competition_id) + api_response = await api_instance.leaderboard(type, authorization=authorization, l1_address=l1_address, competition_id=competition_id, auth=auth) print("The response of AccountApi->leaderboard:\n") pprint(api_response) except Exception as e: @@ -663,6 +665,7 @@ Name | Type | Description | Notes **authorization** | **str**| | [optional] **l1_address** | **str**| | [optional] **competition_id** | **str**| | [optional] + **auth** | **str**| | [optional] ### Return type @@ -1136,6 +1139,85 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **pnl_leaderboard** +> PnlLeaderboard pnl_leaderboard(time_window, sort_by, sort_dir, limit, offset, search=search) + +pnlLeaderboard + +Get pnl leaderboard + +### Example + + +```python +import lighter +from lighter.models.pnl_leaderboard import PnlLeaderboard +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.AccountApi(api_client) + time_window = all # str | (default to all) + sort_by = pnl # str | (default to pnl) + sort_dir = desc # str | (default to desc) + limit = 56 # int | + offset = 56 # int | + search = 'search_example' # str | (optional) + + try: + # pnlLeaderboard + api_response = await api_instance.pnl_leaderboard(time_window, sort_by, sort_dir, limit, offset, search=search) + print("The response of AccountApi->pnl_leaderboard:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccountApi->pnl_leaderboard: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **time_window** | **str**| | [default to all] + **sort_by** | **str**| | [default to pnl] + **sort_dir** | **str**| | [default to desc] + **limit** | **int**| | + **offset** | **int**| | + **search** | **str**| | [optional] + +### Return type + +[**PnlLeaderboard**](PnlLeaderboard.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **position_funding** > PositionFundings position_funding(account_index, limit, authorization=authorization, cursor=cursor, side=side, start_timestamp=start_timestamp, end_timestamp=end_timestamp, market_ids=market_ids) diff --git a/docs/AccountMetadata.md b/docs/AccountMetadata.md index 3a053aeb..cd6379ee 100644 --- a/docs/AccountMetadata.md +++ b/docs/AccountMetadata.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **can_rfq** | **bool** | | **can_rfq_market_ids** | **List[str]** | | **metadata** | [**SubAccountMetadata**](SubAccountMetadata.md) | | +**agent_enabled** | **bool** | | ## Example diff --git a/docs/DetailedAccount.md b/docs/DetailedAccount.md index 08b8080c..7d6275ab 100644 --- a/docs/DetailedAccount.md +++ b/docs/DetailedAccount.md @@ -38,6 +38,7 @@ Name | Type | Description | Notes **cross_maintenance_margin_requirement** | **str** | | **can_rfq_market_ids** | **List[str]** | | **metadata** | [**SubAccountMetadata**](SubAccountMetadata.md) | | +**agent_enabled** | **bool** | | ## Example diff --git a/docs/FundingApi.md b/docs/FundingApi.md index 7f1ab041..338fbc24 100644 --- a/docs/FundingApi.md +++ b/docs/FundingApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description funding-rates -Get funding rates +Get funding rates across venues. For real-time funding rates, use the market_stats WebSocket channel. ### Example diff --git a/docs/HistoricalTradesExportData.md b/docs/HistoricalTradesExportData.md new file mode 100644 index 00000000..175507de --- /dev/null +++ b/docs/HistoricalTradesExportData.md @@ -0,0 +1,32 @@ +# HistoricalTradesExportData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**data_url** | **str** | | +**expires_at** | **str** | | + +## Example + +```python +from lighter.models.historical_trades_export_data import HistoricalTradesExportData + +# TODO update the JSON string below +json = "{}" +# create an instance of HistoricalTradesExportData from a JSON string +historical_trades_export_data_instance = HistoricalTradesExportData.from_json(json) +# print the JSON string representation of the object +print(HistoricalTradesExportData.to_json()) + +# convert the object into a dict +historical_trades_export_data_dict = historical_trades_export_data_instance.to_dict() +# create an instance of HistoricalTradesExportData from a dict +historical_trades_export_data_from_dict = HistoricalTradesExportData.from_dict(historical_trades_export_data_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/LiqTrade.md b/docs/LiqTrade.md index 06f0a8eb..9509252f 100644 --- a/docs/LiqTrade.md +++ b/docs/LiqTrade.md @@ -10,6 +10,8 @@ Name | Type | Description | Notes **taker_fee** | **str** | | **maker_fee** | **str** | | **transaction_time** | **int** | | +**bid_account_id** | **int** | | +**ask_account_id** | **int** | | ## Example diff --git a/docs/LivepointsApi.md b/docs/LivepointsApi.md index 1446cff5..8b5ca08b 100644 --- a/docs/LivepointsApi.md +++ b/docs/LivepointsApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description livePoints_total -Get live points total for an account +Get RH live points total for an account ### Example diff --git a/docs/Order.md b/docs/Order.md index 21e5834e..f1276d5f 100644 --- a/docs/Order.md +++ b/docs/Order.md @@ -43,6 +43,7 @@ Name | Type | Description | Notes **integrator_maker_fee** | **str** | | **integrator_taker_fee** | **str** | | **order_flags** | **int** | | +**order_version** | **int** | | ## Example diff --git a/docs/OrderApi.md b/docs/OrderApi.md index cc100ed6..ab8f8428 100644 --- a/docs/OrderApi.md +++ b/docs/OrderApi.md @@ -12,6 +12,7 @@ Method | HTTP request | Description [**exchange_stats**](OrderApi.md#exchange_stats) | **GET** /api/v1/exchangeStats | exchangeStats [**execute_stats**](OrderApi.md#execute_stats) | **GET** /api/v1/executeStats | executeStats [**export**](OrderApi.md#export) | **GET** /api/v1/export | export +[**export_historical_trades**](OrderApi.md#export_historical_trades) | **GET** /api/v1/export/historicalTrades | export_historicalTrades [**order_book_details**](OrderApi.md#order_book_details) | **GET** /api/v1/orderBookDetails | orderBookDetails [**order_book_orders**](OrderApi.md#order_book_orders) | **GET** /api/v1/orderBookOrders | orderBookOrders [**order_books**](OrderApi.md#order_books) | **GET** /api/v1/orderBooks | orderBooks @@ -615,6 +616,81 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **export_historical_trades** +> HistoricalTradesExportData export_historical_trades(l1_address, var_date, authorization=authorization, auth=auth) + +export_historicalTrades + +Export global historical trades, updated daily at 8 PM UTC. Requires a one-time 100 LIT L2Transfer to 0x4FD058F25bE85E459ec552cA8e4C696FD1D34125. Returns a presigned S3 URL valid for 1 hour. + +### Example + + +```python +import lighter +from lighter.models.historical_trades_export_data import HistoricalTradesExportData +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.OrderApi(api_client) + l1_address = 'l1_address_example' # str | + var_date = 'var_date_example' # str | UTC day, YYYY-MM-DD + authorization = 'authorization_example' # str | make required after integ is done (optional) + auth = 'auth_example' # str | made optional to support header auth clients (optional) + + try: + # export_historicalTrades + api_response = await api_instance.export_historical_trades(l1_address, var_date, authorization=authorization, auth=auth) + print("The response of OrderApi->export_historical_trades:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OrderApi->export_historical_trades: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **l1_address** | **str**| | + **var_date** | **str**| UTC day, YYYY-MM-DD | + **authorization** | **str**| make required after integ is done | [optional] + **auth** | **str**| made optional to support header auth clients | [optional] + +### Return type + +[**HistoricalTradesExportData**](HistoricalTradesExportData.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **order_book_details** > OrderBookDetails order_book_details(market_id=market_id, filter=filter) diff --git a/docs/PerpsOrderBookDetail.md b/docs/PerpsOrderBookDetail.md index dd682daa..c9f6d562 100644 --- a/docs/PerpsOrderBookDetail.md +++ b/docs/PerpsOrderBookDetail.md @@ -44,11 +44,11 @@ Name | Type | Description | Notes **funding_clamp_big** | **str** | | **base_interest_rate** | **str** | | **created_at** | **str** | | -**mark_price** | **str** | | [optional] -**index_price** | **str** | | [optional] -**multiplier** | **str** | | [optional] -**market_flags** | **int** | | [optional] -**funding_premium_multiplier** | **int** | | [optional] +**mark_price** | **str** | | +**index_price** | **str** | | +**multiplier** | **str** | | +**market_flags** | **int** | | +**funding_premium_multiplier** | **int** | | ## Example diff --git a/docs/PnlLeaderboard.md b/docs/PnlLeaderboard.md new file mode 100644 index 00000000..5d1fee0f --- /dev/null +++ b/docs/PnlLeaderboard.md @@ -0,0 +1,33 @@ +# PnlLeaderboard + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**entries** | [**List[PnlLeaderboardEntry]**](PnlLeaderboardEntry.md) | | +**total** | **int** | | +**updated_at** | **int** | | + +## Example + +```python +from lighter.models.pnl_leaderboard import PnlLeaderboard + +# TODO update the JSON string below +json = "{}" +# create an instance of PnlLeaderboard from a JSON string +pnl_leaderboard_instance = PnlLeaderboard.from_json(json) +# print the JSON string representation of the object +print(PnlLeaderboard.to_json()) + +# convert the object into a dict +pnl_leaderboard_dict = pnl_leaderboard_instance.to_dict() +# create an instance of PnlLeaderboard from a dict +pnl_leaderboard_from_dict = PnlLeaderboard.from_dict(pnl_leaderboard_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/PnlLeaderboardEntry.md b/docs/PnlLeaderboardEntry.md new file mode 100644 index 00000000..b3d202c4 --- /dev/null +++ b/docs/PnlLeaderboardEntry.md @@ -0,0 +1,34 @@ +# PnlLeaderboardEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rank** | **int** | | +**l1_address** | **str** | | +**account_value** | **float** | | +**pnl** | **float** | | +**roi** | **float** | | +**volume** | **float** | | + +## Example + +```python +from lighter.models.pnl_leaderboard_entry import PnlLeaderboardEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of PnlLeaderboardEntry from a JSON string +pnl_leaderboard_entry_instance = PnlLeaderboardEntry.from_json(json) +# print the JSON string representation of the object +print(PnlLeaderboardEntry.to_json()) + +# convert the object into a dict +pnl_leaderboard_entry_dict = pnl_leaderboard_entry_instance.to_dict() +# create an instance of PnlLeaderboardEntry from a dict +pnl_leaderboard_entry_from_dict = PnlLeaderboardEntry.from_dict(pnl_leaderboard_entry_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/RFQMetadata.md b/docs/RFQMetadata.md index afd3f95a..eb090c9b 100644 --- a/docs/RFQMetadata.md +++ b/docs/RFQMetadata.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **requested_slippage** | **str** | | **worst_price** | **str** | | **mark_price** | **str** | | +**requested_est_fill_fraction** | **str** | | ## Example diff --git a/docs/Referral.md b/docs/Referral.md index 0f8b27be..f1133ce4 100644 --- a/docs/Referral.md +++ b/docs/Referral.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **used_at** | **int** | | **trade_stats** | [**TradeStats**](TradeStats.md) | | **tier** | **str** | | +**source** | **str** | | ## Example diff --git a/docs/ReferralApi.md b/docs/ReferralApi.md index 1fed20c3..95aab318 100644 --- a/docs/ReferralApi.md +++ b/docs/ReferralApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**referral_get**](ReferralApi.md#referral_get) | **GET** /api/v1/referral/get | referral_get [**referral_kickback_update**](ReferralApi.md#referral_kickback_update) | **POST** /api/v1/referral/kickback/update | referral_kickback_update [**referral_points**](ReferralApi.md#referral_points) | **GET** /api/v1/referral/points | referral_points +[**referral_stats**](ReferralApi.md#referral_stats) | **GET** /api/v1/referral/stats | referral_stats [**referral_update**](ReferralApi.md#referral_update) | **POST** /api/v1/referral/update | referral_update [**referral_use**](ReferralApi.md#referral_use) | **POST** /api/v1/referral/use | referral_use @@ -298,6 +299,81 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **referral_stats** +> ReferralStats referral_stats(l1_address, authorization=authorization, auth=auth, is_eligible=is_eligible) + +referral_stats + +Get trade stats summed across a referrer's referred users + +### Example + + +```python +import lighter +from lighter.models.referral_stats import ReferralStats +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.ReferralApi(api_client) + l1_address = 'l1_address_example' # str | + authorization = 'authorization_example' # str | (optional) + auth = 'auth_example' # str | (optional) + is_eligible = False # bool | (optional) (default to False) + + try: + # referral_stats + api_response = await api_instance.referral_stats(l1_address, authorization=authorization, auth=auth, is_eligible=is_eligible) + print("The response of ReferralApi->referral_stats:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ReferralApi->referral_stats: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **l1_address** | **str**| | + **authorization** | **str**| | [optional] + **auth** | **str**| | [optional] + **is_eligible** | **bool**| | [optional] [default to False] + +### Return type + +[**ReferralStats**](ReferralStats.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **referral_update** > RespUpdateReferralCode referral_update(account_index, new_referral_code, authorization=authorization) @@ -372,7 +448,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **referral_use** -> ResultCode referral_use(l1_address, referral_code, authorization=authorization, discord=discord, telegram=telegram, x=x, signature=signature) +> ResultCode referral_use(l1_address, referral_code, authorization=authorization, discord=discord, telegram=telegram, x=x, signature=signature, source=source) referral_use @@ -405,10 +481,11 @@ async with lighter.ApiClient(configuration) as api_client: telegram = 'telegram_example' # str | (optional) x = 'x_example' # str | (optional) signature = 'signature_example' # str | (optional) + source = 'source_example' # str | (optional) try: # referral_use - api_response = await api_instance.referral_use(l1_address, referral_code, authorization=authorization, discord=discord, telegram=telegram, x=x, signature=signature) + api_response = await api_instance.referral_use(l1_address, referral_code, authorization=authorization, discord=discord, telegram=telegram, x=x, signature=signature, source=source) print("The response of ReferralApi->referral_use:\n") pprint(api_response) except Exception as e: @@ -429,6 +506,7 @@ Name | Type | Description | Notes **telegram** | **str**| | [optional] **x** | **str**| | [optional] **signature** | **str**| | [optional] + **source** | **str**| | [optional] ### Return type diff --git a/docs/ReferralStat.md b/docs/ReferralStat.md new file mode 100644 index 00000000..f71676a1 --- /dev/null +++ b/docs/ReferralStat.md @@ -0,0 +1,31 @@ +# ReferralStat + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**start_timestamp** | **int** | | +**end_timestamp** | **int** | | +**trade_stats** | [**TradeStats**](TradeStats.md) | | + +## Example + +```python +from lighter.models.referral_stat import ReferralStat + +# TODO update the JSON string below +json = "{}" +# create an instance of ReferralStat from a JSON string +referral_stat_instance = ReferralStat.from_json(json) +# print the JSON string representation of the object +print(ReferralStat.to_json()) + +# convert the object into a dict +referral_stat_dict = referral_stat_instance.to_dict() +# create an instance of ReferralStat from a dict +referral_stat_from_dict = ReferralStat.from_dict(referral_stat_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/ReferralStats.md b/docs/ReferralStats.md new file mode 100644 index 00000000..369ad65c --- /dev/null +++ b/docs/ReferralStats.md @@ -0,0 +1,31 @@ +# ReferralStats + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**stats** | [**List[ReferralStat]**](ReferralStat.md) | | + +## Example + +```python +from lighter.models.referral_stats import ReferralStats + +# TODO update the JSON string below +json = "{}" +# create an instance of ReferralStats from a JSON string +referral_stats_instance = ReferralStats.from_json(json) +# print the JSON string representation of the object +print(ReferralStats.to_json()) + +# convert the object into a dict +referral_stats_dict = referral_stats_instance.to_dict() +# create an instance of ReferralStats from a dict +referral_stats_from_dict = ReferralStats.from_dict(referral_stats_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/RiskParameters.md b/docs/RiskParameters.md index 2a385075..081efcb8 100644 --- a/docs/RiskParameters.md +++ b/docs/RiskParameters.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes **total_account_liquidation_threshold** | **str** | | **usdc_collateral_with_funding** | **str** | | **usdc_portfolio_value** | **str** | | -**total_portfolio_value** | **str** | | [optional] +**total_portfolio_value** | **str** | | ## Example diff --git a/docs/SystemConfig.md b/docs/SystemConfig.md index 05ab95d4..009d3245 100644 --- a/docs/SystemConfig.md +++ b/docs/SystemConfig.md @@ -16,7 +16,8 @@ Name | Type | Description | Notes **max_integrator_perps_taker_fee** | **int** | | **max_integrator_spot_maker_fee** | **int** | | **max_integrator_spot_taker_fee** | **int** | | -**market_maker_incentive_account_index** | **int** | | +**market_maker_incentive_account_index** | **int** | | [optional] +**fee_collector_account_index** | **int** | | ## Example diff --git a/docs/Token.md b/docs/Token.md index 0fc79c5f..c4df22dd 100644 --- a/docs/Token.md +++ b/docs/Token.md @@ -17,6 +17,8 @@ Name | Type | Description | Notes **categories** | **List[str]** | | **is_allowed_mainnet** | **bool** | | **is_asset_allowed_mainnet** | **bool** | | +**default_order_book_group_by** | **int** | | +**backend_symbol** | **str** | | ## Example diff --git a/lighter/__init__.py b/lighter/__init__.py index 941282f4..3c851270 100644 --- a/lighter/__init__.py +++ b/lighter/__init__.py @@ -82,6 +82,7 @@ from lighter.models.funding import Funding from lighter.models.funding_rate import FundingRate from lighter.models.funding_rates import FundingRates +from lighter.models.historical_trades_export_data import HistoricalTradesExportData from lighter.models.fundings import Fundings from lighter.models.l1_metadata import L1Metadata from lighter.models.l1_provider_info import L1ProviderInfo @@ -111,6 +112,8 @@ from lighter.models.partner_stats import PartnerStats from lighter.models.pending_unlock import PendingUnlock from lighter.models.perps_order_book_detail import PerpsOrderBookDetail +from lighter.models.pnl_leaderboard import PnlLeaderboard +from lighter.models.pnl_leaderboard_entry import PnlLeaderboardEntry from lighter.models.pn_l_entry import PnLEntry from lighter.models.position_funding import PositionFunding from lighter.models.position_fundings import PositionFundings @@ -121,6 +124,8 @@ from lighter.models.rfq_metadata import RFQMetadata from lighter.models.rfq_response_entry import RFQResponseEntry from lighter.models.referral import Referral +from lighter.models.referral_stat import ReferralStat +from lighter.models.referral_stats import ReferralStats from lighter.models.referral_code import ReferralCode from lighter.models.referral_point_entry import ReferralPointEntry from lighter.models.referral_points import ReferralPoints diff --git a/lighter/api/account_api.py b/lighter/api/account_api.py index 67241b81..7c97b0b7 100644 --- a/lighter/api/account_api.py +++ b/lighter/api/account_api.py @@ -28,6 +28,7 @@ from lighter.models.leaderboard import Leaderboard from lighter.models.liquidation_infos import LiquidationInfos from lighter.models.partner_stats import PartnerStats +from lighter.models.pnl_leaderboard import PnlLeaderboard from lighter.models.position_fundings import PositionFundings from lighter.models.resp_change_account_tier import RespChangeAccountTier from lighter.models.resp_create_rfq import RespCreateRFQ @@ -1534,7 +1535,7 @@ async def change_account_tier( ) -> RespChangeAccountTier: """changeAccountTier - Change account tier. You can only perform this action once every 24 hours, and with no orders or positions open. + Change account type (applies to both master, and subaccounts). Downgrades can be performed once every 24 hours. :param account_index: (required) :type account_index: int @@ -1609,7 +1610,7 @@ async def change_account_tier_with_http_info( ) -> ApiResponse[RespChangeAccountTier]: """changeAccountTier - Change account tier. You can only perform this action once every 24 hours, and with no orders or positions open. + Change account type (applies to both master, and subaccounts). Downgrades can be performed once every 24 hours. :param account_index: (required) :type account_index: int @@ -1684,7 +1685,7 @@ async def change_account_tier_without_preload_content( ) -> RESTResponseType: """changeAccountTier - Change account tier. You can only perform this action once every 24 hours, and with no orders or positions open. + Change account type (applies to both master, and subaccounts). Downgrades can be performed once every 24 hours. :param account_index: (required) :type account_index: int @@ -2371,6 +2372,7 @@ async def leaderboard( authorization: Optional[StrictStr] = None, l1_address: Optional[StrictStr] = None, competition_id: Optional[StrictStr] = None, + auth: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2386,7 +2388,7 @@ async def leaderboard( ) -> Leaderboard: """leaderboard - Get points leaderboard. Type should be all. + Get points leaderboard :param type: (required) :type type: str @@ -2396,6 +2398,8 @@ async def leaderboard( :type l1_address: str :param competition_id: :type competition_id: str + :param auth: + :type auth: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2423,6 +2427,7 @@ async def leaderboard( authorization=authorization, l1_address=l1_address, competition_id=competition_id, + auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2450,6 +2455,7 @@ async def leaderboard_with_http_info( authorization: Optional[StrictStr] = None, l1_address: Optional[StrictStr] = None, competition_id: Optional[StrictStr] = None, + auth: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2465,7 +2471,7 @@ async def leaderboard_with_http_info( ) -> ApiResponse[Leaderboard]: """leaderboard - Get points leaderboard. Type should be all. + Get points leaderboard :param type: (required) :type type: str @@ -2475,6 +2481,8 @@ async def leaderboard_with_http_info( :type l1_address: str :param competition_id: :type competition_id: str + :param auth: + :type auth: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2502,6 +2510,7 @@ async def leaderboard_with_http_info( authorization=authorization, l1_address=l1_address, competition_id=competition_id, + auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2529,6 +2538,7 @@ async def leaderboard_without_preload_content( authorization: Optional[StrictStr] = None, l1_address: Optional[StrictStr] = None, competition_id: Optional[StrictStr] = None, + auth: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2544,7 +2554,7 @@ async def leaderboard_without_preload_content( ) -> RESTResponseType: """leaderboard - Get points leaderboard. Type should be all. + Get points leaderboard :param type: (required) :type type: str @@ -2554,6 +2564,8 @@ async def leaderboard_without_preload_content( :type l1_address: str :param competition_id: :type competition_id: str + :param auth: + :type auth: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2581,6 +2593,7 @@ async def leaderboard_without_preload_content( authorization=authorization, l1_address=l1_address, competition_id=competition_id, + auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2604,6 +2617,7 @@ def _leaderboard_serialize( authorization, l1_address, competition_id, + auth, _request_auth, _content_type, _headers, @@ -2636,6 +2650,10 @@ def _leaderboard_serialize( _query_params.append(('competition_id', competition_id)) + if auth is not None: + + _query_params.append(('auth', auth)) + # process the header parameters if authorization is not None: _header_params['authorization'] = authorization @@ -4556,6 +4574,351 @@ def _pnl_serialize( + async def pnl_leaderboard( + self, + time_window: StrictStr, + sort_by: StrictStr, + sort_dir: StrictStr, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], + offset: Annotated[int, Field(le=100000, strict=True, ge=0)], + search: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PnlLeaderboard: + """pnlLeaderboard + + Get pnl leaderboard + + :param time_window: (required) + :type time_window: str + :param sort_by: (required) + :type sort_by: str + :param sort_dir: (required) + :type sort_dir: str + :param limit: (required) + :type limit: int + :param offset: (required) + :type offset: int + :param search: + :type search: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pnl_leaderboard_serialize( + time_window=time_window, + sort_by=sort_by, + sort_dir=sort_dir, + limit=limit, + offset=offset, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PnlLeaderboard", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + async def pnl_leaderboard_with_http_info( + self, + time_window: StrictStr, + sort_by: StrictStr, + sort_dir: StrictStr, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], + offset: Annotated[int, Field(le=100000, strict=True, ge=0)], + search: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PnlLeaderboard]: + """pnlLeaderboard + + Get pnl leaderboard + + :param time_window: (required) + :type time_window: str + :param sort_by: (required) + :type sort_by: str + :param sort_dir: (required) + :type sort_dir: str + :param limit: (required) + :type limit: int + :param offset: (required) + :type offset: int + :param search: + :type search: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pnl_leaderboard_serialize( + time_window=time_window, + sort_by=sort_by, + sort_dir=sort_dir, + limit=limit, + offset=offset, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PnlLeaderboard", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + async def pnl_leaderboard_without_preload_content( + self, + time_window: StrictStr, + sort_by: StrictStr, + sort_dir: StrictStr, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], + offset: Annotated[int, Field(le=100000, strict=True, ge=0)], + search: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """pnlLeaderboard + + Get pnl leaderboard + + :param time_window: (required) + :type time_window: str + :param sort_by: (required) + :type sort_by: str + :param sort_dir: (required) + :type sort_dir: str + :param limit: (required) + :type limit: int + :param offset: (required) + :type offset: int + :param search: + :type search: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pnl_leaderboard_serialize( + time_window=time_window, + sort_by=sort_by, + sort_dir=sort_dir, + limit=limit, + offset=offset, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PnlLeaderboard", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pnl_leaderboard_serialize( + self, + time_window, + sort_by, + sort_dir, + limit, + offset, + search, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if time_window is not None: + + _query_params.append(('time_window', time_window)) + + if sort_by is not None: + + _query_params.append(('sort_by', sort_by)) + + if sort_dir is not None: + + _query_params.append(('sort_dir', sort_dir)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if offset is not None: + + _query_params.append(('offset', offset)) + + if search is not None: + + _query_params.append(('search', search)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/pnlLeaderboard', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + async def position_funding( self, account_index: StrictInt, diff --git a/lighter/api/funding_api.py b/lighter/api/funding_api.py index 9095e822..9309b905 100644 --- a/lighter/api/funding_api.py +++ b/lighter/api/funding_api.py @@ -53,7 +53,7 @@ async def funding_rates( ) -> FundingRates: """funding-rates - Get funding rates + Get funding rates across venues. For real-time funding rates, use the market_stats WebSocket channel. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -116,7 +116,7 @@ async def funding_rates_with_http_info( ) -> ApiResponse[FundingRates]: """funding-rates - Get funding rates + Get funding rates across venues. For real-time funding rates, use the market_stats WebSocket channel. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -179,7 +179,7 @@ async def funding_rates_without_preload_content( ) -> RESTResponseType: """funding-rates - Get funding rates + Get funding rates across venues. For real-time funding rates, use the market_stats WebSocket channel. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request diff --git a/lighter/api/livepoints_api.py b/lighter/api/livepoints_api.py index eeb8af20..3a97d8cd 100644 --- a/lighter/api/livepoints_api.py +++ b/lighter/api/livepoints_api.py @@ -57,7 +57,7 @@ async def live_points_total( ) -> LivePointsTotal: """livePoints_total - Get live points total for an account + Get RH live points total for an account :param account_index: (required) :type account_index: int @@ -128,7 +128,7 @@ async def live_points_total_with_http_info( ) -> ApiResponse[LivePointsTotal]: """livePoints_total - Get live points total for an account + Get RH live points total for an account :param account_index: (required) :type account_index: int @@ -199,7 +199,7 @@ async def live_points_total_without_preload_content( ) -> RESTResponseType: """livePoints_total - Get live points total for an account + Get RH live points total for an account :param account_index: (required) :type account_index: int diff --git a/lighter/api/order_api.py b/lighter/api/order_api.py index 6df1c42e..522dec27 100644 --- a/lighter/api/order_api.py +++ b/lighter/api/order_api.py @@ -22,6 +22,7 @@ from lighter.models.asset_details import AssetDetails from lighter.models.exchange_stats import ExchangeStats from lighter.models.export_data import ExportData +from lighter.models.historical_trades_export_data import HistoricalTradesExportData from lighter.models.order_book_details import OrderBookDetails from lighter.models.order_book_orders import OrderBookOrders from lighter.models.order_books import OrderBooks @@ -2511,6 +2512,317 @@ def _export_serialize( + async def export_historical_trades( + self, + l1_address: StrictStr, + var_date: Annotated[StrictStr, Field(description=" UTC day, YYYY-MM-DD")], + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> HistoricalTradesExportData: + """export_historicalTrades + + Export global historical trades, updated daily at 8 PM UTC. Requires a one-time 100 LIT L2Transfer to 0x4FD058F25bE85E459ec552cA8e4C696FD1D34125. Returns a presigned S3 URL valid for 1 hour. + + :param l1_address: (required) + :type l1_address: str + :param var_date: UTC day, YYYY-MM-DD (required) + :type var_date: str + :param authorization: make required after integ is done + :type authorization: str + :param auth: made optional to support header auth clients + :type auth: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._export_historical_trades_serialize( + l1_address=l1_address, + var_date=var_date, + authorization=authorization, + auth=auth, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HistoricalTradesExportData", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + async def export_historical_trades_with_http_info( + self, + l1_address: StrictStr, + var_date: Annotated[StrictStr, Field(description=" UTC day, YYYY-MM-DD")], + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[HistoricalTradesExportData]: + """export_historicalTrades + + Export global historical trades, updated daily at 8 PM UTC. Requires a one-time 100 LIT L2Transfer to 0x4FD058F25bE85E459ec552cA8e4C696FD1D34125. Returns a presigned S3 URL valid for 1 hour. + + :param l1_address: (required) + :type l1_address: str + :param var_date: UTC day, YYYY-MM-DD (required) + :type var_date: str + :param authorization: make required after integ is done + :type authorization: str + :param auth: made optional to support header auth clients + :type auth: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._export_historical_trades_serialize( + l1_address=l1_address, + var_date=var_date, + authorization=authorization, + auth=auth, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HistoricalTradesExportData", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + async def export_historical_trades_without_preload_content( + self, + l1_address: StrictStr, + var_date: Annotated[StrictStr, Field(description=" UTC day, YYYY-MM-DD")], + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """export_historicalTrades + + Export global historical trades, updated daily at 8 PM UTC. Requires a one-time 100 LIT L2Transfer to 0x4FD058F25bE85E459ec552cA8e4C696FD1D34125. Returns a presigned S3 URL valid for 1 hour. + + :param l1_address: (required) + :type l1_address: str + :param var_date: UTC day, YYYY-MM-DD (required) + :type var_date: str + :param authorization: make required after integ is done + :type authorization: str + :param auth: made optional to support header auth clients + :type auth: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._export_historical_trades_serialize( + l1_address=l1_address, + var_date=var_date, + authorization=authorization, + auth=auth, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HistoricalTradesExportData", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _export_historical_trades_serialize( + self, + l1_address, + var_date, + authorization, + auth, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # 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)) + + if l1_address is not None: + + _query_params.append(('l1_address', l1_address)) + + if var_date is not None: + + _query_params.append(('date', var_date)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/export/historicalTrades', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + async def order_book_details( self, market_id: Optional[StrictInt] = None, diff --git a/lighter/api/referral_api.py b/lighter/api/referral_api.py index 02e772e7..5c0163e8 100644 --- a/lighter/api/referral_api.py +++ b/lighter/api/referral_api.py @@ -16,11 +16,12 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr +from pydantic import Field, StrictBool, StrictInt, StrictStr from typing import Optional, Union from typing_extensions import Annotated from lighter.models.referral_code import ReferralCode from lighter.models.referral_points import ReferralPoints +from lighter.models.referral_stats import ReferralStats from lighter.models.resp_update_kickback import RespUpdateKickback from lighter.models.resp_update_referral_code import RespUpdateReferralCode from lighter.models.result_code import ResultCode @@ -1180,6 +1181,315 @@ def _referral_points_serialize( + async def referral_stats( + self, + l1_address: StrictStr, + authorization: Optional[StrictStr] = None, + auth: Optional[StrictStr] = None, + is_eligible: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ReferralStats: + """referral_stats + + Get trade stats summed across a referrer's referred users + + :param l1_address: (required) + :type l1_address: str + :param authorization: + :type authorization: str + :param auth: + :type auth: str + :param is_eligible: + :type is_eligible: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._referral_stats_serialize( + l1_address=l1_address, + authorization=authorization, + auth=auth, + is_eligible=is_eligible, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReferralStats", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + async def referral_stats_with_http_info( + self, + l1_address: StrictStr, + authorization: Optional[StrictStr] = None, + auth: Optional[StrictStr] = None, + is_eligible: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ReferralStats]: + """referral_stats + + Get trade stats summed across a referrer's referred users + + :param l1_address: (required) + :type l1_address: str + :param authorization: + :type authorization: str + :param auth: + :type auth: str + :param is_eligible: + :type is_eligible: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._referral_stats_serialize( + l1_address=l1_address, + authorization=authorization, + auth=auth, + is_eligible=is_eligible, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReferralStats", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + async def referral_stats_without_preload_content( + self, + l1_address: StrictStr, + authorization: Optional[StrictStr] = None, + auth: Optional[StrictStr] = None, + is_eligible: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """referral_stats + + Get trade stats summed across a referrer's referred users + + :param l1_address: (required) + :type l1_address: str + :param authorization: + :type authorization: str + :param auth: + :type auth: str + :param is_eligible: + :type is_eligible: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._referral_stats_serialize( + l1_address=l1_address, + authorization=authorization, + auth=auth, + is_eligible=is_eligible, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReferralStats", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _referral_stats_serialize( + self, + l1_address, + authorization, + auth, + is_eligible, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if auth is not None: + + _query_params.append(('auth', auth)) + + if l1_address is not None: + + _query_params.append(('l1_address', l1_address)) + + if is_eligible is not None: + + _query_params.append(('is_eligible', is_eligible)) + + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/referral/stats', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + async def referral_update( self, account_index: StrictInt, @@ -1490,6 +1800,7 @@ async def referral_use( telegram: Optional[StrictStr] = None, x: Optional[StrictStr] = None, signature: Optional[StrictStr] = None, + source: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1521,6 +1832,8 @@ async def referral_use( :type x: str :param signature: :type signature: str + :param source: + :type source: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1551,6 +1864,7 @@ async def referral_use( telegram=telegram, x=x, signature=signature, + source=source, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1581,6 +1895,7 @@ async def referral_use_with_http_info( telegram: Optional[StrictStr] = None, x: Optional[StrictStr] = None, signature: Optional[StrictStr] = None, + source: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1612,6 +1927,8 @@ async def referral_use_with_http_info( :type x: str :param signature: :type signature: str + :param source: + :type source: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1642,6 +1959,7 @@ async def referral_use_with_http_info( telegram=telegram, x=x, signature=signature, + source=source, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1672,6 +1990,7 @@ async def referral_use_without_preload_content( telegram: Optional[StrictStr] = None, x: Optional[StrictStr] = None, signature: Optional[StrictStr] = None, + source: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1703,6 +2022,8 @@ async def referral_use_without_preload_content( :type x: str :param signature: :type signature: str + :param source: + :type source: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1733,6 +2054,7 @@ async def referral_use_without_preload_content( telegram=telegram, x=x, signature=signature, + source=source, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1759,6 +2081,7 @@ def _referral_use_serialize( telegram, x, signature, + source, _request_auth, _content_type, _headers, @@ -1795,6 +2118,8 @@ def _referral_use_serialize( _form_params.append(('x', x)) if signature is not None: _form_params.append(('signature', signature)) + if source is not None: + _form_params.append(('source', source)) # process the body parameter diff --git a/lighter/models/__init__.py b/lighter/models/__init__.py index 02195384..3ec0bb35 100644 --- a/lighter/models/__init__.py +++ b/lighter/models/__init__.py @@ -53,6 +53,7 @@ from lighter.models.funding_rate import FundingRate from lighter.models.funding_rates import FundingRates from lighter.models.fundings import Fundings +from lighter.models.historical_trades_export_data import HistoricalTradesExportData from lighter.models.l1_metadata import L1Metadata from lighter.models.l1_provider_info import L1ProviderInfo from lighter.models.layer1_basic_info import Layer1BasicInfo @@ -82,6 +83,8 @@ from lighter.models.pending_unlock import PendingUnlock from lighter.models.perps_order_book_detail import PerpsOrderBookDetail from lighter.models.pn_l_entry import PnLEntry +from lighter.models.pnl_leaderboard import PnlLeaderboard +from lighter.models.pnl_leaderboard_entry import PnlLeaderboardEntry from lighter.models.position_funding import PositionFunding from lighter.models.position_fundings import PositionFundings from lighter.models.public_pool_info import PublicPoolInfo @@ -95,6 +98,8 @@ from lighter.models.referral_point_entry import ReferralPointEntry from lighter.models.referral_points import ReferralPoints from lighter.models.referral_program_kickback import ReferralProgramKickback +from lighter.models.referral_stat import ReferralStat +from lighter.models.referral_stats import ReferralStats from lighter.models.referral_totals import ReferralTotals from lighter.models.req_set_account_metadata import ReqSetAccountMetadata from lighter.models.resp_change_account_tier import RespChangeAccountTier diff --git a/lighter/models/account_metadata.py b/lighter/models/account_metadata.py index be870e70..9198e845 100644 --- a/lighter/models/account_metadata.py +++ b/lighter/models/account_metadata.py @@ -36,8 +36,9 @@ class AccountMetadata(BaseModel): can_rfq: StrictBool can_rfq_market_ids: List[StrictStr] metadata: SubAccountMetadata + agent_enabled: StrictBool additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["account_index", "name", "description", "can_invite", "referral_points_percentage", "created_at", "can_rfq", "can_rfq_market_ids", "metadata"] + __properties: ClassVar[List[str]] = ["account_index", "name", "description", "can_invite", "referral_points_percentage", "created_at", "can_rfq", "can_rfq_market_ids", "metadata", "agent_enabled"] model_config = ConfigDict( populate_by_name=True, @@ -108,7 +109,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "created_at": obj.get("created_at"), "can_rfq": obj.get("can_rfq"), "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 + "metadata": SubAccountMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "agent_enabled": obj.get("agent_enabled") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/asset.py b/lighter/models/asset.py index 46f70d1f..9a9f8074 100644 --- a/lighter/models/asset.py +++ b/lighter/models/asset.py @@ -50,8 +50,8 @@ class Asset(BaseModel): @field_validator('margin_mode') def margin_mode_validate_enum(cls, value): """Validates the enum""" - if value not in set(['enabled', 'disabled']): - raise ValueError("must be one of enum values ('enabled', 'disabled')") + if value not in set(['enabled', 'disabled', 'priced_only']): + raise ValueError("must be one of enum values ('enabled', 'disabled', 'priced_only')") return value model_config = ConfigDict( diff --git a/lighter/models/detailed_account.py b/lighter/models/detailed_account.py index 866349d4..7a0fea5f 100644 --- a/lighter/models/detailed_account.py +++ b/lighter/models/detailed_account.py @@ -66,8 +66,9 @@ class DetailedAccount(BaseModel): cross_maintenance_margin_requirement: StrictStr can_rfq_market_ids: List[StrictStr] metadata: SubAccountMetadata + agent_enabled: StrictBool 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"] + __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"] model_config = ConfigDict( populate_by_name=True, @@ -200,7 +201,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "cross_initial_margin_requirement": obj.get("cross_initial_margin_requirement"), "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 + "metadata": SubAccountMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "agent_enabled": obj.get("agent_enabled") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/historical_trades_export_data.py b/lighter/models/historical_trades_export_data.py new file mode 100644 index 00000000..7d2b9a6e --- /dev/null +++ b/lighter/models/historical_trades_export_data.py @@ -0,0 +1,106 @@ +# 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class HistoricalTradesExportData(BaseModel): + """ + HistoricalTradesExportData + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + data_url: StrictStr + expires_at: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "data_url", "expires_at"] + + 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 HistoricalTradesExportData 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 HistoricalTradesExportData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "code": obj.get("code"), + "message": obj.get("message"), + "data_url": obj.get("data_url"), + "expires_at": obj.get("expires_at") + }) + # 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/liq_trade.py b/lighter/models/liq_trade.py index 5d00ace3..47a9ffcd 100644 --- a/lighter/models/liq_trade.py +++ b/lighter/models/liq_trade.py @@ -31,8 +31,10 @@ class LiqTrade(BaseModel): taker_fee: StrictStr maker_fee: StrictStr transaction_time: StrictInt + bid_account_id: StrictInt + ask_account_id: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["price", "size", "taker_fee", "maker_fee", "transaction_time"] + __properties: ClassVar[List[str]] = ["price", "size", "taker_fee", "maker_fee", "transaction_time", "bid_account_id", "ask_account_id"] model_config = ConfigDict( populate_by_name=True, @@ -96,7 +98,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "size": obj.get("size"), "taker_fee": obj.get("taker_fee"), "maker_fee": obj.get("maker_fee"), - "transaction_time": obj.get("transaction_time") + "transaction_time": obj.get("transaction_time"), + "bid_account_id": obj.get("bid_account_id"), + "ask_account_id": obj.get("ask_account_id") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/order.py b/lighter/models/order.py index 3a9d5967..69a3ae80 100644 --- a/lighter/models/order.py +++ b/lighter/models/order.py @@ -64,8 +64,9 @@ class Order(BaseModel): integrator_maker_fee: StrictStr integrator_taker_fee: StrictStr order_flags: StrictInt + order_version: StrictInt 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"] + __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"] @field_validator('type') def type_validate_enum(cls, value): @@ -190,7 +191,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "integrator_fee_collector_index": obj.get("integrator_fee_collector_index"), "integrator_maker_fee": obj.get("integrator_maker_fee"), "integrator_taker_fee": obj.get("integrator_taker_fee"), - "order_flags": obj.get("order_flags") + "order_flags": obj.get("order_flags"), + "order_version": obj.get("order_version") }) # 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 608ed5e9..b77c4d14 100644 --- a/lighter/models/perps_order_book_detail.py +++ b/lighter/models/perps_order_book_detail.py @@ -18,7 +18,7 @@ import json from pydantic import BaseModel, ConfigDict, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Any, ClassVar, Dict, List, Union from lighter.models.market_config import MarketConfig from typing import Optional, Set from typing_extensions import Self @@ -66,11 +66,11 @@ class PerpsOrderBookDetail(BaseModel): funding_clamp_big: StrictStr base_interest_rate: StrictStr created_at: StrictStr - mark_price: Optional[StrictStr] = None - index_price: Optional[StrictStr] = None - multiplier: Optional[StrictStr] = None - market_flags: Optional[StrictInt] = None - funding_premium_multiplier: Optional[StrictInt] = None + mark_price: StrictStr + index_price: StrictStr + multiplier: StrictStr + market_flags: StrictInt + funding_premium_multiplier: StrictInt 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"] diff --git a/lighter/models/pnl_leaderboard.py b/lighter/models/pnl_leaderboard.py new file mode 100644 index 00000000..e75c524e --- /dev/null +++ b/lighter/models/pnl_leaderboard.py @@ -0,0 +1,116 @@ +# 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from lighter.models.pnl_leaderboard_entry import PnlLeaderboardEntry +from typing import Optional, Set +from typing_extensions import Self + +class PnlLeaderboard(BaseModel): + """ + PnlLeaderboard + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + entries: List[PnlLeaderboardEntry] + total: StrictInt + updated_at: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "entries", "total", "updated_at"] + + 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 PnlLeaderboard 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, + ) + # override the default output from pydantic by calling `to_dict()` of each item in entries (list) + _items = [] + if self.entries: + for _item in self.entries: + if _item: + _items.append(_item.to_dict()) + _dict['entries'] = _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(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PnlLeaderboard from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "code": obj.get("code"), + "message": obj.get("message"), + "entries": [PnlLeaderboardEntry.from_dict(_item) for _item in obj["entries"]] if obj.get("entries") is not None else None, + "total": obj.get("total"), + "updated_at": obj.get("updated_at") + }) + # 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/pnl_leaderboard_entry.py b/lighter/models/pnl_leaderboard_entry.py new file mode 100644 index 00000000..103048c2 --- /dev/null +++ b/lighter/models/pnl_leaderboard_entry.py @@ -0,0 +1,110 @@ +# 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, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self + +class PnlLeaderboardEntry(BaseModel): + """ + PnlLeaderboardEntry + """ # noqa: E501 + rank: StrictInt + l1_address: StrictStr + account_value: Union[StrictFloat, StrictInt] + pnl: Union[StrictFloat, StrictInt] + roi: Union[StrictFloat, StrictInt] + volume: Union[StrictFloat, StrictInt] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["rank", "l1_address", "account_value", "pnl", "roi", "volume"] + + 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 PnlLeaderboardEntry 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 PnlLeaderboardEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "rank": obj.get("rank"), + "l1_address": obj.get("l1_address"), + "account_value": obj.get("account_value"), + "pnl": obj.get("pnl"), + "roi": obj.get("roi"), + "volume": obj.get("volume") + }) + # 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/referral.py b/lighter/models/referral.py index 7d91b9d2..3f3603fb 100644 --- a/lighter/models/referral.py +++ b/lighter/models/referral.py @@ -32,8 +32,9 @@ class Referral(BaseModel): used_at: StrictInt trade_stats: TradeStats tier: StrictStr + source: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["l1_address", "referral_code", "used_at", "trade_stats", "tier"] + __properties: ClassVar[List[str]] = ["l1_address", "referral_code", "used_at", "trade_stats", "tier", "source"] model_config = ConfigDict( populate_by_name=True, @@ -100,7 +101,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "referral_code": obj.get("referral_code"), "used_at": obj.get("used_at"), "trade_stats": TradeStats.from_dict(obj["trade_stats"]) if obj.get("trade_stats") is not None else None, - "tier": obj.get("tier") + "tier": obj.get("tier"), + "source": obj.get("source") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/referral_stat.py b/lighter/models/referral_stat.py new file mode 100644 index 00000000..9c2facf0 --- /dev/null +++ b/lighter/models/referral_stat.py @@ -0,0 +1,108 @@ +# 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, StrictInt +from typing import Any, ClassVar, Dict, List +from lighter.models.trade_stats import TradeStats +from typing import Optional, Set +from typing_extensions import Self + +class ReferralStat(BaseModel): + """ + ReferralStat + """ # noqa: E501 + start_timestamp: StrictInt + end_timestamp: StrictInt + trade_stats: TradeStats + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["start_timestamp", "end_timestamp", "trade_stats"] + + 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 ReferralStat 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, + ) + # override the default output from pydantic by calling `to_dict()` of trade_stats + if self.trade_stats: + _dict['trade_stats'] = self.trade_stats.to_dict() + # 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 ReferralStat from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "start_timestamp": obj.get("start_timestamp"), + "end_timestamp": obj.get("end_timestamp"), + "trade_stats": TradeStats.from_dict(obj["trade_stats"]) if obj.get("trade_stats") is not None else None + }) + # 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/referral_stats.py b/lighter/models/referral_stats.py new file mode 100644 index 00000000..e2f3ecfd --- /dev/null +++ b/lighter/models/referral_stats.py @@ -0,0 +1,112 @@ +# 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from lighter.models.referral_stat import ReferralStat +from typing import Optional, Set +from typing_extensions import Self + +class ReferralStats(BaseModel): + """ + ReferralStats + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + stats: List[ReferralStat] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "stats"] + + 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 ReferralStats 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, + ) + # override the default output from pydantic by calling `to_dict()` of each item in stats (list) + _items = [] + if self.stats: + for _item in self.stats: + if _item: + _items.append(_item.to_dict()) + _dict['stats'] = _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(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ReferralStats from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "code": obj.get("code"), + "message": obj.get("message"), + "stats": [ReferralStat.from_dict(_item) for _item in obj["stats"]] if obj.get("stats") is not None else None + }) + # 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/rfq_metadata.py b/lighter/models/rfq_metadata.py index 26f88ff9..f3ede35f 100644 --- a/lighter/models/rfq_metadata.py +++ b/lighter/models/rfq_metadata.py @@ -31,8 +31,9 @@ class RFQMetadata(BaseModel): requested_slippage: StrictStr worst_price: StrictStr mark_price: StrictStr + requested_est_fill_fraction: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["requested_est_price", "requested_max_slippage", "requested_slippage", "worst_price", "mark_price"] + __properties: ClassVar[List[str]] = ["requested_est_price", "requested_max_slippage", "requested_slippage", "worst_price", "mark_price", "requested_est_fill_fraction"] model_config = ConfigDict( populate_by_name=True, @@ -96,7 +97,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "requested_max_slippage": obj.get("requested_max_slippage"), "requested_slippage": obj.get("requested_slippage"), "worst_price": obj.get("worst_price"), - "mark_price": obj.get("mark_price") + "mark_price": obj.get("mark_price"), + "requested_est_fill_fraction": obj.get("requested_est_fill_fraction") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/risk_parameters.py b/lighter/models/risk_parameters.py index e86e7012..f98c770d 100644 --- a/lighter/models/risk_parameters.py +++ b/lighter/models/risk_parameters.py @@ -18,7 +18,7 @@ import json from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self @@ -35,7 +35,7 @@ class RiskParameters(BaseModel): total_account_liquidation_threshold: StrictStr usdc_collateral_with_funding: StrictStr usdc_portfolio_value: StrictStr - total_portfolio_value: Optional[StrictStr] = None + total_portfolio_value: StrictStr additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["market_id", "collateral", "total_account_value", "initial_margin_req", "maintenance_margin_req", "close_out_margin_req", "total_account_liquidation_threshold", "usdc_collateral_with_funding", "usdc_portfolio_value", "total_portfolio_value"] diff --git a/lighter/models/system_config.py b/lighter/models/system_config.py index 1e711186..8bfefd41 100644 --- a/lighter/models/system_config.py +++ b/lighter/models/system_config.py @@ -37,9 +37,10 @@ class SystemConfig(BaseModel): max_integrator_perps_taker_fee: StrictInt max_integrator_spot_maker_fee: StrictInt max_integrator_spot_taker_fee: StrictInt - market_maker_incentive_account_index: StrictInt + market_maker_incentive_account_index: Optional[StrictInt] = None + fee_collector_account_index: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "liquidity_pool_index", "staking_pool_index", "funding_fee_rebate_account_index", "liquidity_pool_cooldown_period", "staking_pool_lockup_period", "max_integrator_perps_maker_fee", "max_integrator_perps_taker_fee", "max_integrator_spot_maker_fee", "max_integrator_spot_taker_fee", "market_maker_incentive_account_index"] + __properties: ClassVar[List[str]] = ["code", "message", "liquidity_pool_index", "staking_pool_index", "funding_fee_rebate_account_index", "liquidity_pool_cooldown_period", "staking_pool_lockup_period", "max_integrator_perps_maker_fee", "max_integrator_perps_taker_fee", "max_integrator_spot_maker_fee", "max_integrator_spot_taker_fee", "market_maker_incentive_account_index", "fee_collector_account_index"] model_config = ConfigDict( populate_by_name=True, @@ -110,7 +111,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "max_integrator_perps_taker_fee": obj.get("max_integrator_perps_taker_fee"), "max_integrator_spot_maker_fee": obj.get("max_integrator_spot_maker_fee"), "max_integrator_spot_taker_fee": obj.get("max_integrator_spot_taker_fee"), - "market_maker_incentive_account_index": obj.get("market_maker_incentive_account_index") + "market_maker_incentive_account_index": obj.get("market_maker_incentive_account_index"), + "fee_collector_account_index": obj.get("fee_collector_account_index") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/token.py b/lighter/models/token.py index 0819cfcb..785de1fd 100644 --- a/lighter/models/token.py +++ b/lighter/models/token.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self @@ -38,8 +38,10 @@ class Token(BaseModel): categories: List[StrictStr] is_allowed_mainnet: StrictBool is_asset_allowed_mainnet: StrictBool + default_order_book_group_by: StrictInt + backend_symbol: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["symbol", "name", "logo", "logo_extension", "description_key", "gecko_id", "paprika_id", "market", "asset_type", "categories", "is_allowed_mainnet", "is_asset_allowed_mainnet"] + __properties: ClassVar[List[str]] = ["symbol", "name", "logo", "logo_extension", "description_key", "gecko_id", "paprika_id", "market", "asset_type", "categories", "is_allowed_mainnet", "is_asset_allowed_mainnet", "default_order_book_group_by", "backend_symbol"] @field_validator('logo_extension') def logo_extension_validate_enum(cls, value): @@ -131,7 +133,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "asset_type": obj.get("asset_type"), "categories": obj.get("categories"), "is_allowed_mainnet": obj.get("is_allowed_mainnet"), - "is_asset_allowed_mainnet": obj.get("is_asset_allowed_mainnet") + "is_asset_allowed_mainnet": obj.get("is_asset_allowed_mainnet"), + "default_order_book_group_by": obj.get("default_order_book_group_by"), + "backend_symbol": obj.get("backend_symbol") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/openapi.json b/openapi.json index 4c4656d0..d75e75a7 100644 --- a/openapi.json +++ b/openapi.json @@ -973,7 +973,7 @@ "tags": [ "account" ], - "description": "Change account tier. You can only perform this action once every 24 hours, and with no orders or positions open.", + "description": "Change account type (applies to both master, and subaccounts). Downgrades can be performed once every 24 hours.", "parameters": [ { "name": "authorization", @@ -1351,7 +1351,7 @@ "tags": [ "funding" ], - "description": "Get funding rates", + "description": "Get funding rates across venues. For real-time funding rates, use the market_stats WebSocket channel.", "responses": { "200": { "description": "A successful response.", @@ -4912,7 +4912,7 @@ "tags": [ "livepoints" ], - "description": "Get live points total for an account", + "description": "Get RH live points total for an account", "parameters": [ { "name": "authorization", @@ -4963,7 +4963,7 @@ "tags": [ "account" ], - "description": "Get points leaderboard. Type should be all.", + "description": "Get points leaderboard", "parameters": [ { "name": "authorization", @@ -5001,6 +5001,14 @@ "schema": { "type": "string" } + }, + { + "name": "auth", + "in": "query", + "required": false, + "schema": { + "type": "string" + } } ], "responses": { @@ -5026,11 +5034,257 @@ } } } + }, + "/api/v1/referral/stats": { + "get": { + "summary": "referral_stats", + "operationId": "referral_stats", + "tags": [ + "referral" + ], + "description": "Get trade stats summed across a referrer's referred users", + "parameters": [ + { + "name": "authorization", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "auth", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "l1_address", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "is_eligible", + "in": "query", + "required": false, + "schema": { + "type": "boolean", + "format": "boolean", + "default": "false" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReferralStats" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } + } + }, + "/api/v1/export/historicalTrades": { + "get": { + "summary": "export_historicalTrades", + "operationId": "export_historicalTrades", + "tags": [ + "order" + ], + "description": "Export global historical trades, updated daily at 8 PM UTC. Requires a one-time 100 LIT L2Transfer to 0x4FD058F25bE85E459ec552cA8e4C696FD1D34125. Returns a presigned S3 URL valid for 1 hour.", + "parameters": [ + { + "name": "authorization", + "in": "query", + "description": " make required after integ is done", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "auth", + "in": "query", + "description": " made optional to support header auth clients", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "l1_address", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "date", + "in": "query", + "description": " UTC day, YYYY-MM-DD", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HistoricalTradesExportData" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } + } + }, + "/api/v1/pnlLeaderboard": { + "get": { + "summary": "pnlLeaderboard", + "operationId": "pnlLeaderboard", + "tags": [ + "account" + ], + "description": "Get pnl leaderboard", + "parameters": [ + { + "name": "time_window", + "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ + "24h", + "7d", + "30d", + "all" + ], + "default": "all" + } + }, + { + "name": "sort_by", + "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ + "pnl", + "roi", + "volume", + "account_value" + ], + "default": "pnl" + } + }, + { + "name": "sort_dir", + "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "desc" + } + }, + { + "name": "limit", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "uint8", + "default": "10", + "minimum": 1, + "maximum": 100 + } + }, + { + "name": "offset", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int32", + "default": "0", + "minimum": 0, + "maximum": 100000 + } + }, + { + "name": "search", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PnlLeaderboard" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } + } } }, "servers": [ { - "url": "https://mainnet.zklighter.elliot.ai" + "url": "https://mainnet.zklighter.elliot.ai/" } ], "components": { @@ -5309,6 +5563,10 @@ }, "metadata": { "$ref": "#/components/schemas/SubAccountMetadata" + }, + "agent_enabled": { + "type": "boolean", + "format": "boolean" } }, "title": "AccountMetadata", @@ -5320,6 +5578,7 @@ "referral_points_percentage", "can_rfq", "can_rfq_market_ids", + "agent_enabled", "created_at", "metadata" ] @@ -5568,7 +5827,8 @@ "example": "enabled", "enum": [ "enabled", - "disabled" + "disabled", + "priced_only" ] }, "index_price": { @@ -6223,6 +6483,10 @@ }, "metadata": { "$ref": "#/components/schemas/SubAccountMetadata" + }, + "agent_enabled": { + "type": "boolean", + "format": "boolean" } }, "title": "DetailedAccount", @@ -6246,6 +6510,7 @@ "referral_points_percentage", "can_rfq", "can_rfq_market_ids", + "agent_enabled", "created_at", "metadata", "positions", @@ -6675,6 +6940,16 @@ "transaction_time": { "type": "integer", "format": "int64" + }, + "bid_account_id": { + "type": "integer", + "format": "int64", + "example": "3" + }, + "ask_account_id": { + "type": "integer", + "format": "int64", + "example": "1" } }, "title": "LiqTrade", @@ -6683,7 +6958,9 @@ "size", "taker_fee", "maker_fee", - "transaction_time" + "transaction_time", + "ask_account_id", + "bid_account_id" ] }, "Liquidation": { @@ -7083,6 +7360,11 @@ "type": "integer", "format": "int64", "example": "1" + }, + "order_version": { + "type": "integer", + "format": "int64", + "example": "1" } }, "title": "Order", @@ -7124,7 +7406,8 @@ "timestamp", "created_at", "updated_at", - "transaction_time" + "transaction_time", + "order_version" ] }, "OrderBook": { @@ -7477,6 +7760,7 @@ "supported_price_decimals", "supported_quote_decimals", "created_at", + "multiplier", "size_decimals", "price_decimals", "quote_multiplier", @@ -7484,6 +7768,8 @@ "min_initial_margin_fraction", "maintenance_margin_fraction", "closeout_margin_fraction", + "mark_price", + "index_price", "last_trade_price", "daily_trades_count", "daily_base_token_volume", @@ -7495,6 +7781,8 @@ "daily_chart", "market_config", "strategy_index", + "market_flags", + "funding_premium_multiplier", "funding_clamp_small", "funding_clamp_big", "base_interest_rate" @@ -8679,7 +8967,8 @@ "total_account_liquidation_threshold", "collateral", "usdc_collateral_with_funding", - "usdc_portfolio_value" + "usdc_portfolio_value", + "total_portfolio_value" ] }, "SharePrice": { @@ -9853,6 +10142,9 @@ }, "signature": { "type": "string" + }, + "source": { + "type": "string" } }, "title": "ReqUseReferralCode", @@ -10428,14 +10720,18 @@ }, "tier": { "type": "string" + }, + "source": { + "type": "string" } }, "required": [ - "trade_stats", "l1_address", "referral_code", + "used_at", "tier", - "used_at" + "source", + "trade_stats" ] }, "UserReferrals": { @@ -10548,20 +10844,25 @@ "type": "integer", "format": "int64", "example": "3" + }, + "fee_collector_account_index": { + "type": "integer", + "format": "int64", + "example": "4" } }, "required": [ - "max_integrator_perps_maker_fee", - "max_integrator_perps_taker_fee", - "max_integrator_spot_maker_fee", - "max_integrator_spot_taker_fee", "code", - "funding_fee_rebate_account_index", - "liquidity_pool_cooldown_period", "liquidity_pool_index", "staking_pool_index", + "funding_fee_rebate_account_index", + "fee_collector_account_index", + "liquidity_pool_cooldown_period", "staking_pool_lockup_period", - "market_maker_incentive_account_index" + "max_integrator_spot_taker_fee", + "max_integrator_spot_maker_fee", + "max_integrator_perps_taker_fee", + "max_integrator_perps_maker_fee" ] }, "PendingUnlock": { @@ -10719,6 +11020,7 @@ "title": "Token", "required": [ "symbol", + "backend_symbol", "name", "logo", "logo_extension", @@ -10729,7 +11031,8 @@ "asset_type", "categories", "is_allowed_mainnet", - "is_asset_allowed_mainnet" + "is_asset_allowed_mainnet", + "default_order_book_group_by" ], "properties": { "symbol": { @@ -10791,6 +11094,15 @@ "is_asset_allowed_mainnet": { "type": "boolean", "format": "boolean" + }, + "default_order_book_group_by": { + "type": "integer", + "format": "int64", + "example": "10" + }, + "backend_symbol": { + "type": "string", + "example": "ETH" } } }, @@ -11028,6 +11340,9 @@ }, "mark_price": { "type": "string" + }, + "requested_est_fill_fraction": { + "type": "string" } }, "title": "RFQMetadata", @@ -11035,6 +11350,7 @@ "requested_est_price", "requested_max_slippage", "requested_slippage", + "requested_est_fill_fraction", "mark_price", "worst_price" ] @@ -11244,11 +11560,7 @@ }, "direction": { "type": "integer", - "format": "int16", - "enum": [ - "0", - "1" - ] + "format": "int16" }, "metadata": { "type": "string" @@ -11691,6 +12003,157 @@ "entryId", "metadata" ] + }, + "ReferralStats": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "stats": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReferralStat" + } + } + }, + "title": "ReferralStats", + "required": [ + "code", + "stats" + ] + }, + "ReferralStat": { + "type": "object", + "properties": { + "start_timestamp": { + "type": "integer", + "format": "int64" + }, + "end_timestamp": { + "type": "integer", + "format": "int64" + }, + "trade_stats": { + "$ref": "#/components/schemas/TradeStats" + } + }, + "title": "ReferralStat", + "required": [ + "start_timestamp", + "end_timestamp", + "trade_stats" + ] + }, + "HistoricalTradesExportData": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "data_url": { + "type": "string" + }, + "expires_at": { + "type": "string", + "example": "2025-01-02T00:00:00Z" + } + }, + "title": "HistoricalTradesExportData", + "required": [ + "code", + "data_url", + "expires_at" + ] + }, + "PnlLeaderboard": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "entries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PnlLeaderboardEntry" + } + }, + "total": { + "type": "integer", + "format": "int64", + "example": "41543" + }, + "updated_at": { + "type": "integer", + "format": "int64", + "example": "1754992800" + } + }, + "title": "PnlLeaderboard", + "required": [ + "code", + "entries", + "total", + "updated_at" + ] + }, + "PnlLeaderboardEntry": { + "type": "object", + "properties": { + "rank": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "l1_address": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "account_value": { + "type": "number", + "format": "double", + "example": "225006123.46" + }, + "pnl": { + "type": "number", + "format": "double", + "example": "445047878.27" + }, + "roi": { + "type": "number", + "format": "double", + "example": "26412.5721" + }, + "volume": { + "type": "number", + "format": "double", + "example": "15999.34" + } + }, + "title": "PnlLeaderboardEntry", + "required": [ + "rank", + "l1_address", + "account_value", + "pnl", + "roi", + "volume" + ] } } }