# Trading Fund Technical Description

**Social Trade’s core smart contracts use a streamlined architecture.** A primary **factory contract** creates **Trading Funds** for traders, where they can manage user deposits. Once a user deposits funds, they receive an equivalent amount of **shares** issued as an **ERC-20 token**, serving as proof of deposit. The Fund tracks the trader’s performance through these shares and handles the redistribution of fees. Meanwhile, **Pyth Network** oracles are used to calculate the **Total Value Locked (TVL)** and manage share valuations.

## <mark style="color:blue;">Trading Fund</mark>

Social Trade introduces the concept of a **Trading Fund**—a smart contract that enables traders to operate on the decentralized **Perpetual Protocol gTrade** ([gains.trade](https://gains.trade/)) or conduct spot trading via **1inch**.

From the user’s perspective, **following a trader** is as simple as depositing assets into that trader’s fund. The fund owner then uses those deposited assets to trade on gTrade, just as they would with their personal wallet, but with additional transparency and shared profits (or losses) for participating investors.\


There are **two distinct types of trading funds** available: **Perpetual** and **Spot**.

## <mark style="color:blue;">Perpetual Trading Fund</mark>

Perpetual trading funds operate through integration of gTrade  (([https://gains.trade/](https://gains.trade/)) )  on Base Blockchain.&#x20;

You have access to all tokens listed by gTrade on the BASE blockchain\
\ <mark style="color:blue;">When a trade is in progress in a PERP fund</mark>

If a trade is currently in progress, an investor cannot deposit funds immediately but can schedule an **automatic deposit**. Once all trades are closed, the trader will add the user’s funds to the pool. In a **PERP trading fund**, all deposits and withdrawals are conducted in **USDC**.

\ <mark style="color:blue;">When are performance fees collected?</mark>\


At the close of a profitable trade, a portion of the net P\&L accruing to investors is deducted for both the trader and the protocol. This deduction is known as the **performance fee**.

## <mark style="color:blue;">Spot Trading Fund</mark>

Spot funds operate via integrations with **1inch** and **LiFi**, providing access to every token on the **Base** blockchain. This **fully permissionless** setup means you can interact with any token contract listed on Base, giving you the freedom to select the most promising tokens, gems, memecoin anything you need.

<mark style="color:blue;">When a trade is in progress in a Spot Fund</mark>

Unlike Perp funds, **Spot funds** allow **instant deposits and withdrawals**. When an investor deposits USDC, they receive their fund shares immediately, enabling the trader to begin using those assets without delay. During withdrawals, the investor likewise receives their funds directly and in real time.\
When an investor withdraws their shares from the fund, they receive a proportional share of **all assets** currently held by the fund.

<mark style="color:blue;">**Example**</mark>:&#x20;

if the trader’s fund holds **50% BTC** and **50% ETH**, and an investor owns a **10% share** of that fund, withdrawing their full share will yield **10% of the BTC and 10% of the ETH**. In other words, the investor’s portion reflects the exact composition of the fund at the time of withdrawal.

When the investor first deposits **USDC**, they receive a corresponding amount of **fund shares** based on the fund’s total value. The USDC then becomes part of the fund’s assets, allowing the trader to use it for further trading activities.



<mark style="color:blue;">How and When are performance fees collected?</mark>

**High Water Mark Principle**\
When an investor enters a fund, they purchase shares at a certain price—this price becomes their **high water mark**. Once the share price exceeds the high water mark, the trader is eligible to claim performance fees. Any subsequent claims require the share price to rise **above** the new high water mark set at the time of the previous claim.

**Example**

* Suppose the fund’s share price is **$7**. If it climbs to **$7.10**, the trader can claim performance fees.
* After claiming, the new high water mark is **$7.10**. For further fee claims, the share price must surpass **$7.10**.
* If the share price falls, the trader **cannot** claim fees until it goes **above** the last recorded high water mark.

**Investor Scenario**

* An investor deposits **$1,000** at a share price of **$1**, receiving **1,000 shares**.
* If the share price drops to **$0.80**, those 1,000 shares are now worth **$800**. Because the price is below the initial high water mark ($1), the trader can’t claim any fees.
* If the share price later rises to **$1.10**, the trader can claim performance fees. The new high water mark becomes **$1.10**, and the share price must exceed **$1.10** for the trader to claim fees again in the future.

