Solana Aggregate Position
SolanaAggregatePosition Object Documentation
The SolanaAggregatePosition class represents an aggregate trading position on Solana within the Roboqo platform. It extends the EventEmitter class to allow event-driven interactions and provides methods for monitoring profit/loss conditions on an aggregated level.
Methods
onAggregatedRealizedProfit
onAggregatedRealizedProfitDescription Registers a callback to be executed when the aggregated realized profit reaches a specified value.
Signature
public onAggregatedRealizedProfit(
value: number,
callback: (aggregate: AggregatePosition<BigNumber>) => void,
persistent?: boolean
): voidParameters
value(number): The profit threshold to trigger the callback.callback((aggregate: AggregatePosition<BigNumber>) => void): The function to execute when the condition is met.persistent(boolean, optional): Whether the callback should persist after being triggered.
Returns
void
onAggregatedRealizedLoss
onAggregatedRealizedLossDescription Registers a callback to be executed when the aggregated realized loss reaches a specified value.
Signature
Parameters
value(number): The loss threshold to trigger the callback.callback((aggregate: AggregatePosition<BigNumber>) => void): The function to execute when the condition is met.persistent(boolean, optional): Whether the callback should persist after being triggered.
Returns
void
onAggregatedUnrealizedProfit
onAggregatedUnrealizedProfitDescription Registers a callback to be executed when the aggregated unrealized profit reaches a specified value.
Signature
Parameters
value(number): The profit threshold to trigger the callback.callback((aggregate: AggregatePosition<BigNumber>) => void): The function to execute when the condition is met.persistent(boolean, optional): Whether the callback should persist after being triggered.
Returns
void
onAggregatedUnrealizedLoss
onAggregatedUnrealizedLossDescription Registers a callback to be executed when the aggregated unrealized loss reaches a specified value.
Signature
Parameters
value(number): The loss threshold to trigger the callback.callback((aggregate: AggregatePosition<BigNumber>) => void): The function to execute when the condition is met.persistent(boolean, optional): Whether the callback should persist after being triggered.
Returns
void
onAggregatedRealizedProfitPercentage
onAggregatedRealizedProfitPercentageDescription Registers a callback to be executed when the aggregated realized profit percentage reaches a specified value.
Signature
Parameters
value(number): The profit percentage threshold to trigger the callback.callback((aggregate: AggregatePosition<BigNumber>) => void): The function to execute when the condition is met.persistent(boolean, optional): Whether the callback should persist after being triggered.
Returns
void
onAggregatedRealizedLossPercentage
onAggregatedRealizedLossPercentageDescription Registers a callback to be executed when the aggregated realized loss percentage reaches a specified value.
Signature
Parameters
value(number): The loss percentage threshold to trigger the callback.callback((aggregate: AggregatePosition<BigNumber>) => void): The function to execute when the condition is met.persistent(boolean, optional): Whether the callback should persist after being triggered.
Returns
void
onAggregatedUnrealizedProfitPercentage
onAggregatedUnrealizedProfitPercentageDescription Registers a callback to be executed when the aggregated unrealized profit percentage reaches a specified value.
Signature
Parameters
value(number): The profit percentage threshold to trigger the callback.callback((aggregate: AggregatePosition<BigNumber>) => void): The function to execute when the condition is met.persistent(boolean, optional): Whether the callback should persist after being triggered.
Returns
void
onAggregatedUnrealizedLossPercentage
onAggregatedUnrealizedLossPercentageDescription Registers a callback to be executed when the aggregated unrealized loss percentage reaches a specified value.
Signature
Parameters
value(number): The loss percentage threshold to trigger the callback.callback((aggregate: AggregatePosition<BigNumber>) => void): The function to execute when the condition is met.persistent(boolean, optional): Whether the callback should persist after being triggered.
Returns
void
Last updated