Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/sync_dev_after_v170 #348

Merged
merged 15 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

All notable changes to this project will be documented in this file.

## [1.7.0] - 2024-09-18
### Added
- Added OFAC restricted addresses validations

## [1.6.3]
### Fixed
- Updated reference gas cost for messages in the gas limit estimator after chain upgrade v1.13

## [1.6.2]
### Fixed
- Fixed issue in the `listen_derivative_market_updates` method in the `AsyncClient` class

## [1.6.1] - 2024-08-07
### Added
- Added support for the following messages in the chain "exchange" module:
Expand Down
1,618 changes: 837 additions & 781 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyinjective/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2336,7 +2336,7 @@ async def listen_derivative_market_updates(
on_status_callback: Optional[Callable] = None,
market_ids: Optional[List[str]] = None,
):
await self.exchange_derivative_stream_api.stream_markets(
await self.exchange_derivative_stream_api.stream_market(
callback=callback,
on_end_callback=on_end_callback,
on_status_callback=on_status_callback,
Expand Down
16 changes: 8 additions & 8 deletions pyinjective/core/gas_limit_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
tx_pb2 as injective_exchange_tx_pb,
)

SPOT_ORDER_CREATION_GAS_LIMIT = 50_000
DERIVATIVE_ORDER_CREATION_GAS_LIMIT = 70_000
SPOT_ORDER_CREATION_GAS_LIMIT = 52_000
DERIVATIVE_ORDER_CREATION_GAS_LIMIT = 84_000
SPOT_ORDER_CANCELATION_GAS_LIMIT = 50_000
DERIVATIVE_ORDER_CANCELATION_GAS_LIMIT = 60_000
DERIVATIVE_ORDER_CANCELATION_GAS_LIMIT = 68_000
# POST ONLY orders take around 50% more gas to create than normal orders due to the required validations
SPOT_POST_ONLY_ORDER_MULTIPLIER = 0.5
DERIVATIVE_POST_ONLY_ORDER_MULTIPLIER = 0.5
SPOT_POST_ONLY_ORDER_MULTIPLIER = 0.62
DERIVATIVE_POST_ONLY_ORDER_MULTIPLIER = 0.35


class GasLimitEstimator(ABC):
GENERAL_MESSAGE_GAS_LIMIT = 15_000
GENERAL_MESSAGE_GAS_LIMIT = 25_000
BASIC_REFERENCE_GAS_LIMIT = 150_000

@classmethod
Expand Down Expand Up @@ -183,7 +183,7 @@ def _message_class(self, message: any_pb2.Any):
class BatchUpdateOrdersGasLimitEstimator(GasLimitEstimator):
CANCEL_ALL_SPOT_MARKET_GAS_LIMIT = 40_000
CANCEL_ALL_DERIVATIVE_MARKET_GAS_LIMIT = 50_000
MESSAGE_GAS_LIMIT = 15_000
MESSAGE_GAS_LIMIT = 30_000

AVERAGE_CANCEL_ALL_AFFECTED_ORDERS = 20

Expand Down Expand Up @@ -246,7 +246,7 @@ def _message_class(self, message: any_pb2.Any):


class ExecGasLimitEstimator(GasLimitEstimator):
DEFAULT_GAS_LIMIT = 8_000
DEFAULT_GAS_LIMIT = 20_000

def __init__(self, message: any_pb2.Any):
self._message = self._parsed_message(message=message)
Expand Down
Loading
Loading