Skip to main content

Module trade

Module trade 

Source
Expand description

Trade module ABI encoder.

Mirrors derive_action_signing/module_data/trade.py::TradeModuleData. The ABI tuple is (address, uint256, int256, int256, uint256, uint256, bool) corresponding to (asset_address, sub_id, limit_price, amount, max_fee, recipient_id, is_bid). Decimals are scaled to 1e18 fixed-point integers before encoding (see crate::common::consts::DECIMAL_SCALE).

Note that limit_price and amount are signed at the ABI level even though prices are conventionally non-negative; this matches the venue contract definition. max_fee is unsigned and rejects negative input.

Structs§

TradeModuleData
Trade-action module payload signed into every private/order request.

Enums§

TradeEncodeError
Errors raised while building the trade module payload.