Skip to main content

Common Types

Type Asset

TL-B
native$0000 = Asset;
jetton$0001 workchain_id:int8 address:uint256 = Asset;
extra_currency$0010 currency_id:int32 = Asset;

Type Timestamp

TL-B
timestamp#_ _:uint32 = Timestamp;

Type SwapKind

TL-B
given_in$0 = SwapKind;
given_out$1 = SwapKind; // Not implemented.

Type SwapParams

Set of parameters relevant for the entire swap.

TL-B
swap_params#_ deadline:Timestamp recipient_addr:MsgAddressInt referral_addr:MsgAddress
fulfill_payload:(Maybe ^Cell) reject_payload:(Maybe ^Cell) = SwapParams;
NameTypeRequiredDescription
deadlineTimestampnoSpecifies a deadline for the swap. If the swap reaches the Pool after this time, it will be rejected. Default: 0 (disabled)
recipient_addrMsgAddressIntnoSpecifies an address where funds will be sent after the swap. Default: sender's address
referral_addrMsgAddressnoReferral address. Required for the Referral Program
fulfill_payloadMaybe ^CellnoCustom payload that will be attached to the fund transfer upon a successful swap
reject_payloadMaybe ^CellnoCustom payload that will be attached to the fund transfer upon a rejected swap

Type SwapStep

Set of parameters relevant for the specific step.

TL-B
step#_ pool_addr:MsgAddressInt params:SwapStepParams = SwapStep;
NameTypeRequiredDescription
pool_addrMsgAddressIntyesThe pool is responsible for swapping assets at this step
paramsSwapStepParamsyesSet of extra parameters relevant for a specific step

Type SwapStepParams

warning

Use the limit parameter to protect against potential losses due to slippage. If the output token amount is less than the specified limit, the sent funds will be refunded.

Set of extra parameters relevant for a specific step.

TL-B
step_params#_ kind:SwapKind limit:Coins next:(Maybe ^SwapStep) = SwapStepParams;
NameTypeRequiredDescription
kindSwapKindnoNote: Only given_in option is implemented
limitCoinsnoMinimum output of the swap. If the actual value is less than specified, the swap will be rejected
nextMaybe ^ SwapStepnoReference to the next step. Can be used for multi-hop swaps

Type PoolType

TL-B
volatile$0 = PoolType;
stable$1 = PoolType;

Type PoolParams

TL-B
pool_params#_ pool_type:PoolType asset0:Asset asset1:Asset = PoolParams;
NameTypeRequiredDescription
pool_typePoolTypeyes
asset0Assetyes
asset1Assetyes

Contract Native Vault

Message swap

TL-B
swap#ea06185d query_id:uint64 amount:Coins _:SwapStep swap_params:^SwapParams = InMsgBody;
NameTypeRequiredDescription
query_iduint64noQuery ID
amountCoinsyesTON amount for the swap
swap_params^SwapParamsyesSet of parameters relevant for the entire swap

Message deposit_liquidity

warning

Use min_lp_amount to avoid potential losses. If the minted amount of LP tokens is less than min_lp_amount, the deposited funds will be refunded.

TL-B
deposit_liquidity#d55e4686 query_id:uint64 amount:Coins pool_params:PoolParams
min_lp_amount:Coins
asset0_target_balance:Coins asset1_target_balance:Coins
fulfill_payload:(Maybe ^Cell)
reject_payload:(Maybe ^Cell) = InMsgBody;
NameTypeRequiredDescription
query_iduint64noQuery ID
amountCoinsyes
pool_paramsPoolParamsyes
min_lp_amountCoinsnoMinimum amount of LP to recieve. If not reached - funds returns
asset0_target_balanceCoinsyesTarget amount for mint lp. If both target reached - LP will be minted(if min_lp>actual lp)
asset1_target_balanceCoinsyesTarget amount for mint lp. If both target reached - LP will be minted(if min_lp>actual lp)
fulfill_payloadMaybe ^Cellno
reject_payloadMaybe ^Cellno

Message payout

TL-B
payout#474f86cf query_id:uint64 payload:(Maybe ^Cell) = InMsgBody;
NameTypeRequiredDescription
query_iduint64noQuery ID
payloadMaybe ^Cellno

Contract Jetton Vault

Message swap

TL-B
swap#e3a0d482 _:SwapStep swap_params:^SwapParams = ForwardPayload;
NameTypeRequiredDescription
swap_params^SwapParamsyes

Message deposit_liquidity

warning

Use min_lp_amount to avoid potential losses. If the minted amount of LP tokens is less than min_lp_amount, the deposited funds will be refunded.

TL-B
deposit_liquidity#40e108d6 pool_params:PoolParams min_lp_amount:Coins
asset0_target_balance:Coins asset1_target_balance:Coins
fulfill_payload:(Maybe ^Cell)
reject_payload:(Maybe ^Cell) = ForwardPayload;
NameTypeRequiredDescription
pool_paramsPoolParamsyes
min_lp_amountCoinsno
asset0_target_balanceCoinsyes
asset1_target_balanceCoinsyes
fulfill_payloadMaybe ^Cellno
reject_payloadMaybe ^Cellno