almanak_library.models.params
ABC
abstractmethod
Any
Dict
Optional
BaseModel
Field
validator
ActionType
SwapSide
Params Objects
class Params(BaseModel, ABC)
type
validate
@abstractmethod
def validate() -> None
__str__
@abstractmethod
def __str__() -> str
model_dump
def model_dump() -> Dict[str, Any]
from_dict
@classmethod
def from_dict(cls, data: Dict[str, Any]) -> "Params"
TransferParams Objects
class TransferParams(Params)
type
from_address
to_address
amount
token decimal unit (wei)
nonce_counter
must_not_be_empty
@validator("from_address", "to_address", check_fields=False)
def must_not_be_empty(cls, v)
validate
def validate()
__str__
def __str__()
WrapParams Objects
class WrapParams(Params)
type
from_address
amount
token decimal unit (wei)
must_not_be_empty
@validator("from_address", check_fields=False)
def must_not_be_empty(cls, v)
validate
def validate()
__str__
def __str__()
UnwrapParams Objects
class UnwrapParams(Params)
type
from_address
token_address
amount
must_not_be_empty
@validator("from_address", check_fields=False)
def must_not_be_empty(cls, v)
validate
def validate()
__str__
def __str__()
ApproveParams Objects
class ApproveParams(Params)
type
token_address
spender_address
from_address
amount
token decimal unit (wei)
must_not_be_empty
@validator("token_address",
"spender_address",
"from_address",
check_fields=False)
def must_not_be_empty(cls, v)
validate
def validate()
__str__
def __str__()
SwapParams Objects
class SwapParams(Params)
type
side
tokenIn
tokenOut
fee
recipient
amount
slippage
e.g. 0.05 is 5%
amountOutMinimum
amountInMaximum
transfer_eth_in
optional
sqrtPriceLimitX96
not used for now
must_not_be_empty
@validator("tokenIn", "tokenOut", "fee", "recipient", check_fields=False)
def must_not_be_empty(cls, v)
must_be_positive
@validator("amount", check_fields=False)
def must_be_positive(cls, v)
validate
def validate()
__str__
def __str__()
model_dump
def model_dump(*args, **kwargs)
OpenPositionParams Objects
class OpenPositionParams(Params)
type
token0
token1
fee
price_lower
price_upper
amount0_desired
amount1_desired
recipient
amount0_min
amount1_min
slippage
must_not_be_empty
@validator(
"token0",
"token1",
"fee",
"price_lower",
"price_upper",
"recipient",
check_fields=False,
)
def must_not_be_empty(cls, v)
must_be_positive
@validator("price_lower", "price_upper", check_fields=False)
def must_be_positive(cls, v)
amount_desired_must_be_non_negative
@validator("amount0_desired", "amount1_desired", check_fields=False)
def amount_desired_must_be_non_negative(cls, v)
validate
def validate()
__str__
def __str__()
ClosePositionParams Objects
class ClosePositionParams(Params)
type
position_id
recipient
token0
token1
amount0_min
amount1_min
slippage
pool_address
must_not_be_empty
@validator("position_id", "recipient", "token0", "token1", check_fields=False)
def must_not_be_empty(cls, v)
validate
def validate()
__str__
def __str__()