Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EXC-2344] Fetch default leverage from exchange info route #55

Merged
merged 3 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "bluefin_v2_client"
version = "4.2.12"
version = "4.2.13"
description = "Library to interact with Bluefin exchange protocol including its off-chain api-gateway and on-chain contracts"
readme = "README.md"
requires-python = ">=3.8"
Expand Down
6 changes: 4 additions & 2 deletions src/bluefin_v2_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,8 +1087,10 @@ async def get_user_leverage(self, symbol: MARKET_SYMBOLS, parentAddress: str = "
for i in account_data_by_market:
if symbol.value == i["symbol"]:
return from1e18(int(i["selectedLeverage"]))
# todo fetch from exchange info route
return DEAULT_EXCHANGE_LEVERAGE

exchange_info_by_market = await self.get_exchange_info(symbol)

return from1e18(int(exchange_info_by_market['defaultLeverage']))

async def get_cancel_on_disconnect_timer(
self, params: GetCancelOnDisconnectTimerRequest = None
Expand Down
Loading