pub struct PositionRequest<'a> {
pub category: Category,
pub symbol: Option<Cow<'a, str>>,
pub base_coin: Option<Cow<'a, str>>,
pub settle_coin: Option<Cow<'a, str>>,
pub limit: Option<usize>,
}Expand description
Parameters for requesting position information.
Used to construct a request to the /v5/position/list endpoint to retrieve current position details. Bots use this to monitor open positions, calculate unrealized P&L, and manage risk in perpetual futures.
Fields§
§category: CategoryThe product category (e.g., Linear, Inverse).
Specifies the instrument type. Bots must set this to fetch positions for the correct contract type.
symbol: Option<Cow<'a, str>>The trading pair symbol (e.g., “BTCUSDT”).
Optionally filters positions by symbol. If unset, all positions in the category are returned. Bots should specify this for targeted position monitoring.
base_coin: Option<Cow<'a, str>>The base coin (e.g., “BTC”).
Optionally filters positions by the base asset. Useful for bots managing multiple pairs of the same asset.
settle_coin: Option<Cow<'a, str>>The settlement coin (e.g., “USDT”).
Optionally filters positions by the settlement currency. For Linear perpetuals, this is typically “USDT”. Bots can use this to focus on specific margin types.
limit: Option<usize>The maximum number of position records to return.
Controls the number of position records returned. Bots should set a reasonable limit to balance data completeness with performance.
Implementations§
Source§impl<'a> PositionRequest<'a>
impl<'a> PositionRequest<'a>
Sourcepub fn default() -> Self
pub fn default() -> Self
Creates a default Position request.
Returns a request with category set to Linear and all other fields unset. Suitable for broad queries but should be customized for specific position monitoring needs.
Sourcepub fn new(
category: Category,
symbol: Option<&'a str>,
base_coin: Option<&'a str>,
settle_coin: Option<&'a str>,
limit: Option<usize>,
) -> Self
pub fn new( category: Category, symbol: Option<&'a str>, base_coin: Option<&'a str>, settle_coin: Option<&'a str>, limit: Option<usize>, ) -> Self
Constructs a new Position request with specified parameters.
Allows full customization. Bots should use this to specify the exact symbol, category, and filters to align with their position management requirements.
Trait Implementations§
Source§impl<'a> Clone for PositionRequest<'a>
impl<'a> Clone for PositionRequest<'a>
Source§fn clone(&self) -> PositionRequest<'a>
fn clone(&self) -> PositionRequest<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more