# Logical gate nodes

<div data-with-frame="true"><figure><img src="/files/GFq2f7Hj3pAQAChSjkgD" alt="" width="248"><figcaption><p>Logical Gate Node</p></figcaption></figure></div>

Logical gates combine multiple boolean conditions using logical operators, allowing you to create complex decision logic in your strategies.

### Available Gates

* **AND Gate**\
  Returns true only if all input conditions are true. Useful when you need multiple conditions to be satisfied simultaneously. For example, "APY is high AND liquiditation is far enough."
* **OR Gate**\
  Returns true if any input condition is true. Use this when you want to proceed if at least one condition is met. For example, "Protocol A has high yield OR Protocol B has high yield."
* **NOT Gate**\
  Inverts a single boolean input. Returns true if the input is false, and false if the input is true. Useful for negating conditions.
* **NAND Gate**\
  **Returns true if at least one input is false. Negate the AND gate.**
* **NOR Gate**\
  **Returns true if both inputs are false, false otherwise. Negate the OR gate.**
* **XOR Gate**\
  **Returns true if exactly one input is true, false otherwise. Useful for checking exclusive conditions.**

***

### Using Logical Gates

Connect boolean outputs (from compare nodes, other gates, or signals) to a logical gate's inputs. Select the gate type (AND, OR, or NOT), and the node outputs a combined boolean result.

Logical gates enable advanced decision-making in your strategies. You can chain multiple gates together to create complex conditions, such as checking that multiple protocols meet certain criteria before allocating capital, or creating fallback conditions that trigger if any of several conditions are met.


---

# 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://stazys.gitbook.io/stazys-docs/yield-studio/drag-and-drop-nodes/logical-gate-nodes.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.
