# Redeem Protocol Fees

{% hint style="info" %}
Note: The CREATOR must opt-in to the liquidity assets separately before receiving them.
{% endhint %}

### Transaction Group:

0\. Pay - pay fees in Algo from User to Pool

* fees to cover Tx 1,2
* Signed by User

```
{
  "txn": {
    "type": "pay",
    "rcv": "{POOL_ADDRESS}",
    "snd": "{USER_ADDRESS",
    "amt": 2000,
    ...
  },
  "sig": "{USER_SIG}",
}
```

1. App Call - NoOp call to Validator App with args \['fees']

* Signed by Pool LogicSig

```
{
  "txn": {
    "type": "appl",
    "snd": "{POOL_ADDRESS}",
    "apid": {VALIDATOR_APP_ID},
    "apan": 0, // OnComplete: NoOp
    "apaa": ['ZmVlcw=='], // ['fees']
    "apas": [{ASSET1_ID}, {ASSET2_ID}, {LIQUIDITY_ASSET_ID}], // or just [{ASSET1_ID}, {LIQUIDITY_ASSET_ID}] if asset 2 is Algo
    ...
  },
  "lsig": "{POOL_LOGICSIG}",
}
```

2\. AssetTransfer - Transfer of liquidity asset from Pool to CREATOR account

* Signed by Pool LogicSig

```
{
  "txn": {
    "type": "axfer",
    "arcv": "{CREATOR_ADDRESS}",
    "snd": "{POOL_ADDRESS}",
    "xaid": {LIQUIDITY_ASSET_ID},
    "aamt": {ASSET_AMOUNT},
    ...
  },
  "lsig": "{POOL_LOGICSIG}",
}
```

### Validator App State Changes

**Global State**

None

**Pool Account Local State**

* `o{LIQUIDITY_ASSET_ID}: {int}` // total outstanding unredeemed liquidity asset amount
* `p: {int}` // unclaimed protocol fee liquidity asset amount

**Creator Local State**

None


---

# Agent Instructions: 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.tinyman.org/v1-integration/transactions/redeem-protocol-fees.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.
