Binance, How to Obtain Current Account Positions of Futures Contracts

See original GitHub issue

MUST READ THIS BEFORE SUBMITTING ISSUES (read the link, then delete this message before submitting):

https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-submit-an-issue

Please make sure your local version of ccxt is up to date with this repo. You can check by comparing the output of ccxt.version to https://github.com/ccxt/ccxt/blob/master/package.json#L3

  • OS: Windows 10
  • Programming Language version: Python 3.6
  • CCXT version: 2.26
  • Exchange: binance
  • Method: fetchBalance

Hi Team,

Could you please point me in the direction, how to retrieve the current position (the equivalent of the “Size” column you would see on their Futures Market web console) of a Futures contract in my Binance Futures Account (spot works absolutely fine). I have successfully pointed towards the fapi endpoint, it is just that the method .FetchBalance() does not seem to contain any information about the quantity of how many Futures the account owns (e.g.: for Bitmex, this is solved by using the method call “.private_get_position()”).

Could you please point me in the right direction (I am not sure this is an actual issue)?

Thank you very much in advance!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
kroitorcommented, Jun 2, 2021

@markoarnauto yes, we are working on unifying contract-trading positions, it’s a work in progress.

1reaction
kroitorcommented, Jun 11, 2020

@h-keskin

$id = 'binance';
// instantiate the exchange by id
$exchange = '\\ccxt\\' . $id;
$exchange = new $exchange(array(
    'enableRateLimit' => true,
    'apiKey' => 'YOUR_API_KEY',
    'secret' => 'YOUR_SECRET',
    'options' => array(
        'defaultType' => 'future',
    ),
));
$result = $exchange->fapiPrivate_get_positionrisk();
var_dump($result);

It’s basically a line-to-line equvalent.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to View My Trading Activity | Binance Support
Click on the [Transaction History] tab to view all activities in your futures account. Use the search bar to view a specific transaction...
Read more >
A Beginner's Guide to Futures Trading (Website) - Binance
Follow these steps to start trading on our Binance Futures platform: Deposit USDT, BUSD into your USDS-M Futures account as margin, ...
Read more >
Your Guide to Position Limit Adjustment | Binance Support
For App users, you can click [Futures] - [Settings] - [Position Limit Adjustment]. How do I adjust my position limit? Step 1: Check...
Read more >
How to Make Your First Trade on Binance Futures
To do so, go to Binance and click [Wallet] - [Futures]. Click [Transfer], select the [Coin], enter the [Amount] you'd like to transfer...
Read more >
The Ultimate Guide to Trading on Binance Futures
Before opening a Binance Futures account, you need a regular ... can view information relating to the current contract and your positions.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found