Roboqo Studio
  • Roboqo Studio
  • OVERVIEW
    • Quickstart
    • Fees and Tokens
  • Basics
    • Roboqo Scripts
    • Transactions
    • UI Elements
    • Helper Functions
  • Global Objects
    • Solana Object
    • Positions Object
    • Jito Object
    • Raydium Object
    • Jupiter Object
    • Pumpfun Object
    • Rugcheck Object
    • Warp Object
    • Memes Object
    • Script / CLI
    • Storage Object
  • Instances
    • Solana Transaction
    • Solana Bundle
    • Jito Bundle
    • Solana Position
    • Solana Aggregate Position
Powered by GitBook
On this page
  • Positions Object Documentation
  • Methods
  1. Global Objects

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

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

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

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

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.

PreviousSolana ObjectNextJito Object

Last updated 4 months ago