πŸ§ͺ TLB

Token

This is a helper TLB type used to describe a token, which can either be TON or a Jetton:

token$00 jetton_master_address:MsgAddress = Token;
token$01 = Token;

Swap

When a user initiates a token swap by sending Jettons to the Vault contract, the swap parameters are provided in the Jetton's transfer_notification payload, which follows this TLB structure:

swap_params#_ recipient:MsgAddress deadline:uint64 success_payload:Maybe(^Cell) fail_payload:Maybe(^Cell) = SwapParams;
swap_step#_ pool:MsgAddress to_token:Token limit:(VarUInteger 16) next:Maybe(^SwapStep) = SwapStep;
initial_step#_ to_token:Token limit:(VarUInteger 16) next:Maybe(^SwapStep) = InitialStep;

swap_notification#0x278f5089
    query_id:uint64
    from_token:Token
    sender:MsgAddress
    amount:(VarUInteger 16)
    steps:^InitalStep
    params:^SwapParams

Add liquidity

When a user contributes Jettons/TON to a liquidity pool via the Vault contract, the liquidity parameters are transmitted within the Jetton's transfer_notification payload. This payload adheres to the following TLB structure:

Remove liquidity

Since the Pool contract also acts as a Jetton Master, it supports the burn message, which facilitates liquidity withdrawal from the pool.

According to the Jetton specification, the Jetton Master may support an optional custom_payload parameter in burn messages. Crouton Finance uses this field to specify additional withdrawal parameters, such as slippage control and whether liquidity should be withdrawn in a balanced manner or in a specific pooled token.

Last updated