# "Till" pattern

Ekubo is a singleton contract that utilizes the "till" pattern. All pools and tokens are represented as state in the singleton. The till pattern was [publicly introduced](https://www.youtube.com/watch?v=xFp8RlRq0qU) at EthCC\[5] and is also described [here](https://github.com/OpenZeppelin/openzeppelin-contracts/issues/4361#issuecomment-1595095135). When interacting with pools in Ekubo, all token payments may be deferred until you have completed all the Core operations (e.g. swap, add liquidity, collect fees).

{% hint style="info" %}
Even though the entrypoint for all methods is named `#lock`, Ekubo protocol supports reentrancy. Locks can be nested, meaning any contract you call can also interact with Ekubo.
{% endhint %}


---

# 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.ekubo.org/integration-guides/reference/till-pattern.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.
