# Jediswap v2

## Overview

JediSwap V2 is a Cairo fork of Uniswap V3. The smart contract system comprises of many libraries, which together make the Core and Periphery.

Core contracts provide fundamental safety guarantees for all parties interacting with JediSwap. They define the logic of pool generation, the pools themselves, and the interactions involving the respective assets therein.

Periphery contracts interact with one or more Core contracts but are not part of the core. They are designed to provide methods of interacting with the core that increase clarity and user safety.

External calls will primarily call the periphery interfaces. Externally available functions are all viewable in the reference documentation. Internal functions are viewable on the JediSwap V2 Github repo.

### Core <a href="#core" id="core"></a>

> [**Core Source Code**](https://github.com/jediswaplabs/JediSwap-v2-core)

The core consists of a factory and a pool deployer contract. The factory creates the pools.

#### Factory <a href="#factory" id="factory"></a>

> [**Factory Reference**](/for-developers/jediswap-v2/core/jediswap_v2_factory.md)

The factory defines the logic for generating pools. A pool is defined by two tokens, which make up the asset pair, and a fee. There can be multiple pools of the same asset pair, distinguished only by their swap fee.

#### Pools <a href="#pools" id="pools"></a>

> [**Pool Reference**](/for-developers/jediswap-v2/core/jediswap_v2_pool.md)

Pools primarily serve as automated market makers for the paired assets.

### Periphery <a href="#periphery" id="periphery"></a>

> [**Periphery Source Code**](https://github.com/jediswaplabs/JediSwap-v2-periphery)

The periphery is a constellation of smart contracts designed to support interactions with the core. As the protocol is a permissionless system, the contracts described below have no special privileges and are only a small subset of possible periphery-like contracts.

#### SwapRouter <a href="#swaprouter" id="swaprouter"></a>

> [**Swap Router Reference**](/for-developers/jediswap-v2/periphery/jediswap_v2_swap_router.md)

> [**Swap Router Interface**](/for-developers/jediswap-v2/periphery/jediswap_v2_swap_router.md#abi)

The swap router supports all the basic requirements of a front-end offering trading. It natively supports single trades (x to y) and multihop trades (e.g. x to y to z).

#### NFT Position Manager <a href="#nftpositionmanager" id="nftpositionmanager"></a>

> [**NFT Position Manager Reference**](/for-developers/jediswap-v2/periphery/jediswap_v2_nft_position_manager.md)

> [**NFT Position Manager Interface**](/for-developers/jediswap-v2/periphery/jediswap_v2_nft_position_manager.md#abi)

The position manager handles the logic transactions involving the creation, adjustment, or exiting of positions.


---

# 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.jediswap.xyz/for-developers/jediswap-v2.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.
