Skip to main content

Module trade

Module trade 

Source
Expand description

Trade module ABI encoder.

Implements the v3 Trade module contract. 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). Inputs must fit 12 fractional digits (see crate::common::consts::DECIMAL_PRECISION).

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.