# Intear DEX

> Intear DEX is a NEAR smart contract that runs many DEXs inside one contract: inner balances, swaps, and calls to DEXs, all without cross-contract calls.

This page is part of the Intear DEX docs. Intear DEX is the `dex.intear.near` contract. https://docs.intear.tech/intear-dex/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.

Intear DEX is a NEAR smart contract, the **engine**, that runs many DEXs inside one contract. It's deployed at:

```
dex.intear.near
```

Each DEX is a small WebAssembly program stored in the engine. The engine runs it when you swap or call it, holds the tokens of every user and DEX, and moves them between balances once the DEX has done its math. Swaps don't need cross-contract calls, so a swap through several DEXs happens in one receipt, and a failed swap leaves no tokens in flight.

[Plach](https://docs.intear.tech/plach.md), the AMM, is one of the DEXs that run on the engine, and has [docs of its own](https://docs.intear.tech/plach.md). This section covers the engine itself.

:::caution
The contract is not audited.
:::

## Key ideas

- **Inner balances.** You deposit tokens to the engine once and trade from your balance inside it. Withdraw them to your wallet when you're done. See [Inner balances](https://docs.intear.tech/intear-dex/guides/inner-balances.md).
- **Assets.** NEAR, NEP-141 fungible tokens, NEP-171 NFTs and NEP-245 multi tokens, written as `near`, `nep141:<contract>`, `nep171:<contract>:<token id>` and `nep245:<contract>:<token id>`. See [Types](https://docs.intear.tech/intear-dex/reference/types.md#assetid).
- **DEX IDs.** Every DEX has an ID of `<deployer account>/<name>`, for example `slimedragon.near/xyk` for Plach. See [DEXs on the engine](https://docs.intear.tech/intear-dex/guides/dexes.md).
- **Registration and storage.** Before you can hold an asset, it has to be registered for you, and that costs storage that you pay for with a storage deposit. See [Storage](https://docs.intear.tech/intear-dex/guides/storage.md).
- **Operations.** A list of steps (swap, withdraw, transfer and more) that run in one call, either from your inner balance or right inside a token deposit. See [Operations](https://docs.intear.tech/intear-dex/guides/operations.md).
- **Referral fees.** An app can charge its own fee on the swaps it sends, on any DEX, with `referral_fees`. See [Referral fees](https://docs.intear.tech/intear-dex/guides/referral-fees.md).

## What you can do

- **Swap**: `swap_simple` swaps between two assets on one DEX, with a minimum output or a maximum input.
- **Chain swaps**: `execute_operations` runs several swaps and withdrawals in one call, each step using the output of the last one.
- **Swap on deposit**: Put operations in the `msg` of `ft_transfer_call`: deposit, swap and withdraw in one transaction.
- **Call a DEX**: `dex_call` and `dex_view` reach any other method of a DEX, such as adding liquidity or reading pools.

## Next steps

- [Quickstart](https://docs.intear.tech/intear-dex/quickstart.md): Deposit, swap and withdraw, call by call.
- [Methods](https://docs.intear.tech/intear-dex/reference/methods.md): Every method of the engine contract.
- [DEX Aggregator](https://docs.intear.tech/dex-aggregator.md): Get swaps through Intear DEX built for you, as ready-to-sign transactions.
