inv2004 / coinbase-pro-rs

Coinbase pro client for Rust
Apache License 2.0
145 stars 56 forks source link

base_min_size not present in get_product, causing a crash #46

Closed jehna closed 1 year ago

jehna commented 2 years ago

It seems that Coinbase has removed base_min_size from their product api, which causes get_product to crash to an error:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value:
Serde {
  error: Error("missing field `base_min_size`", line: 1, column: 388),
  data: "{\"id\":\"CRV-EUR\",\"base_currency\":\"CRV\",\"quote_currency\":\"EUR\",\"quote_increment\":\"0.0001\",\"base_increment\":\"0.01\",\"display_name\":\"CRV/EUR\",\"min_market_funds\":\"0.84\",\"margin_enabled\":false,\"fx_stablecoin\":false,\"max_slippage_percentage\":\"0.03000000\",\"post_only\":false,\"limit_only\":false,\"cancel_only\":false,\"trading_disabled\":false,\"status\":\"online\",\"status_message\":\"\",\"auction_mode\":false}"
}
jehna commented 2 years ago

Coinbase's announcement: https://blog.coinbase.com/upcoming-changes-to-order-size-limits-2fed4dc31b5c

For API traders, please note that we will deprecate the use of base_min_size in our /products endpoint on June 2, 2022. On June 30, 2022, we will remove this variable from our endpoint. We will continue to maintain min_market_funds, with the new logic checking notional size of the order.

jeremy-prater commented 2 years ago

Will be fixed with

https://github.com/inv2004/coinbase-pro-rs/pull/47

In the mean time, you can point your cargo manifest at

coinbase-pro-rs = { verion = "0.7.1", git = "https://github.com/jeremy-prater/coinbase-pro-rs.git" }
inv2004 commented 2 years ago

@jeremy-prater updated + version lifted