> For the complete documentation index, see [llms.txt](https://docs.tonco.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tonco.io/contracts-v1.6-forthcoming/router_payloads.md).

# Payloads

### router\_payloads

* [Description](#description)
* [Data Storage](#data-storage)
* [Interface](#interface)
* [Messages](#messages)

## Description

These are not standalone messages but **forward-payload formats** carried inside a jetton `transfer_notification` to the [Router](/contracts-v1.6-forthcoming/router.md). The payload's leading op selects the action — fund a user's per-pool Account for minting, fund someone else's Account, or swap against a pool. The router derives the target pool from the sending jetton wallet, so a payload can only act on a real pool, and any leftover or failed funds are returned to the user via PAY\_TO.

## Messages

### POOL\_FUND\_ACCOUNT

Opcode : **0x4468de77**

This is not a message Op this is a payload format for JETTON\_TRANSFER\_NOTIFICATION\
Access Rights: Not a standalone message — a forward payload any user attaches to a jetton transfer to fund their own per-pool Account (mint request). No authorization is needed: the user funds the Account that belongs to their own address, so they can only ever top up their own.<br>

<table data-full-width="true"><thead><tr><th width="90">Path</th><th width="200">Mnemonic</th><th width="180">Type</th><th>Description</th></tr></thead><tbody><tr><td></td><td>op</td><td>Uint(32),op</td><td>POOLV3_FUND_ACCOUNT (0x4468de77)</td></tr><tr><td></td><td>jetton_target_w</td><td>Address(267)</td><td>Address of the jetton0 wallet. Used to compute pool address</td></tr><tr><td></td><td>enough0</td><td>Coins(124)</td><td>When temporary storage (user account) satisfy both enough0/1 amounts - mint would trigger</td></tr><tr><td></td><td>enough1</td><td>Coins(124)</td><td>When temporary storage (user account) satisfy both enough0/1 amounts - mint would trigger</td></tr><tr><td></td><td>needPos</td><td>Uint(64)</td><td>Amount of positions that are enough for the order to be executed</td></tr><tr><td></td><td>passthrough</td><td>Uint(4)</td><td>Amount of positions that will be untouched</td></tr><tr><td></td><td>target_action</td><td>Uint(32)</td><td>Routing of the reforge result (ACTION_TARGET_DEFAULT / ACTION_TARGET_ALM) — see target_action in ACCOUNT_SET_ORDER for details</td></tr><tr><td></td><td>0</td><td>Maybe Cell(1) MintOrder0</td><td>Cell with mint order</td></tr><tr><td>0</td><td>op0</td><td>Uint(32)</td><td>Mint mode (MINT_NOT_LESS / MINT_AS_MUCH_AS_POSSIBLE) — see mintOp in ACCOUNT_SET_ORDER for details</td></tr><tr><td>0</td><td>liquidity0</td><td>Uint(128)</td><td>Amount of liquidity to mint</td></tr><tr><td>0</td><td>tickLower0</td><td>Int(24)</td><td>lower bound of the range in which to mint</td></tr><tr><td>0</td><td>tickUpper0</td><td>Int(24)</td><td>upper bound of the range in which to mint</td></tr><tr><td>0</td><td>receiver</td><td>Address(267)</td><td>Address of receiver of the NFT</td></tr><tr><td></td><td>1</td><td>Maybe Cell(1) MintOrder1</td><td>Cell with mint order</td></tr><tr><td>1</td><td>op1</td><td>Uint(32)</td><td>Mint mode (MINT_NOT_LESS / MINT_AS_MUCH_AS_POSSIBLE) — see mintOp in ACCOUNT_SET_ORDER for details</td></tr><tr><td>1</td><td>liquidity1</td><td>Uint(128)</td><td>Amount of liquidity to mint</td></tr><tr><td>1</td><td>tickLower1</td><td>Int(24)</td><td>lower bound of the range in which to mint</td></tr><tr><td>1</td><td>tickUpper1</td><td>Int(24)</td><td>upper bound of the range in which to mint</td></tr><tr><td>1</td><td>receiver</td><td>Address(267)</td><td>Address of receiver of the NFT</td></tr><tr><td></td><td>2</td><td>Maybe Cell(1) MintOrder2</td><td>Cell with mint order</td></tr><tr><td>2</td><td>op2</td><td>Uint(32)</td><td>Mint mode (MINT_NOT_LESS / MINT_AS_MUCH_AS_POSSIBLE) — see mintOp in ACCOUNT_SET_ORDER for details</td></tr><tr><td>2</td><td>liquidity2</td><td>Uint(128)</td><td>Amount of liquidity to mint</td></tr><tr><td>2</td><td>tickLower2</td><td>Int(24)</td><td>lower bound of the range in which to mint</td></tr><tr><td>2</td><td>tickUpper2</td><td>Int(24)</td><td>upper bound of the range in which to mint</td></tr><tr><td>2</td><td>receiver</td><td>Address(267)</td><td>Address of receiver of the NFT</td></tr><tr><td></td><td>3</td><td>Maybe Cell(1) MintOrder3</td><td>Cell with mint order</td></tr><tr><td>3</td><td>op3</td><td>Uint(32)</td><td>Mint mode (MINT_NOT_LESS / MINT_AS_MUCH_AS_POSSIBLE) — see mintOp in ACCOUNT_SET_ORDER for details</td></tr><tr><td>3</td><td>liquidity3</td><td>Uint(128)</td><td>Amount of liquidity to mint</td></tr><tr><td>3</td><td>tickLower3</td><td>Int(24)</td><td>lower bound of the range in which to mint</td></tr><tr><td>3</td><td>tickUpper3</td><td>Int(24)</td><td>upper bound of the range in which to mint</td></tr><tr><td>3</td><td>receiver</td><td>Address(267)</td><td>Address of receiver of the NFT</td></tr></tbody></table>

<details>

<summary>TL-B Description</summary>

This is a preliminary tl-b - subject to change

{% code title="Tlb for POOL\_FUND\_ACCOUNT" overflow="wrap" lineNumbers="true" %}

```javascript
POOL_FUND_ACCOUNT#4468de77 
    jetton_target_w:MsgAddress
    enough0:(VarUInteger 16)
    enough1:(VarUInteger 16)
    needPos:uint64
    passthrough:uint4
    target_action:uint32
    MintOrder0:(Maybe ^MintOrder0Type)
    MintOrder1:(Maybe ^MintOrder1Type)
    MintOrder2:(Maybe ^MintOrder2Type)
    MintOrder3:(Maybe ^MintOrder3Type)
= ContractMessages;
_ 
    op0:uint32
    liquidity0:uint128
    tickLower0:int24
    tickUpper0:int24
    receiver:MsgAddress
= MintOrder0Type;
_ 
    op1:uint32
    liquidity1:uint128
    tickLower1:int24
    tickUpper1:int24
    receiver:MsgAddress
= MintOrder1Type;
_ 
    op2:uint32
    liquidity2:uint128
    tickLower2:int24
    tickUpper2:int24
    receiver:MsgAddress
= MintOrder2Type;
_ 
    op3:uint32
    liquidity3:uint128
    tickLower3:int24
    tickUpper3:int24
    receiver:MsgAddress
= MintOrder3Type;
```

{% endcode %}

</details>

### POOL\_FUND\_SOMEONES\_ACCOUNT

Opcode : **0x134b6d30**

This is not a message Op this is a payload format for JETTON\_TRANSFER\_NOTIFICATION\
Access Rights: Not a standalone message — a forward payload that funds another user's (`to_user`) Account rather than the sender's. Used by the Arbiter, which acts like a WalletAccount but always credits itself when funding through this path.<br>

<table data-full-width="true"><thead><tr><th width="90">Path</th><th width="200">Mnemonic</th><th width="180">Type</th><th>Description</th></tr></thead><tbody><tr><td></td><td>op</td><td>Uint(32),op</td><td></td></tr><tr><td></td><td>jetton_target_w</td><td>Address(267)</td><td>Address of the second jetton wallet (first is identified by sender_address). Used to compute pool address</td></tr><tr><td></td><td>to_user</td><td>Address(267)</td><td>User to fund</td></tr></tbody></table>

<details>

<summary>TL-B Description</summary>

This is a preliminary tl-b - subject to change

{% code title="Tlb for POOL\_FUND\_SOMEONES\_ACCOUNT" overflow="wrap" lineNumbers="true" %}

```javascript
POOL_FUND_SOMEONES_ACCOUNT#134b6d30 
    jetton_target_w:MsgAddress
    to_user:MsgAddress
= ContractMessages;
```

{% endcode %}

</details>

### POOL\_SWAP

Opcode : **0xa7fb58f8**

This is not a message Op this is a payload format for JETTON\_TRANSFER\_NOTIFICATION\
Access Rights: Not a standalone message — a forward payload any user attaches to a jetton transfer to swap against a pool. No sender authorization is enforced here: the pool is derived from the sending jetton wallet, swapped funds and excess gas go to the owner/excess addresses carried in the payload, and the swap result is returned via PAY\_TO.<br>

<table data-full-width="true"><thead><tr><th width="90">Path</th><th width="200">Mnemonic</th><th width="180">Type</th><th>Description</th></tr></thead><tbody><tr><td></td><td>op</td><td>Uint(32),op</td><td></td></tr><tr><td></td><td>target_jetton_wallet</td><td>Address(267)</td><td>Router's jetton wallet of the OTHER side of the swap. Together with the sending jetton wallet it identifies the pool (and thus the swap direction)</td></tr><tr><td></td><td>sqrtPriceLimitX96</td><td>Uint(160),PriceX96</td><td>Limit price. Swap won't go beyond it</td></tr><tr><td></td><td>minOutAmount</td><td>Coins(124)</td><td>Minimum acceptable output amount (slippage guard). If the swap output is below this, it is reverted (LOWER_THEN_MIN_OUT) and funds are returned</td></tr><tr><td></td><td>owner_address</td><td>Address(267)</td><td>Address of the sender</td></tr><tr><td></td><td>0</td><td>Maybe Cell(1) multihop_cell</td><td>Cell with multihop data</td></tr><tr><td>0</td><td>target_address</td><td>Address(267)</td><td>Address of the receiver</td></tr><tr><td>0</td><td>ok_forward_amount</td><td>Coins(124)</td><td>Amount of GRAM to use for forward payload that would be sent with the result of the swap</td></tr><tr><td>0</td><td>ok_forward_payload</td><td>Cell(0),Maybe, Payload</td><td>Payload for processing by target with swapped coins</td></tr><tr><td>0</td><td>ret_forward_amount</td><td>Coins(124)</td><td>Amount of GRAM to use for forward payload that would be sent with the change for the swap (if any)</td></tr><tr><td>0</td><td>ret_forward_payload</td><td>Cell(0),Maybe, Payload</td><td>Payload for processing by owner with change/return coins</td></tr><tr><td>0</td><td>excess_address</td><td>Address(267)</td><td>Address to get excess gas</td></tr><tr><td></td><td>1</td><td>Cell(0) referral_cell</td><td>Indexer-only. Partner referral marker, not parsed on-chain (read off-chain by indexer)</td></tr><tr><td>1</td><td>code</td><td>Uint(32),Indexer</td><td>Partner referral code</td></tr></tbody></table>

<details>

<summary>TL-B Description</summary>

This is a preliminary tl-b - subject to change

{% code title="Tlb for POOL\_SWAP" overflow="wrap" lineNumbers="true" %}

```javascript
POOL_SWAP#a7fb58f8 
    target_jetton_wallet:MsgAddress
    sqrtPriceLimitX96:uint160
    minOutAmount:(VarUInteger 16)
    owner_address:MsgAddress
    multihop_cell:(Maybe ^Multihop_cellType)
    referral_cell:^Referral_cellType   // optional ref (present only if a ref is left)
= ContractMessages;
_ 
    target_address:MsgAddress
    ok_forward_amount:(VarUInteger 16)
    ok_forward_payload:(Maybe ^Cell)
    ret_forward_amount:(VarUInteger 16)
    ret_forward_payload:(Maybe ^Cell)
    excess_address:MsgAddress
= Multihop_cellType;
_ 
    code:uint32
= Referral_cellType;
```

{% endcode %}

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tonco.io/contracts-v1.6-forthcoming/router_payloads.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
