Module orca_whirlpool.internal.types.enums
Expand source code
from enum import Enum
class PositionStatus(str, Enum):
PriceIsBelowRange = "Below Range"
PriceIsAboveRange = "Above Range"
PriceIsInRange = "In Range"
class SwapDirection(str, Enum):
AtoB = "A to B"
BtoA = "B to A"
@property
def is_a_to_b(self):
return self == SwapDirection.AtoB
@property
def is_b_to_a(self):
return self == SwapDirection.BtoA
@property
def is_price_down(self):
return self.is_a_to_b
@property
def is_price_up(self):
return self.is_b_to_a
class SpecifiedAmount(str, Enum):
SwapInput = "Swap Input"
SwapOutput = "Swap Output"
@property
def is_swap_input(self) -> bool:
return self == SpecifiedAmount.SwapInput
@property
def is_swap_output(self) -> bool:
return self == SpecifiedAmount.SwapOutput
def is_a(self, direction: SwapDirection) -> bool:
return self.is_swap_input == direction.is_a_to_b
def is_b(self, direction: SwapDirection) -> bool:
return not self.is_a(direction)
class TickArrayReduction(str, Enum):
No = "No"
Conservative = "Conservative"
Aggressive = "Aggressive"
class RemainingAccountsType(str, Enum):
TransferHookA = "TransferHookA"
TransferHookB = "TransferHookB"
TransferHookReward = "TransferHookReward"
TransferHookInput = "TransferHookInput"
TransferHookIntermediate = "TransferHookIntermediate"
TransferHookOutput = "TransferHookOutput"
SupplementalTickArrays = "SupplementalTickArrays"
SupplementalTickArraysOne = "SupplementalTickArraysOne"
SupplementalTickArraysTwo = "SupplementalTickArraysTwo"
Classes
class PositionStatus (value, names=None, *, module=None, qualname=None, type=None, start=1)
-
An enumeration.
Expand source code
class PositionStatus(str, Enum): PriceIsBelowRange = "Below Range" PriceIsAboveRange = "Above Range" PriceIsInRange = "In Range"
Ancestors
- builtins.str
- enum.Enum
Class variables
var PriceIsAboveRange
var PriceIsBelowRange
var PriceIsInRange
class RemainingAccountsType (value, names=None, *, module=None, qualname=None, type=None, start=1)
-
An enumeration.
Expand source code
class RemainingAccountsType(str, Enum): TransferHookA = "TransferHookA" TransferHookB = "TransferHookB" TransferHookReward = "TransferHookReward" TransferHookInput = "TransferHookInput" TransferHookIntermediate = "TransferHookIntermediate" TransferHookOutput = "TransferHookOutput" SupplementalTickArrays = "SupplementalTickArrays" SupplementalTickArraysOne = "SupplementalTickArraysOne" SupplementalTickArraysTwo = "SupplementalTickArraysTwo"
Ancestors
- builtins.str
- enum.Enum
Class variables
var SupplementalTickArrays
var SupplementalTickArraysOne
var SupplementalTickArraysTwo
var TransferHookA
var TransferHookB
var TransferHookInput
var TransferHookIntermediate
var TransferHookOutput
var TransferHookReward
class SpecifiedAmount (value, names=None, *, module=None, qualname=None, type=None, start=1)
-
An enumeration.
Expand source code
class SpecifiedAmount(str, Enum): SwapInput = "Swap Input" SwapOutput = "Swap Output" @property def is_swap_input(self) -> bool: return self == SpecifiedAmount.SwapInput @property def is_swap_output(self) -> bool: return self == SpecifiedAmount.SwapOutput def is_a(self, direction: SwapDirection) -> bool: return self.is_swap_input == direction.is_a_to_b def is_b(self, direction: SwapDirection) -> bool: return not self.is_a(direction)
Ancestors
- builtins.str
- enum.Enum
Class variables
var SwapInput
var SwapOutput
Instance variables
var is_swap_input : bool
-
Expand source code
@property def is_swap_input(self) -> bool: return self == SpecifiedAmount.SwapInput
var is_swap_output : bool
-
Expand source code
@property def is_swap_output(self) -> bool: return self == SpecifiedAmount.SwapOutput
Methods
def is_a(self, direction: SwapDirection) ‑> bool
-
Expand source code
def is_a(self, direction: SwapDirection) -> bool: return self.is_swap_input == direction.is_a_to_b
def is_b(self, direction: SwapDirection) ‑> bool
-
Expand source code
def is_b(self, direction: SwapDirection) -> bool: return not self.is_a(direction)
class SwapDirection (value, names=None, *, module=None, qualname=None, type=None, start=1)
-
An enumeration.
Expand source code
class SwapDirection(str, Enum): AtoB = "A to B" BtoA = "B to A" @property def is_a_to_b(self): return self == SwapDirection.AtoB @property def is_b_to_a(self): return self == SwapDirection.BtoA @property def is_price_down(self): return self.is_a_to_b @property def is_price_up(self): return self.is_b_to_a
Ancestors
- builtins.str
- enum.Enum
Class variables
var AtoB
var BtoA
Instance variables
var is_a_to_b
-
Expand source code
@property def is_a_to_b(self): return self == SwapDirection.AtoB
var is_b_to_a
-
Expand source code
@property def is_b_to_a(self): return self == SwapDirection.BtoA
var is_price_down
-
Expand source code
@property def is_price_down(self): return self.is_a_to_b
var is_price_up
-
Expand source code
@property def is_price_up(self): return self.is_b_to_a
class TickArrayReduction (value, names=None, *, module=None, qualname=None, type=None, start=1)
-
An enumeration.
Expand source code
class TickArrayReduction(str, Enum): No = "No" Conservative = "Conservative" Aggressive = "Aggressive"
Ancestors
- builtins.str
- enum.Enum
Class variables
var Aggressive
var Conservative
var No