# Configuration

## Overview

[**Memez.gg**](https://www.memez.gg/) is <mark style="color:yellow;">**highly configurable to facilitate third party integrations and revenue sharing**</mark><mark style="color:yellow;">.</mark>

&#x20;Integrators can configure the following parameters:

* **Fees**
* **Migrator**
* **Public Key**

During creation, the deployer can choose which configuration the pool will adhere to. E.g., user A could opt for the Memez configuration, while user B opts for Blast.fun configuration.

{% hint style="info" %}
Integrators need to request our team to add their configuration.&#x20;
{% endhint %}

### <mark style="color:yellow;">Fees</mark>

Memez.fun has 3 fees:

```rust
public enum Fee has copy, drop, store {
    Value(u64, Distributor),
    Percentage(BPS, Distributor),
}

public struct FeePayload has copy, drop, store {
    value: u64,
    percentages: vector<u64>,
    recipients: vector<address>,
}

public struct Allocation<phantom T> has store {
    balance: Balance<T>,
    vesting_periods: vector<u64>,
    distributor: Distributor,
}

public struct MemezFees has copy, drop, store {
    creation: FeePayload,
    meme_swap: FeePayload,
    quote_swap: FeePayload,
    migration: FeePayload,
    allocation: FeePayload,
    vesting_periods: vector<u64>,
    dynamic_stake_holders: u64,
}
```

* <mark style="color:yellow;">**Creation:**</mark> Sui amount charged to create a meme coin + pool.
* <mark style="color:yellow;">**MemeSwap:**</mark> % charged on every sell or buy in meme coin.
* <mark style="color:yellow;">**QuoteSwap:**</mark> % charged on every sell or buy in quote coin.
* <mark style="color:yellow;">**Migration:**</mark> Meme coin % to be used for DEX liquidity after migration.
* <mark style="color:yellow;">**Allocation:**</mark> Meme coin % allocated for the stake holders.
* <mark style="color:yellow;">**Vesting Period:**</mark> The duration of the linear vesting for the allocation.
* <mark style="color:yellow;">**Dynamic Stake Holders:**</mark> The number of stake holders the pool requires during creation.

The integrator can decide the total amount of each fee and the number of recipients per fee. It is **possible to charge no fees at all** and **different percentages and recipients per fee**. The swap and migration fee include the deployer as one of the recipients if chosen by the integrator.

> <mark style="color:yellow;">**For example an integrator can decide to have:**</mark>
>
> * Creation Fee of 2 Sui:
>   * 20% to X
>   * 60% to Y
>   * 20% to Z
> * No Swap fee
> * 10 % Migration quote fee
>   * 50% to A
>   * 50% to B
> * 5% Meme coin allocation to stake holders

### <mark style="color:yellow;">Pump Configuration</mark>

At pool creation the sender configures the values below.

```rust
public struct PumpConfig has copy, drop, store {
    burn_tax: u64,
    virtual_liquidity: u64,
    target_quote_liquidity: u64,
    liquidity_provision: BPS,
    quote_type: TypeName,
}
```

* <mark style="color:yellow;">**Burn Tax:**</mark> The burner tax explained above
* <mark style="color:yellow;">**Virtual Liquidity:**</mark> The floor price of the Meme coin as determined by a virtual Sui amount
* <mark style="color:yellow;">**Target Sui Liquidity:**</mark> The amount of Sui the pool must collect to migrate. It can be seen as a target price.
* <mark style="color:yellow;">**Liquidity Provision:**</mark> Percentage of Meme coin to be used to seed the liquidity pool during migration.
* <mark style="color:yellow;">**Quote Type:**</mark> The type of the quote Coin\<Quote>.

### <mark style="color:yellow;">Burn Tax</mark>

The <mark style="color:yellow;">**Auction and Pump**</mark> strategies have a burn tax built-in. This is a dynamic tax that increases linearly as the amount of Sui in the pool increases. It can range from 0 to 30%.  <mark style="color:yellow;">**This tax is only applied when one sells Meme coins for Sui.**</mark> The coins are actually burnt (not sent to 0x0) as Memez uses the [IPX Coin Standard](https://docs.interestprotocol.com/overview/sui/ipx-coin-standard) for all meme coins. This is to prevent king of the hill griefing tactics. As the tax is quite high when it is close to bonding.

```rust
public struct MemezBurner has copy, drop, store {
    fee: BPS,
    target_liquidity: u64,
}
```

* <mark style="color:yellow;">**Fee:**</mark> A percentage in bps to determine how much amount to burn.
* <mark style="color:yellow;">**Target Liquidity:**</mark> The liquidity required t migrate the pool.

**Example**

> <mark style="color:yellow;">**Burner tar Tax Formula**</mark>
>
> progress = current\_liquidity / target\_liquidity
>
> tax = burner\_tax \* progress\
> \ <mark style="color:yellow;">**Example**</mark>
>
> Let's assume we have a pool using the **Pump strategy** with a **Sui Target Amount of 1\_000 Sui** and a **Burner tax of 20%** of 2\_000 basis points.&#x20;
>
> <mark style="color:yellow;">**t0**</mark>: The pool has 0 Sui - burn tax would be 0%
>
> <mark style="color:yellow;">**Math:**</mark>&#x20;
>
> progress = 0 / 1\_000 ⇒ 0
>
> 20% \* 0 / 1000 ⇒ 0%
>
> <mark style="color:yellow;">**t1**</mark>: The pool has 800 Sui - burn tax would be 16%
>
> <mark style="color:yellow;">**Math:**</mark>&#x20;
>
> progress = 800 / 1\_000 ⇒ 80%
>
> 20% \* 80% ⇒ 16%

## Move Dependencies

### Interest BPS

It is an utility library to calculate percentages from values using basis points. It is referred as `BPS`in the code blocks.

### IPX Coin Standard

It is an utility library designed to separate the capabilities of the treasury cap (mint/burn/update) to provide the owner more granular control.

### Interest Math

A math library to safely perform operations.

### Constant Product

A library that calculates the amount in and out of the constant product formula `k = x * y`&#x20;
