> For the complete documentation index, see [llms.txt](https://docs.secondswap.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.secondswap.io/technology-and-safety/technical-overview/technical-implementation.md).

# Technical Implementation

### Relationship Diagram

<figure><img src="/files/poSnT74PtMlSMnkP0FA0" alt=""><figcaption></figcaption></figure>

#### **SecondSwap\_Marketplace**

* Primary interface for users to interact with the protocol
* Manages listings, purchases, and token transfers
* Coordinates between vesting management and trading functionality
* Maintains list of supported payment tokens
* Delegates fee calculations and settings to MarketplaceSetting

#### **SecondSwap\_MarketplaceSetting**

* Configuration hub for marketplace parameters
* Manages fee structures (buyer, seller, referral fees)
* Controls marketplace freeze functionality
* Handles penalty fees for early unlisting
* Single source of truth for marketplace configuration

#### **SecondSwap\_VestingManager**

* Orchestrates vesting operations across multiple vesting contracts
* Tracks user allocations and vesting settings
* Manages sell limits and transfer restrictions
* Intermediary between Marketplace and individual StepVesting contracts

#### **SecondSwap\_StepVesting**

* Implements core vesting logic for a specific token
* Manages vesting schedules and token distributions
* Handles token transfers between parties
* Maintains individual vesting records per address

#### **SecondSwap\_Whitelist**

* Manages access control for private sales
* Tracks whitelisted addresses
* Controls maximum whitelist capacity
* Owned by the lot creator (seller)

#### **SecondSwap\_WhitelistDeployer**

* Factory contract for creating whitelist instances
* Deploys new whitelist contracts for private sales
* Links whitelist contracts to marketplace listings

#### **SecondSwap\_VestingDeployer**

* Factory contract for creating vesting instances
* Maps tokens to their owners
* Deploys new vesting contracts with specified parameters
* Manages vesting contract initialization
