Positions Object
Positions Object Documentation
The Positions class provides methods for tracking and managing aggregate trading positions within the Roboqo platform. It enables retrieving aggregate positions for specific mints, subscribing to position updates, and managing position tracking callbacks. This class extends the Subscribable class, allowing it to emit updates when position changes occur.
Methods
getAggregatePosition
getAggregatePositionDescription Retrieves the aggregate position for a specific mint.
Signature
public getAggregatePosition(mint: string): SolanaAggregatePosition | undefinedParameters
mint(string): The mint address for which to retrieve the aggregate position.
Returns
SolanaAggregatePosition | undefined: An instance representing the aggregate position for the specified mint, orundefinedif no position exists.
getAggregatePositions
getAggregatePositionsDescription Retrieves all aggregate positions currently tracked.
Signature
Parameters
None.
Returns
SolanaAggregatePosition[]: An array ofSolanaAggregatePositioninstances representing all tracked aggregate positions.
watchAggregatePosition
watchAggregatePositionDescription Subscribes to updates for an aggregate position based on the specified mint. The callback function will be invoked whenever the position updates.
Signature
Parameters
mint(string): The mint address to watch for aggregate position updates.callback((pnl: AggregatePosition<BigNumber>) => void): A function that will be invoked with the updated position when changes occur.
Returns
Promise<void>: Resolves when the subscription is successfully registered.
unwatchAggregatePosition
unwatchAggregatePositionDescription Unsubscribes from updates for an aggregate position based on the specified mint. The specified callback will be removed from the subscription list.
Signature
Parameters
mint(string): The mint address for which to stop receiving aggregate position updates.callback((pnl: AggregatePosition<BigNumber>) => void): The callback function to remove from the subscription list.
Returns
Promise<void>: Resolves when the unsubscription is successfully processed.
Last updated