Skip to content

Double snapshot request required for data #107

@benbellick

Description

@benbellick

Describe the bug

Hello, awesome package! I have successfully connected to my paper trading account and everything is working great. However, when I want to make a request to get market snapshot data, e.g. last price, I have to make the request twice. This surprises me because it seems you have already accounted for this here.

Steps to Reproduce

from ibind import IbkrClient
# parameters are set from environment variables using oauth
client = IbkrClient()
def broken_get_last_price():
    return client.live_marketdata_snapshot_by_symbol('AAPL', snapshot_keys_to_ids(["last_price"]))    

# returns {'AAPL': {}}

def working_get_last_price():
    client.live_marketdata_snapshot_by_symbol('AAPL', snapshot_keys_to_ids(["last_price"]))
    return client.live_marketdata_snapshot_by_symbol('AAPL', snapshot_keys_to_ids(["last_price"])) 

# returns {'AAPL': {'market_data_availability': 'DPB', 'market_data_marker': 'q0', 'last_price': '211.05'}}

Expected Behaviour

I expected to only need to the function once to get the data, since implicitly that is already happening in the implementation.

Additional context

Possible Solution

Your Environment

  • IBind version: 0.1.14
  • Python version (e.g. 3.10): 3.13.2
  • Authentication method (Gateway, IBeam or OAuth): OAuth
  • Operating System and version: MacOS 15.4.1
  • Link to your project/code (if public) :

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions