> For the complete documentation index, see [llms.txt](https://docs.gable.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gable.finance/v1-flashloan-pool/flash-loan/user-manual/2.-transaction-manifest.md).

# 2. Transaction Manifest

As flash loans are executed within a single transaction, you are required to tailor a transaction. Tailoring and building a transaction can be done in multiple ways, either manually, semi-automatically and fully automatically. To actually understand what happens under the hood, we will first walk through the manual way of tailoring a transaction. To build a transaction manually we need to take a closer look at what is called the "transaction manifest".

### Transaction manifest

"A transaction manifest is the Radix way of building transactions. It makes it possible to compose multiple actions to be executed atomically by describing a sequence of component calls and movements of [resources](https://docs-babylon.radixdlt.com/main/scrypto/resources/introduction.html) between components. In short, full atomic composability becomes possible directly in transactions" - see [link](https://docs-babylon.radixdlt.com/main/scrypto/transaction-manifest/intro.html) for more detail.

Below the most basic transaction is demonstrated as transaction manifest. This is what happens:

1. A "lock fee" method is called on an account address that locks some XRD as fee. "lock\_fee" will immediately add the associated amount of XRD to the fee reserve. This XRD can be used to pay for ongoing processing during the transaction’s execution, and can be spent even if the transaction ultimately fails in its execution. See [article](https://docs-babylon.radixdlt.com/main/scrypto/system/fees.html).
2. A "withdraw" method is called on an account address that takes some amount of a resource from the account. If you want to use XRD to fund a certain action, this method is required to get the XRD into the transaction.
3. A "take\_from\_worktop\_by\_amount" is called on some amount of a resource, takes it from the worktop, and puts it in a bucket. This operation is a bit less intuitive, please read [this](https://docs-babylon.radixdlt.com/main/scrypto/transaction-manifest/intro.html#_the_worktop) post for more information. In essence you can think of the "worktop" as a distribution centre, or a layer on top of a transaction, that orchestrates resources from one instance to the other. Unused resources will be stored in the worktop during a transaction, and have to be withdrawn to be exchanged.
4. A "deposit" method is called that takes some bucket and deposits it into a account address. This is final operation that finalises the transaction.\
   \
   **Note:**  no resources are allowed to be left in the worktop for a transaction to be completed. Therefore it is of importance that all hanging resources are deposited at the end of a transaction.

<pre class="language-http"><code class="lang-http"><a data-footnote-ref href="#user-content-fn-1"># lock fees to pay for the transaction</a>
CALL_METHOD
  Address("[your_account_address]")
  "lock_fee"
  Decimal("[amount]");

# withdraw 10 XRD from account, which goes to the worktop
CALL_METHOD
  Address("[your_account_address]")
  "withdraw"
  ResourceAddress("[xrd_address]")
  Decimal("[amount]");

# take 10 XRD from the worktop and put it in a bucket
TAKE_FROM_WORKTOP_BY_AMOUNT
  Decimal("10")
  Address("[xrd_address]")
  Bucket("xrd");

# deposit the bucket of XRD into the recipient's account
CALL_METHOD
  Address("[your_account_address]")
  "deposit"
  Bucket("xrd");
</code></pre>

The above transaction is considered a simple "one component" transaction. Although the skeleton of the flash loan transaction will be similar, a flash loan will interact with more components during the same transaction, and is therefore considered a complex transaction. The next section will describe what flash loan transaction manifest will look like.

[^1]: This method is redundant, as the radix wallet will add it automatically to any transaction.


---

# 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.gable.finance/v1-flashloan-pool/flash-loan/user-manual/2.-transaction-manifest.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.
