# AMM 101

### 1. Identify FT on Flow

Unlike on EVM, simply using a contract address is **not** enough to identify FTs on FVM. The unique identifier for FT is composed of: `A.16-byte`-`address.name`.&#x20;

For example:

* `A.b19436aae4d94622.FiatToken` is USDC's **unique identifier** on mainnet.&#x20;
* Also `ceWETH` and `ceWBTC` (Celer-Bridged wETH & wBTC from ETH) are deployed under the same address but with different identifiers:  `A.231cc0dbbcffc4b7.ceWETH`, and `A.231cc0dbbcffc4b7.ceWBTC`.

### 2. Interact with FT on Flow

#### Paths

FT on FVM conforms to the `FungibleToken` [interface](https://flow-view-source.com/mainnet/account/0xf233dcee88fe0abe/contract/FungibleToken). One specific FT is represented as a Vault resource and stored directly under the holder' account storage area.

So each FT is also associated with several [paths](https://docs.onflow.org/cadence/language/accounts/#paths) used to interact with it. Check the `tokenlist` file [here](https://github.com/IncrementFi/token-list/blob/main/tokenlist.mainnet.json) for FT details on mainnet.&#x20;

#### FT Resource Initialization

Unlike FT on EVM, one cannot 'airdrop' FT to arbitrary address without the receiver account first initializing the FT resource once (using `FT.createEmptyVault()` method).&#x20;

* Example transaction: `init_usdc_vault.cdc`

```
import FungibleToken from 0xf233dcee88fe0abe  // mainnet
import FiatToken from 0xb19436aae4d94622      // mainnet

transaction() {
    prepare(signer: AuthAccount) {
        let vaultPath = /storage/USDCVault
        let receiverPath = /public/USDCVaultReceiver
        let balancePath = /public/USDCVaultBalance

        if signer.borrow<&FungibleToken.Vault>(from: vaultPath) == nil {
            signer.save(<- FiatToken.createEmptyVault(), to: vaultPath)
            signer.link<&FiatToken.Vault{FungibleToken.Receiver}>(receiverPath, target: vaultPath)
            signer.link<&FiatToken.Vault{FungibleToken.Balance}>(balancePath, target: vaultPath)
        }
    }
}
```

The initialization only needs to be done once per holder account for one specific FT. After that any further action like: deposit / withdraw / etc. can be performed flawlessly.

**\***&#x4E;ote: `FlowToken` is also FT but it's the only exception that it doesn't need initialization - as the init step has been performed when the account is created.

### 3. CPAMM Principles

Check Uniswap-V2 whitepaper here: <https://uniswap.org/whitepaper.pdf>

### 4. Understanding Impermanent loss (IL)

![Source: https://docs.uniswap.org/protocol/V2/concepts/advanced-topics/understanding-returns](/files/DaTEZcx4quq7bCvIDj5b)


---

# 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.increment.fi/protocols/decentralized-exchange/cpamm-dex/amm-101.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.
