# Developers

## Overview

The Nabla Protocol is made up of a number of smart contracts. These include the Nabla core contracts, which include the fundamental AMM logic, as well as a combination of contracts forming a pool ensemble/pool hub and Nabla periphery contracts, which e.g. enable cross-pool swaps.

<figure><img src="/files/RixHkNzHzCHO8968t2pw" alt=""><figcaption><p>Nabla Protocol contracts overview</p></figcaption></figure>

### Nabla Portal

The NablaPortal contract is the main entry point for users to interact with the Nabla ecosystem. It facilitates token swaps through the [NablaRouter](/developers/contract-interfaces/nablarouter.md) contracts, supporting advanced features such as multi-hop swaps and optional interactions with native ETH.

User key functions include **swapExactTokensForTokens** (swap ERC20 tokens for other ERC20 tokens), **swapEthForExactTokens** & **swapExactTokensForEth** (swap from or to native ETH) and **quoteSwapExactTokensForTokens** (retrieve quotes for token swaps, providing estimates of the amount of tokens that can be swapped for a given amount of tokens).

{% content-ref url="/pages/knUQhOP8SgRAYpiKU7DT" %}
[NablaPortal](/developers/contract-interfaces/nablaportal.md)
{% endcontent-ref %}

### Nabla Router

The [NablaRouter](/developers/contract-interfaces/nablarouter.md) contract facilitates seamless token swaps and real-time price feed updates.

User key function include **swapExactTokensForTokens** and **getAmountOut**, which are used to swap tokens and get a quote for a swap, respectively.

{% content-ref url="/pages/c9ynMJJ0YiUcKvR9FfMP" %}
[NablaRouter](/developers/contract-interfaces/nablarouter.md)
{% endcontent-ref %}

### Nabla Backstop Pool

The [NablaBackstopPool](/protocol-overview/liquidity-pools/backstop-pool.md) is a specialised contract and pool built on BackstopPoolCore. It allows users to deposit and withdraw liquidity from the backstop pool and redeem LP tokens from associated swap pools.&#x20;

The backstop pool serves as an insurance mechanism, mitigating risks across a set of swap pools it supports. If a swap pool has low reserves, liquidity providers can perform an insurance withdrawal. This involves burning their swap pool shares in exchange for backstop liquidity.&#x20;

The backstop pool owns all excess liquidity from its [swap pools](/developers/contract-interfaces/swappool.md). It also assumes liability for any liquidity shortfalls. In return for this risk, the pool earns a share of the swap fees.

{% content-ref url="/pages/vSxdKSyoTyboo6vh7hdc" %}
[NablaBackstopPool](/developers/contract-interfaces/nablabackstoppool.md)
{% endcontent-ref %}

### Swap Pool

The [SwapPool](/developers/contract-interfaces/swappool.md) contract facilitates token swaps and liquidity management with features like capped deposits, configurable swap fees, and safe redeem mechanisms. It integrates with the [NablaBackstopPool](/developers/contract-interfaces/nablabackstoppool.md) for risk coverage.

User key functions include **deposit** (swap tokens for pool shares), **withdraw** (redeem pool shares for tokens), **backstopBurn** (burn shares for underlying tokens), and **backstopDrain** (withdraw excess tokens).

{% content-ref url="/pages/mJNJBuFUoMyNc6E13MWH" %}
[SwapPool](/developers/contract-interfaces/swappool.md)
{% endcontent-ref %}


---

# 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.nabla.fi/developers.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.
