Skip to content

get_product_trades start/end time and limit not working as expected #414

@Spotnag

Description

@Spotnag

Does not seem like start, end and limit are being taken into account.

start_time = datetime.datetime.strptime('2020-10-01 00:00:00', '%Y-%m-%d %H:%M:%S').isoformat()
end_time = datetime.datetime.strptime('2020-12-26 23:59:59', '%Y-%m-%d %H:%M:%S').isoformat()

data = public_client.get_product_trades(product_id='BTC-USD', limit=10, before=start_time, after=end_time)
df = pd.DataFrame(list(data)[:-1])
print(df)

result:

                          time   trade_id           price        size  side
0     2020-12-30T13:45:30.397Z  116922625  28026.04000000  0.17982618  sell
1     2020-12-30T13:45:30.397Z  116922624  28026.03000000  0.09812919  sell
2     2020-12-30T13:45:30.397Z  116922623  28023.83000000  0.06736100  sell
3     2020-12-30T13:45:30.397Z  116922622  28023.34000000  0.53000000  sell
4     2020-12-30T13:45:27.821Z  116922621  28025.85000000  0.00341548  sell
...
1095   2020-12-30T13:33:55.41Z  116921530  27909.44000000  1.50000000   buy
1096  2020-12-30T13:33:55.168Z  116921529  27913.91000000  0.30399159  sell
1097  2020-12-30T13:33:53.866Z  116921528  27917.00000000  0.34066266  sell
1098   2020-12-30T13:33:53.85Z  116921527  27917.05000000  0.04125719  sell
1099  2020-12-30T13:33:52.813Z  116921526  27916.88000000  0.00131930  sell

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions