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
  • SolanaPosition Object Documentation
  • Methods
  1. Instances

Solana Position

SolanaPosition Object Documentation

The SolanaPosition class represents an individual trading position on Solana within the Roboqo platform. It extends the EventEmitter class to allow event-driven interactions and provides methods for retrieving position details, tracking profit/loss conditions, and subscribing to real-time updates.

Methods

isOpen

Description Checks whether the position is currently open.

Signature

public isOpen(): boolean

Parameters

  • None.

Returns

  • boolean: true if the position is open, false otherwise.


isClosed

Description Checks whether the position is currently closed.

Signature

public isClosed(): boolean

Parameters

  • None.

Returns

  • boolean: true if the position is closed, false otherwise.


getStatus

Description Retrieves the status of the position.

Signature

public getStatus(): PositionStatus | undefined

Parameters

  • None.

Returns

  • PositionStatus | undefined: The status of the position, or undefined if unavailable.


getInputAmount

Description Retrieves the input amount of the position as a bigint.

Signature

public getInputAmount(): bigint | undefined

Parameters

  • None.

Returns

  • bigint | undefined: The input amount, or undefined if unavailable.


getInputToken

Description Retrieves the input token details for the position.

Signature

public getInputToken(): TokenDetails | undefined

Parameters

  • None.

Returns

  • TokenDetails | undefined: The input token details, or undefined if unavailable.


getOutputToken

Description Retrieves the output token details for the position.

Signature

public getOutputToken(): TokenDetails | undefined

Parameters

  • None.

Returns

  • TokenDetails | undefined: The output token details, or undefined if unavailable.


getMint

Description Retrieves the mint address of the output token.

Signature

public getMint(): string | undefined

Parameters

  • None.

Returns

  • string | undefined: The mint address of the output token, or undefined if unavailable.


getFilledAmount

Description Retrieves the amount of the position that has been filled.

Signature

public getFilledAmount(): bigint

Parameters

  • None.

Returns

  • bigint: The filled amount of the position.


getRemainingAmount

Description Retrieves the remaining amount of the position.

Signature

public getRemainingAmount(): string | undefined

Parameters

  • None.

Returns

  • string | undefined: The remaining amount, or undefined if unavailable.


getAggregatePosition

Description Retrieves the aggregate position associated with this position.

Signature

public getAggregatePosition(): SolanaAggregatePosition | undefined

Parameters

  • None.

Returns

  • SolanaAggregatePosition | undefined: The aggregate position instance, or undefined if unavailable.


onRealizedProfit

Description Registers a callback to be executed when the realized profit reaches a specified value.

Signature

public onRealizedProfit(
  value: number,
  callback: (position: Position) => void,
  persistent?: boolean
): void

Parameters

  • value (number): The profit threshold to trigger the callback.

  • callback ((position: Position) => void): The function to execute when the condition is met.

  • persistent (boolean, optional): Whether the callback should persist after being triggered.

Returns

  • void


onRealizedLoss

Description Registers a callback to be executed when the realized loss reaches a specified value.

Signature

public onRealizedLoss(
  value: number,
  callback: (position: Position) => void,
  persistent?: boolean
): void

Parameters

  • value (number): The loss threshold to trigger the callback.

  • callback ((position: Position) => void): The function to execute when the condition is met.

  • persistent (boolean, optional): Whether the callback should persist after being triggered.

Returns

  • void


onUnrealizedProfit

Description Registers a callback to be executed when the unrealized profit reaches a specified value.

Signature

public onUnrealizedProfit(
  value: number,
  callback: (position: Position) => void,
  persistent?: boolean
): void

Parameters

  • value (number): The profit threshold to trigger the callback.

  • callback ((position: Position) => void): The function to execute when the condition is met.

  • persistent (boolean, optional): Whether the callback should persist after being triggered.

Returns

  • void


onUnrealizedLoss

Description Registers a callback to be executed when the unrealized loss reaches a specified value.

Signature

public onUnrealizedLoss(
  value: number,
  callback: (position: Position) => void,
  persistent?: boolean
): void

Parameters

  • value (number): The loss threshold to trigger the callback.

  • callback ((position: Position) => void): The function to execute when the condition is met.

  • persistent (boolean, optional): Whether the callback should persist after being triggered.

Returns

  • void


onRealizedProfitPercentage

Description Registers a callback to be executed when the realized profit percentage reaches a specified value.

Signature

public onRealizedProfitPercentage(
  value: number,
  callback: (position: Position) => void,
  persistent?: boolean
): void

Parameters

  • value (number): The profit percentage threshold to trigger the callback.

  • callback ((position: Position) => void): The function to execute when the condition is met.

  • persistent (boolean, optional): Whether the callback should persist after being triggered.

Returns

  • void


onRealizedLossPercentage

Description Registers a callback to be executed when the realized loss percentage reaches a specified value.

Signature

public onRealizedLossPercentage(
  value: number,
  callback: (position: Position) => void,
  persistent?: boolean
): void

Parameters

  • value (number): The loss percentage threshold to trigger the callback.

  • callback ((position: Position) => void): The function to execute when the condition is met.

  • persistent (boolean, optional): Whether the callback should persist after being triggered.

Returns

  • void


onUnrealizedProfitPercentage

Description Registers a callback to be executed when the unrealized profit percentage reaches a specified value.

Signature

public onUnrealizedProfitPercentage(
  value: number,
  callback: (position: Position) => void,
  persistent?: boolean
): void

Parameters

  • value (number): The profit percentage threshold to trigger the callback.

  • callback ((position: Position) => void): The function to execute when the condition is met.

  • persistent (boolean, optional): Whether the callback should persist after being triggered.

Returns

  • void


onUnrealizedLossPercentage

Description Registers a callback to be executed when the unrealized loss percentage reaches a specified value.

Signature

public onUnrealizedLossPercentage(
  value: number,
  callback: (position: Position) => void,
  persistent?: boolean
): void

Parameters

  • value (number): The loss percentage threshold to trigger the callback.

  • callback ((position: Position) => void): The function to execute when the condition is met.

  • persistent (boolean, optional): Whether the callback should persist after being triggered.

Returns

  • void

PreviousJito BundleNextSolana Aggregate Position

Last updated 4 months ago