Skip to content

[release] update master for v1.15#417

Merged
dbrajovic merged 10 commits into
masterfrom
release/master-v1.15
Jun 2, 2026
Merged

[release] update master for v1.15#417
dbrajovic merged 10 commits into
masterfrom
release/master-v1.15

Conversation

@dbrajovic
Copy link
Copy Markdown
Collaborator

@dbrajovic dbrajovic commented Jun 2, 2026

Summary by CodeRabbit

Release Notes - v1.15.0

  • New Features

    • Added v2 Composer support for MsgBatchLiquidatePositions with batch liquidation example script
    • Exposed enums on Composer for IDE-friendly code completion: ORDER_TYPE, ORACLE_TYPE, CROSS_MARGIN_ELIGIBILITY
    • Added cross-margin eligibility parameters to market launch methods
  • Updates

    • Updated proto compatibility for Injective core v1.20.0 and Indexer v1.20.2
    • Added subaccount risk profile and liquidation tracking fields to API responses
    • Extended RFQ gateway with new auto-sign and preparation RPC methods
  • Documentation

    • Added Maintainers Guide with release and proto regeneration procedures
    • Updated README with link to maintenance documentation

aarmoa and others added 10 commits May 18, 2026 12:37
…0-alpha.3 and injective-indexer v1.19.41. Generated the MAINTAINERS.md file with documentation of the actions to execute when updating the SDK for a new chain version.
…final-release-for-v120-testnet

[IC-1055] create-python-sdk-final-release-for-v120-testnet
[chore] prep for v1.20 injective-core release

* New Features

- Added StreamABCIEvents RPC for real-time ABCI event streaming.

* Chores

- Updated Indexer compatibility to v1.20.2.
- Bumped internal dependency pins and promoted injective-core to v1.20.0.
- Updated OFAC identifiers list.
- Regenerated protocol definitions to reflect updated schemas.

*Tests

- Updated tests to expect new accountAddress and operationType fields.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR delivers SDK v1.15.0 with batch liquidation support for Injective exchange v2. It adds MsgBatchLiquidatePositions composer builders, introduces IDE-friendly enum constants for order/oracle type normalization, extends cross-margin eligibility parameter support across market operations, refreshes protobuf bindings for Injective core v1.20.0 and Indexer v1.20.2, and includes comprehensive maintainer documentation for release workflows.

Changes

Release Infrastructure & Documentation

Layer / File(s) Summary
Version bump, changelog, and maintainer guide
pyproject.toml, CHANGELOG.md, MAINTAINERS.md, README.md
Package version bumped to 1.15.0 with release notes documenting batch liquidation and enum support. New MAINTAINERS.md provides detailed procedures for proto regeneration, OFAC refresh, and release publishing workflows. README updated with maintainer reference.
Build configuration and upstream versions
Makefile, buf.gen.yaml
Updated Makefile to clone Injective Indexer v1.20.2 and added gen-ofac make target for snapshot refresh. Updated buf.gen.yaml input versions: CometBFT to v1.0.1-inj.v1.19.0-rollback, Cosmos SDK to v0.50.14-inj.10, Injective Core to v1.20.0.

Composer v2 Batch Liquidation and Type Resolution

Layer / File(s) Summary
Composer enums and type resolution
pyinjective/composer_v2.py
Added ORDER_TYPE, ORACLE_TYPE, and CROSS_MARGIN_ELIGIBILITY IntEnum constants mirroring protobuf enums. Added _resolve_order_type and _resolve_oracle_type static helpers to normalize Union[str, int] inputs. Extended RPC type mappings to support batch liquidation requests and responses.
Updated composer method signatures and builders
pyinjective/composer_v2.py
Updated spot_order, market launch, and insurance fund methods to accept flexible oracle/order types via type resolution helpers. Added cross_margin_eligible: bool = False parameter to msg_instant_perpetual_market_launch_v2 and msg_instant_expiry_futures_market_launch_v2. Extended msg_update_derivative_market with cross_margin_eligibility parameter. Added new liquidate_position_data and msg_batch_liquidate_positions builders for batch liquidation transactions.

Examples and Data

Layer / File(s) Summary
Batch liquidation async example
examples/chain_client/exchange/31_MsgBatchLiquidatePositions.py
New runnable example demonstrating async batch liquidation: loads private key, initializes AsyncClient and broadcaster, adjusts gas price, constructs liquidation data with optional derivative orders, broadcasts transactions, and updates gas prices.
Updated example parameters
examples/chain_client/exchange/25_MsgUpdateDerivativeMarket.py, examples/chain_client/exchange/4_MsgInstantPerpetualMarketLaunch.py, examples/chain_client/exchange/5_MsgInstantExpiryFuturesMarketLaunch.py
Updated three examples to explicitly set cross_margin_eligible (and reduce_margin_ratio in one) parameters matching updated Composer method signatures.
OFAC snapshot refresh
pyinjective/ofac.json
Updated JSON array of OFAC hash identifiers with new entries inserted at multiple positions and initial sequence replaced.

Protobuf Regeneration

Layer / File(s) Summary
Exchange v2 messaging and queries
pyinjective/proto/injective/exchange/v2/{exchange,genesis,market,proposal}_pb2.py, pyinjective/proto/injective/exchange/v2/{query,tx}_pb2_grpc.py
Regenerated exchange v2 schema and gRPC bindings for Injective core v1.20.0: added cross-margin params, subaccount risk profile records, new query endpoints (SubaccountRiskProfile, CrossMarginPoolSnapshot), and new Msg RPCs (BatchLiquidatePositions, LiquidateCrossMarginPool, UpdateSubaccountRiskProfile).
Exchange events and v1beta1
pyinjective/proto/injective/exchange/v{1beta1,2}/events_pb2.py, pyinjective/proto/exchange/{injective_derivative_exchange_rpc,injective_accounts_rpc,injective_chart_rpc}_pb2.py
Regenerated v1beta1 and v2 event schemas to add cross-pool liquidation and subaccount risk profile events. Updated RPC schema modules for derivative exchange, accounts, and chart data.
Event provider API
pyinjective/proto/exchange/{event_provider_api_pb2,event_provider_api_pb2_grpc}.py
Added StreamABCIEvents streaming RPC with supporting request/response and raw block message types.
Oracle v1beta1 services
pyinjective/proto/injective/oracle/v1beta1/{events,genesis,oracle,query,tx}_pb2.py, pyinjective/proto/injective/oracle/v1beta1/{query,tx}_pb2_grpc.py
Regenerated oracle schema and added new gRPC endpoints: PythProPriceStates and SedaFastPriceStates query methods, RelayPythProPrices and RelaySedaFastPrices Msg methods.
RFQ services
pyinjective/proto/exchange/{injective_rfq_rpc,injective_rfq_gw_rpc}_pb2.py, pyinjective/proto/exchange/injective_rfq_gw_rpc_pb2_grpc.py
Updated RFQ schema: removed legacy Request/Quote RPCs from main RFQ service, expanded RFQ gateway with PrepareEip712AutoSign, PrepareEip712, and Prepare methods.
Other services
pyinjective/proto/injective/{peggy/v1/params,stream/v2/query}_pb2.py, pyinjective/proto/exchange/injective_tc_derivatives_rpc_pb2.py
Regenerated descriptor offsets and schema for peggy params, stream queries, and TC derivatives RPC.

Test Coverage

Layer / File(s) Summary
Composer enum and batch liquidation tests
tests/test_composer_v2.py
Added tests verifying Composer.ORDER_TYPE, ORACLE_TYPE, and CROSS_MARGIN_ELIGIBILITY enums mirror protobuf definitions. Updated market launch tests to include cross_margin_eligible parameter. Added test_msg_batch_liquidate_positions for both with and without nested derivative orders. Updated derivative market update test to use enum-based cross-margin-eligibility.
Chain and indexer API contract tests
tests/client/chain/grpc/test_chain_grpc_exchange_v2_api.py, tests/client/chain/stream_grpc/test_chain_grpc_chain_stream.py, tests/client/indexer/grpc/test_indexer_grpc_derivative_api.py, tests/client/indexer/stream_grpc/test_indexer_grpc_derivative_stream.py
Updated tests to expect new fields: crossMarginEligible and riskMode on derivative markets/positions, isLiquidation flag on derivative trades, and accountAddress and operationType on order/position stream updates.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes


Possibly related PRs


Suggested reviewers

  • PavelInjective
  • aarmoa

🐰 A batch of liquidations now flows so clean,
With enums exposed, the types are all seen,
Cross-margin params dance in the breeze,
Our exchange grows stronger, with newfound ease!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.39% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '[release] update master for v1.15' directly relates to the primary change in this pull request, which is a comprehensive v1.15.0 release update including proto regeneration, new composer features, and documentation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release/master-v1.15

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
pyinjective/composer_v2.py (1)

331-341: 💤 Low value

Consider adding validation with clearer error messages.

The resolver methods rely on protobuf's Value() to validate string inputs, which raises KeyError for invalid names. Consider wrapping the conversion with try/except to provide more helpful error messages.

💡 Suggested enhancement
 `@staticmethod`
 def _resolve_order_type(value: Union[str, int]) -> int:
     if isinstance(value, str):
-        return injective_order_v2_pb.OrderType.Value(value)
+        try:
+            return injective_order_v2_pb.OrderType.Value(value)
+        except KeyError:
+            valid_types = list(injective_order_v2_pb.OrderType.keys())
+            raise ValueError(f"Invalid order_type: {value}. Valid options: {valid_types}")
     return int(value)

Apply similar pattern to _resolve_oracle_type.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pyinjective/composer_v2.py` around lines 331 - 341, The _resolve_order_type
and _resolve_oracle_type helpers currently call
injective_order_v2_pb.OrderType.Value(value) and
injective_oracle_pb.OracleType.Value(value) directly which raises KeyError for
invalid names; wrap each conversion in try/except and raise a clear ValueError
that includes the invalid input and the expected enum name(s) (you can retrieve
allowed names from OrderType.keys() / OracleType.keys()), and similarly catch
ValueError when casting ints to provide the same clear message; update both
_resolve_order_type and _resolve_oracle_type accordingly.
examples/chain_client/exchange/31_MsgBatchLiquidatePositions.py (1)

80-83: 💤 Low value

Consider if post-broadcast gas price update is necessary for this example.

The gas price fetch and update (lines 80-83) duplicates the earlier logic (lines 26-28). Since this is a single-transaction example, the post-broadcast update may not be necessary.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/chain_client/exchange/31_MsgBatchLiquidatePositions.py` around lines
80 - 83, The second gas price fetch/update is redundant for this
single-transaction example: remove the duplicated block that re-assigns
gas_price via client.current_chain_gas_price() and calls
message_broadcaster.update_gas_price(gas_price=gas_price) (the variables and
calls to gas_price, client.current_chain_gas_price(), and
message_broadcaster.update_gas_price are the unique symbols to locate); instead
rely on the initial fetch/update done earlier (lines with the first gas_price
assignment) or, if you keep it, wrap it in a conditional that only runs for
multi-TX flows so the post-broadcast update is not executed for this single TX
example.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@examples/chain_client/exchange/31_MsgBatchLiquidatePositions.py`:
- Around line 80-83: The second gas price fetch/update is redundant for this
single-transaction example: remove the duplicated block that re-assigns
gas_price via client.current_chain_gas_price() and calls
message_broadcaster.update_gas_price(gas_price=gas_price) (the variables and
calls to gas_price, client.current_chain_gas_price(), and
message_broadcaster.update_gas_price are the unique symbols to locate); instead
rely on the initial fetch/update done earlier (lines with the first gas_price
assignment) or, if you keep it, wrap it in a conditional that only runs for
multi-TX flows so the post-broadcast update is not executed for this single TX
example.

In `@pyinjective/composer_v2.py`:
- Around line 331-341: The _resolve_order_type and _resolve_oracle_type helpers
currently call injective_order_v2_pb.OrderType.Value(value) and
injective_oracle_pb.OracleType.Value(value) directly which raises KeyError for
invalid names; wrap each conversion in try/except and raise a clear ValueError
that includes the invalid input and the expected enum name(s) (you can retrieve
allowed names from OrderType.keys() / OracleType.keys()), and similarly catch
ValueError when casting ints to provide the same clear message; update both
_resolve_order_type and _resolve_oracle_type accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 972022aa-ebf1-43e5-b19f-6becadf60335

📥 Commits

Reviewing files that changed from the base of the PR and between 8e54863 and ee21b05.

📒 Files selected for processing (46)
  • CHANGELOG.md
  • MAINTAINERS.md
  • Makefile
  • README.md
  • buf.gen.yaml
  • examples/chain_client/exchange/25_MsgUpdateDerivativeMarket.py
  • examples/chain_client/exchange/31_MsgBatchLiquidatePositions.py
  • examples/chain_client/exchange/4_MsgInstantPerpetualMarketLaunch.py
  • examples/chain_client/exchange/5_MsgInstantExpiryFuturesMarketLaunch.py
  • pyinjective/composer_v2.py
  • pyinjective/ofac.json
  • pyinjective/proto/exchange/event_provider_api_pb2.py
  • pyinjective/proto/exchange/event_provider_api_pb2_grpc.py
  • pyinjective/proto/exchange/injective_accounts_rpc_pb2.py
  • pyinjective/proto/exchange/injective_chart_rpc_pb2.py
  • pyinjective/proto/exchange/injective_derivative_exchange_rpc_pb2.py
  • pyinjective/proto/exchange/injective_rfq_gw_rpc_pb2.py
  • pyinjective/proto/exchange/injective_rfq_gw_rpc_pb2_grpc.py
  • pyinjective/proto/exchange/injective_rfq_rpc_pb2.py
  • pyinjective/proto/exchange/injective_rfq_rpc_pb2_grpc.py
  • pyinjective/proto/exchange/injective_tc_derivatives_rpc_pb2.py
  • pyinjective/proto/injective/exchange/v1beta1/events_pb2.py
  • pyinjective/proto/injective/exchange/v2/events_pb2.py
  • pyinjective/proto/injective/exchange/v2/exchange_pb2.py
  • pyinjective/proto/injective/exchange/v2/genesis_pb2.py
  • pyinjective/proto/injective/exchange/v2/market_pb2.py
  • pyinjective/proto/injective/exchange/v2/proposal_pb2.py
  • pyinjective/proto/injective/exchange/v2/query_pb2.py
  • pyinjective/proto/injective/exchange/v2/query_pb2_grpc.py
  • pyinjective/proto/injective/exchange/v2/tx_pb2.py
  • pyinjective/proto/injective/exchange/v2/tx_pb2_grpc.py
  • pyinjective/proto/injective/oracle/v1beta1/events_pb2.py
  • pyinjective/proto/injective/oracle/v1beta1/genesis_pb2.py
  • pyinjective/proto/injective/oracle/v1beta1/oracle_pb2.py
  • pyinjective/proto/injective/oracle/v1beta1/query_pb2.py
  • pyinjective/proto/injective/oracle/v1beta1/query_pb2_grpc.py
  • pyinjective/proto/injective/oracle/v1beta1/tx_pb2.py
  • pyinjective/proto/injective/oracle/v1beta1/tx_pb2_grpc.py
  • pyinjective/proto/injective/peggy/v1/params_pb2.py
  • pyinjective/proto/injective/stream/v2/query_pb2.py
  • pyproject.toml
  • tests/client/chain/grpc/test_chain_grpc_exchange_v2_api.py
  • tests/client/chain/stream_grpc/test_chain_grpc_chain_stream.py
  • tests/client/indexer/grpc/test_indexer_grpc_derivative_api.py
  • tests/client/indexer/stream_grpc/test_indexer_grpc_derivative_stream.py
  • tests/test_composer_v2.py
💤 Files with no reviewable changes (1)
  • pyinjective/proto/exchange/injective_rfq_rpc_pb2_grpc.py

@dbrajovic dbrajovic merged commit 9a79027 into master Jun 2, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants