# Trading Fee

### Introduction

Pilgrim Protocol charges the user a **trading fee** on:

**trading**rounds on a`PilgrimPair`

poolon a

**buyout event**of the metaNFT or NFTon

**delisting**, i.e. reclaiming ownership of the locked NFT

This section describes how trading fees are quantitatively calculated on Pilgrim, and detailed fee distribution logic.

**TL;DR:**

Pilgrim Protocol charges two types of fees on every round trade: a **base fee** and a **round fee**.

The

**base fee**is taken in the form of**base tokens**, and is used to buy back PIL for distribution to xPIL stakers. Additional PIL rewards are given to round traders as well.The

**round fee**is taken in the form of**rounds**, and is sent to the metaNFT owner. This is given**in addition**to fee subsidizations from the Protocol Treasury, denominated in PIL tokens.

An NFT fee is also charged when NFTs or metaNFTs are traded. This is used to buy back PIL for distribution to xPIL stakers.

**Pilgrim is a decentralized protocol**; **no centralized party takes fees** accumulated from the protocol directly.

### Fee Calculation Methodology

#### Definition

**Base Fee Ratio**: $f_\text{base} = a_\text{base} / b, b = 1000, a_\text{base} \in [0, b], a_\text{base} \in \mathbb{Z}^{+}$**Round Fee Ratio**: $f_\text{round} = a_\text{round} / b, b = 1000, a_\text{round} \in [0, b], a_\text{round} \in \mathbb{Z}^{+}$**NFT Fee Ratio**: $f_\text{NFT} = a_\text{NFT} / b, b = 1000, a_\text{NFT} \in [0, b], a_\text{NFT} \in \mathbb{Z}^{+}$**Base Fee Function**: $fee_\text{base}(n) = ceil(n / b) * a_\text{base}$: A function which calculates how much base tokens are charged as fees.**Round Fee Function**: $fee_\text{round(n)} = ceil(m / b) * a_\text{round} * K$: A function which calculates how much base tokens are charged as fees. Note that the result is also a multiple of $K$.**NFT Fee Function**: $fee_\text{NFT(n)} = ceil(n / b) * a_\text{NFT}$ : A function which calculates how much base tokens are charged as fees when metaNFTs or NFTs are traded.

#### Buying Rounds: Exchanging Base Tokens to Rounds

When a user pays $n$ base tokens, they receive $m \cdot K - fee_\text{round}(m)$ rounds.

The protocol receives $n$ base tokens -- e.g. PIL, WETH, USDC, etc.

$fee_\text{base}(n)$ base tokens are taken from provided base tokens. The resulting number of base tokens is $n - fee_\text{base}(n)$.

Apply Pilgrim AMM logic: $m \cdot K$ rounds are minted.

$fee_\text{round}(m)$ rounds are removed from initially minted rounds. The resulting number of rounds returned is $m \cdot K - fee_\text{round}(m)$

#### Selling Rounds: Exchanging Rounds to Base Tokens

When a user pays $n \cdot K$ rounds, they receive $m - fee_\text{round}(m)$ base tokens.

The protocol receives $n \cdot K$ rounds.

$fee_\text{round}(m)$ rounds are taken from provided rounds. The resulting number of rounds is $n \cdot K - fee_\text{round}(n)$.

Apply Pilgrim AMM logic: $m$ base tokens are withdrawn from the protocol.

$fee_\text{base}(m)$ base tokens are removed from withdrawn liquidity. The resulting number of base tokens returned is $m - fee_\text{base}(m)$.

#### Trading NFTs, metaNFTs, or delisting NFTs

When a user pays $n$ base tokens, metaNFT holders and round holders receive $n - fee_\text{NFT}(n)$ base tokens in total.

The protocol receives $n$ base tokens.

$fee_\text{NFT}(n)$ base tokens are taken from provided base tokens. The resulting number of base tokens is $n - fee_\text{NFT}(n)$.

Last updated