# Automatic Arbitrage with Flash Loan / Flash Swap

Similar to TIME, TUP also offers an internal exchange functionality using the native network token directly with the smart contract in a local pool. This way, instead of trading externally, users can perform direct token swaps, and the trading fees are distributed proportionally among TUP holders.

Considering this feature, the developers of TUP decided to innovate and implement an automatic arbitrage mechanism with the token. With each transaction, TUP checks the internal asset price compared to the prices on decentralized exchanges (Sushi, Pancakeswap, Uniswap, Quickswap, etc.). If the protocol deems it advantageous, it initiates a Flash Loan procedure to raise the necessary funds for executing the arbitrage. In the event that Flash Loan resources are not available on the network, it can still opt for the Flash Swap mechanism on the decentralized exchange. This way, if an arbitrage opportunity is found, TUP carries out the arbitrage and distributes the profits to TUP holders.

This feature is compelling because even if a bot identifies an arbitrage opportunity involving TUP, the token anticipates it on behalf of the investors.

<mark style="color:red;">**ATTENTION:**</mark> Since we rely on third parties protocols for automatic arbitrage, not always will this mechanism function in the same way and correctly on all networks.


---

# 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.timetoken.finance/time-is-up-tup-+-worker/automatic-arbitrage-with-flash-loan-flash-swap.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.
