Skip to content

Commit ac610b5

Browse files
Merge pull request #130 from InjectiveLabs/f/fix_instant_binary_options
F/fix instant binary options
2 parents af640bf + 2062daa commit ac610b5

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ Note that the [sync client](https://github.com/InjectiveLabs/sdk-python/blob/mas
7878

7979

8080
### Changelogs
81+
**0.5.7.2**
82+
* Fix MsgInstantBinaryOptionsLaunch
83+
8184
**0.5.7.1**
8285
* Add optional argument to bypass ini file load in binary options
8386

examples/chain_client/35_MsgInstantBinaryOptionsMarketLaunch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ async def main() -> None:
4646
oracle_provider="UFC",
4747
oracle_type="Provider",
4848
quote_denom="peggy0xdAC17F958D2ee523a2206206994597C13D831ec7",
49+
quote_decimals=6,
4950
oracle_scale_factor=6,
5051
maker_fee_rate=0.0005, # 0.05%
5152
taker_fee_rate=0.0010, # 0.10%

pyinjective/composer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,7 @@ def MsgInstantBinaryOptionsMarketLaunch(
468468
expiration_timestamp: int,
469469
settlement_timestamp: int,
470470
quote_denom: str,
471+
quote_decimals: int,
471472
min_price_tick_size: float,
472473
min_quantity_tick_size: float,
473474
**kwargs
@@ -479,7 +480,7 @@ def MsgInstantBinaryOptionsMarketLaunch(
479480
scaled_taker_fee_rate = Decimal((taker_fee_rate * pow(10, 18)))
480481
taker_fee_to_bytes = bytes(str(scaled_taker_fee_rate), "utf-8")
481482

482-
scaled_min_price_tick_size = Decimal((min_price_tick_size * pow(10, 18)))
483+
scaled_min_price_tick_size = Decimal((min_price_tick_size * pow(10, quote_decimals + 18)))
483484
min_price_to_bytes = bytes(str(scaled_min_price_tick_size), "utf-8")
484485

485486
scaled_min_quantity_tick_size = Decimal((min_quantity_tick_size * pow(10, 18)))

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
EMAIL = "achilleas@injectivelabs.com"
1818
AUTHOR = "Injective Labs"
1919
REQUIRES_PYTHON = ">=3.7.0"
20-
VERSION = "0.5.7.1"
20+
VERSION = "0.5.7.2"
2121

2222
REQUIRED = [
2323
"grpcio",

0 commit comments

Comments
 (0)