# Plach

> Plach is the AMM on Intear DEX: constant-product pools of NEAR, NEP-141 and NEP-245 tokens, with split and multi-pool routes, liquidity shares, launch pools and pool fees.

This page is part of the Plach docs. Plach is the DEX `slimedragon.near/xyk` on the Intear DEX contract, `dex.intear.near`, and every call goes to that contract. https://docs.intear.tech/plach/llms-full.txt has all of its pages in one file, and https://docs.intear.tech/llms.txt lists every page of the Intear docs.

Plach is an AMM (automated market maker) that runs inside [Intear DEX](https://docs.intear.tech/intear-dex.md). Its pools hold two assets each and price them with a constant product (`x * y = k`). The app is at [dex.intea.rs](https://dex.intea.rs/).

Plach is a DEX on the engine, so there's no Plach contract to call. Every call goes to the engine, `dex.intear.near`, with Plach's DEX ID:

```
slimedragon.near/xyk
```

- Swaps use the engine's [`swap_simple`](https://docs.intear.tech/intear-dex/guides/swaps.md) or [operations](https://docs.intear.tech/intear-dex/guides/operations.md), with a Plach route in `message`.
- Everything else, like adding liquidity or creating pools, is a [`dex_call`](https://docs.intear.tech/intear-dex/guides/dexes.md#dex_call), and reads are [`dex_view`](https://docs.intear.tech/intear-dex/guides/dexes.md#dex_view).
- Arguments and results are [Borsh](https://borsh.io/), in base64. [Types](https://docs.intear.tech/plach/reference/types.md) has the layout of each.

The examples use [near CLI](https://docs.intear.tech/intear-dex/quickstart.md#before-you-start), like the Intear DEX docs.

:::caution
The contracts are not audited.
:::

## Pools

Each pool has an ID, counted from 0 in the order pools were created. For example, pool 221 is NEAR/USDt and pool 85 is NEAR/USDC. Pools can hold NEAR, NEP-141 and NEP-245 assets, but not NFTs.

| Kind | Liquidity | Fees |
| --- | --- | --- |
| Public | Anyone can add liquidity, and gets shares of the pool | Set at creation, can't change |
| Private | Only the owner adds and removes liquidity | The owner can change them, until they lock the pool |
| Launch | All of a new token, against "phantom" liquidity of a quote asset. Can't be added or removed | Set at creation, can't change |

See [Pools](https://docs.intear.tech/plach/guides/pools.md).

## Fees

The creator of a pool sets its fees: who gets what share of each swap. A fee can go to the pool's liquidity providers, go to an account in either of the pool's assets, or change over time. Plach takes 20% of every fee as its protocol fee. Apps charge their own fee on the swaps they bring with Intear DEX's [referral fees](https://docs.intear.tech/intear-dex/guides/referral-fees.md). See [Fees](https://docs.intear.tech/plach/guides/fees.md).

## What you can do

- **Swap**: Through one pool, a chain of pools, or split across several routes, in one swap.
- **Provide liquidity**: Add NEAR and a token to a public pool and earn its fees, in either asset or reinvested.
- **Create pools**: Public, private or launch pools, with your own fees.
- **Earn referral fees**: Charge up to 5% on the swaps your app sends, with Intear DEX's [referral fees](https://docs.intear.tech/intear-dex/guides/referral-fees.md).

## Next steps

- [Swaps](https://docs.intear.tech/plach/guides/swaps.md): The swap message, routes, and how prices work.
- [Methods](https://docs.intear.tech/plach/reference/methods.md): Every call and view of Plach.
- [DEX Aggregator](https://docs.intear.tech/dex-aggregator.md): Get Plach routes built for you, as ready-to-sign transactions.
