> For the complete documentation index, see [llms.txt](https://docs.tanx.fi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tanx.fi/tech/tech-docupaper/transactional-flow/the-transfer-flow.md).

# The transfer flow

<figure><img src="/files/MqVjuZoWce6FB66JwFFJ" alt=""><figcaption><p>Transafer flow architecture</p></figcaption></figure>

### **1.** User enters a request to transfer funds on tanX. <a href="#alice_enters_a_request_to_transfer_funds_in_the_application_spot" id="alice_enters_a_request_to_transfer_funds_in_the_application_spot"></a>

User enters a request to transfer funds using tanX.

### **2.** tanX sends a `TransferRequest` transaction to Starkware.

tanX sends out a transfer request transaction to the Starkware gateway, using the `add_transaction` API with the `TransferRequest` transaction type.

The request includes the following information:

| `amount`               | The quantized amount of the asset to transfer.                                      |
| ---------------------- | ----------------------------------------------------------------------------------- |
| `sender_public_key`    | The sender’s public Stark key.                                                      |
| `sender_vault_id`      | The sender’s vault id.                                                              |
| `receiver_public_key`  | The receiver’s public Stark key.                                                    |
| `receiver_vault_id`    | The receiver’s vault id.                                                            |
| `token`                | The token to be transferred.                                                        |
| `fee_info_user`        | The maximum fee that the sender is willing to pay for the transaction.              |
| `expiration_timestamp` | The time after which the request is no longer valid, in hours since the Unix epoch. |
| `nonce`                | A nonce issued by tanX, to prevent replay attacks.                                  |
| `signature`            | The sender’s signature.                                                             |

### **3.** Starkware checks the validity of the request.

Starkware checks the following to validate the transfer request:

* The balance in the sender’s vault is sufficient to fulfill the transaction.
* The maximum fee that the party is willing to pay for the transaction is not less than the actual fee.
* The transaction request has not expired.
* According to the orders tree, the order has not already been fulfilled.

### **4.** Starkware includes the transfer in a batch.

If the transfer request is valid, the transfer is included in a batch to be submitted on-chain along with a validity proof.


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.tanx.fi/tech/tech-docupaper/transactional-flow/the-transfer-flow.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
