Discussions

Ask a Question

how to setup margin

I call the adjustMargin to add my margi ,but my margin ratio will change if my position has chnged. for example, i open a position with a 2k margin, I will adjust the margin to 4k, but it will change to return 2k when I change my position

how to add margin by api

how to add margin by api

Trying deposit & withdraw code

Hello Bluefin Team, I copy the deposit & withdraw code and run. But it response error as belows. Need help to fix it ``` Traceback (most recent call last): File "/home/bluefin/deposit_n_withdraw.py", line 45, in <module> asyncio.run(main()) File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete return future.result() File "/home/bluefin/deposit_n_withdraw.py", line 26, in main resp = await client.get_margin_bank_balance() File "/usr/local/lib/python3.10/dist-packages/bluefin_v2_client/client.py", line 760, in get_margin_bank_balance raise (Exception("Failed to get balance, Exception: {}".format(e))) Exception: Failed to get balance, Exception: 'data' Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x7fdafd58e6e0> Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x7fdafd58e980> Unclosed connector connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7fdafd575960>, 2071.017588417)]'] connector: <aiohttp.connector.TCPConnector object at 0x7fdafd58e860> ```