Skip to content

Commit 18be97d

Browse files
committed
[CHORE] Updated proto dependencies to Injective chain v1.18.0 and Indexer v1.18.3
1 parent 903ea3d commit 18be97d

26 files changed

+988
-280
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ clean-all:
2626
$(call clean_repos)
2727

2828
clone-injective-indexer:
29-
git clone https://github.com/InjectiveLabs/injective-indexer.git -b v1.17.81 --depth 1 --single-branch
29+
git clone https://github.com/InjectiveLabs/injective-indexer.git -b v1.18.3 --depth 1 --single-branch
3030

3131
clone-all: clone-injective-indexer
3232

buf.gen.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ inputs:
1616
- git_repo: https://github.com/InjectiveLabs/wasmd
1717
tag: v0.53.3-inj.2
1818
- git_repo: https://github.com/InjectiveLabs/cometbft
19-
tag: v1.0.1-inj.3
19+
tag: v1.0.1-inj.6
2020
- git_repo: https://github.com/InjectiveLabs/cosmos-sdk
21-
tag: v0.50.14-inj.3
21+
tag: v0.50.14-inj.4
2222
# - git_repo: https://github.com/InjectiveLabs/wasmd
2323
# branch: v0.51.x-inj
2424
# subdir: proto
2525
- git_repo: https://github.com/InjectiveLabs/hyperlane-cosmos
2626
tag: v1.0.1-inj
2727
subdir: proto
2828
- git_repo: https://github.com/InjectiveLabs/injective-core
29-
tag: v1.18.0-alpha.3
29+
tag: v1.18.0
3030
subdir: proto
3131
# - git_repo: https://github.com/InjectiveLabs/injective-core
3232
# branch: c-655/add_chainlink_data_streams_oracle

examples/chain_client/10_SearchLiquidablePositions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ async def main() -> None:
5353
adjusted_unit_margin = (adj_margin / quantity) * (-1 if is_long else 1)
5454
maintenance_margin_ratio = client_market.maintenance_margin_ratio * (-1 if is_long else 1)
5555

56-
liquidation_price = (entry_price + adjusted_unit_margin) / (Decimal(1) + maintenance_margin_ratio)
56+
liquidation_price = (entry_price + adjusted_unit_margin) / (Decimal("1") + maintenance_margin_ratio)
5757

5858
should_be_liquidated = (is_long and market_mark_price <= liquidation_price) or (
5959
not is_long and market_mark_price >= liquidation_price

examples/chain_client/1_LocalOrderHash.py

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -67,23 +67,19 @@ async def main() -> None:
6767
market_id=deriv_market_id,
6868
subaccount_id=subaccount_id,
6969
fee_recipient=fee_recipient,
70-
price=Decimal(10500),
71-
quantity=Decimal(0.01),
72-
margin=composer.calculate_margin(
73-
quantity=Decimal(0.01), price=Decimal(10500), leverage=Decimal(2), is_reduce_only=False
74-
),
70+
price=Decimal("10500"),
71+
quantity=Decimal("0.01"),
72+
margin=Decimal("52.5"),
7573
order_type="BUY",
7674
cid=str(uuid.uuid4()),
7775
),
7876
composer.derivative_order(
7977
market_id=deriv_market_id,
8078
subaccount_id=subaccount_id,
8179
fee_recipient=fee_recipient,
82-
price=Decimal(65111),
83-
quantity=Decimal(0.01),
84-
margin=composer.calculate_margin(
85-
quantity=Decimal(0.01), price=Decimal(65111), leverage=Decimal(2), is_reduce_only=False
86-
),
80+
price=Decimal("65111"),
81+
quantity=Decimal("0.01"),
82+
margin=Decimal("325.555"),
8783
order_type="SELL",
8884
cid=str(uuid.uuid4()),
8985
),
@@ -204,23 +200,19 @@ async def main() -> None:
204200
market_id=deriv_market_id,
205201
subaccount_id=subaccount_id_2,
206202
fee_recipient=fee_recipient,
207-
price=Decimal(25111),
208-
quantity=Decimal(0.01),
209-
margin=composer.calculate_margin(
210-
quantity=Decimal(0.01), price=Decimal(25111), leverage=Decimal("1.5"), is_reduce_only=False
211-
),
203+
price=Decimal("25111"),
204+
quantity=Decimal("0.01"),
205+
margin=Decimal("167.406666666666666667"),
212206
order_type="BUY",
213207
cid=str(uuid.uuid4()),
214208
),
215209
composer.derivative_order(
216210
market_id=deriv_market_id,
217211
subaccount_id=subaccount_id_2,
218212
fee_recipient=fee_recipient,
219-
price=Decimal(65111),
220-
quantity=Decimal(0.01),
221-
margin=composer.calculate_margin(
222-
quantity=Decimal(0.01), price=Decimal(25111), leverage=Decimal(2), is_reduce_only=False
223-
),
213+
price=Decimal("65111"),
214+
quantity=Decimal("0.01"),
215+
margin=Decimal("125.555"),
224216
order_type="SELL",
225217
cid=str(uuid.uuid4()),
226218
),

examples/chain_client/exchange/10_MsgCreateDerivativeLimitOrder.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,9 @@ async def main() -> None:
5050
market_id=market_id,
5151
subaccount_id=subaccount_id,
5252
fee_recipient=fee_recipient,
53-
price=Decimal(50000),
54-
quantity=Decimal(0.1),
55-
margin=composer.calculate_margin(
56-
quantity=Decimal(0.1), price=Decimal(50000), leverage=Decimal(1), is_reduce_only=False
57-
),
53+
price=Decimal("50000"),
54+
quantity=Decimal("0.1"),
55+
margin=Decimal("5000"),
5856
order_type="SELL",
5957
cid=str(uuid.uuid4()),
6058
)

examples/chain_client/exchange/11_MsgCreateDerivativeMarketOrder.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,9 @@ async def main() -> None:
5050
market_id=market_id,
5151
subaccount_id=subaccount_id,
5252
fee_recipient=fee_recipient,
53-
price=Decimal(50000),
54-
quantity=Decimal(0.1),
55-
margin=composer.calculate_margin(
56-
quantity=Decimal(0.1), price=Decimal(50000), leverage=Decimal(1), is_reduce_only=False
57-
),
53+
price=Decimal("50000"),
54+
quantity=Decimal("0.1"),
55+
margin=Decimal("5000"),
5856
order_type="BUY",
5957
cid=str(uuid.uuid4()),
6058
)

examples/chain_client/exchange/15_MsgCreateBinaryOptionsMarketOrder.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,8 @@ async def main() -> None:
5151
subaccount_id=subaccount_id,
5252
fee_recipient=fee_recipient,
5353
price=Decimal("0.5"),
54-
quantity=Decimal(1),
55-
margin=composer.calculate_margin(
56-
quantity=Decimal(1), price=Decimal("0.5"), leverage=Decimal(1), is_reduce_only=False
57-
),
54+
quantity=Decimal("1"),
55+
margin=Decimal("0.5"),
5856
cid=str(uuid.uuid4()),
5957
)
6058

examples/chain_client/exchange/19_MsgLiquidatePosition.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,9 @@ async def main() -> None:
4949
market_id=market_id,
5050
subaccount_id=subaccount_id,
5151
fee_recipient=fee_recipient,
52-
price=Decimal(39.01), # This should be the liquidation price
53-
quantity=Decimal(0.147),
54-
margin=composer.calculate_margin(
55-
quantity=Decimal(0.147), price=Decimal(39.01), leverage=Decimal(1), is_reduce_only=False
56-
),
52+
price=Decimal("39.01"), # This should be the liquidation price
53+
quantity=Decimal("0.147"),
54+
margin=Decimal("5.73447"),
5755
order_type="SELL",
5856
cid=cid,
5957
)

examples/chain_client/exchange/20_MsgIncreasePositionMargin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ async def main() -> None:
4848
market_id=market_id,
4949
source_subaccount_id=subaccount_id,
5050
destination_subaccount_id=subaccount_id,
51-
amount=Decimal(2),
51+
amount=Decimal("2"),
5252
)
5353

5454
# broadcast the transaction

examples/chain_client/exchange/22_MsgAdminUpdateBinaryOptionsMarket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ async def main() -> None:
4141
# prepare trade info
4242
market_id = "0xfafec40a7b93331c1fc89c23f66d11fbb48f38dfdd78f7f4fc4031fad90f6896"
4343
status = "Demolished"
44-
settlement_price = Decimal(1)
44+
settlement_price = Decimal("1")
4545
expiration_timestamp = 1685460582
4646
settlement_timestamp = 1690730982
4747

0 commit comments

Comments
 (0)