Skip to content

Commit

Permalink
remove use of min order base quantums
Browse files Browse the repository at this point in the history
  • Loading branch information
jakob-dydx committed Aug 16, 2023
1 parent 424f349 commit 10d173f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions v4-client-py/dydx4/clients/dydx_composite_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,9 @@ def place_order_message(
atomic_resolution = market['atomicResolution']
step_base_quantums = market['stepBaseQuantums']
quantum_conversion_exponent = market['quantumConversionExponent']
min_order_base_quantums = market['minOrderBaseQuantums']
subticks_per_tick = market['subticksPerTick']
order_side = calculate_side(side)
quantums = calculate_quantums(size, atomic_resolution, step_base_quantums, min_order_base_quantums)
quantums = calculate_quantums(size, atomic_resolution, step_base_quantums)
subticks = calculate_subticks(price, atomic_resolution, quantum_conversion_exponent, subticks_per_tick)
order_flags = calculate_order_flags(type, time_in_force)
time_in_force = calculate_time_in_force(type, time_in_force, execution, post_only)
Expand Down
6 changes: 3 additions & 3 deletions v4-client-py/dydx4/clients/helpers/chain_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ def round(
def calculate_quantums(
size: float,
atomic_resolution: int,
step_base_quantums: int,
min_order_base_quantums: int
step_base_quantums: int,
):
raw_quantums = size * 10**(-1 * atomic_resolution)
quantums = round(raw_quantums, step_base_quantums)
return max(quantums, min_order_base_quantums)
# step_base_quantums functions as the minimum order size
return max(quantums, step_base_quantums)

def calculate_subticks(
price: float,
Expand Down
2 changes: 1 addition & 1 deletion v4-client-py/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package-dir = {"" = "dydx4"}

[tool.poetry]
name = "dydx4"
version = "0.1.6"
version = "0.1.7"
description = "dYdX v4 Client"
authors = ["John Huang <contact@dydx.exchange>"]
license = "MIT"
Expand Down

0 comments on commit 10d173f

Please sign in to comment.