> For the complete documentation index, see [llms.txt](https://gitbook.roboqo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.roboqo.com/global-objects/positions-object.md).

# 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`

**Description**\
Retrieves the aggregate position for a specific mint.

**Signature**

```typescript
public getAggregatePosition(mint: string): SolanaAggregatePosition | undefined
```

**Parameters**

* `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, or `undefined` if no position exists.

***

#### `getAggregatePositions`

**Description**\
Retrieves all aggregate positions currently tracked.

**Signature**

```typescript
public getAggregatePositions(): SolanaAggregatePosition[]
```

**Parameters**

* None.

**Returns**

* `SolanaAggregatePosition[]`: An array of `SolanaAggregatePosition` instances representing all tracked aggregate positions.

***

#### `watchAggregatePosition`

**Description**\
Subscribes to updates for an aggregate position based on the specified mint. The callback function will be invoked whenever the position updates.

**Signature**

```typescript
public async watchAggregatePosition(
  mint: string,
  callback: (pnl: AggregatePosition<BigNumber>) => void
): Promise<void>
```

**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`

**Description**\
Unsubscribes from updates for an aggregate position based on the specified mint. The specified callback will be removed from the subscription list.

**Signature**

```typescript
public async unwatchAggregatePosition(
  mint: string,
  callback: (pnl: AggregatePosition<BigNumber>) => void
): Promise<void>
```

**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.
