> 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). Agents can also search and read this documentation through its [MCP server](https://docs.secondswap.io/~gitbook/mcp).

# Technical Implementation

### Relationship Diagram

<figure><img src="https://1141259245-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgwTp7CcSfoHzZOzsC7iX%2Fuploads%2Ff4cAldgHb61L2K9wmWKY%2Frelationship.svg?alt=media&amp;token=ac80c707-ae7e-42fc-8f2f-aa251dd119e7" 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
