Skip to main content

make_venue_position_id

Function make_venue_position_id 

Source
pub fn make_venue_position_id(
    instrument_id: InstrumentId,
    position_idx: i32,
) -> PositionId
Expand description

Constructs a venue position ID from an instrument and Bybit position index.

Position index values: 0 = one-way mode, 1 = buy-side hedge, 2 = sell-side hedge.

Not currently wired into reports because Bybit defaults to netting mode where non-None venue_position_id overrides the computed netting position ID. Ready to activate when hedge-mode support is added.