# 🏛️ Context

## The problems of Centralized Exchanges (CEX) <a href="#the-problems-of-centralized-exchanges-cex" id="the-problems-of-centralized-exchanges-cex"></a>

Centralized exchanges (CEX) always lack transparency in their operations. Users have limited visibility into the inner workings of the exchange, including the order-matching process.

CEX often requires users to provide personal information, including identity verification. This compromises users' privacy as their information is stored and potentially shared with third parties.

The most important thing is that CEX has full control over users' funds. Two notable instances are the FTX incident and the Mt. Gox collapse:

1. FTX

FTX was a leading cryptocurrency exchange that went bankrupt in November 2022, amid allegations that its owners had embezzled and misused customer funds. It was discovered that customer funds went to accounts controlled by Alameda Research -- a cryptocurrency trading firm headquartered in Hong Kong -- instead of FTX.

2. Mt. Gox

Mt. Gox was once the largest Bitcoin exchange globally, handling a significant portion of Bitcoin transactions.

This company had suffered a massive security breach, resulting in the theft of approximately 850,000 Bitcoins belonging to its customers.

This incident led to substantial financial losses and severely damaged the trust in centralized exchanges at that time.

These problems associated with centralized exchanges have fueled the rise of decentralized exchanges (DEX), which aim to address these issues by leveraging blockchain technology and smart contracts.

## DeFi UX problems <a href="#defi-ux-problems" id="defi-ux-problems"></a>

DeFi (Decentralized Finance) has gained significant attention for its transparent, non-custodial, and permissionless features. However, one area where DeFi currently faces challenges is user experience (UX).

DeFi protocols often involve multiple steps and interactions with different smart contracts. This multiplication of risks arises when users engage with different protocols for various purposes such as swapping tokens, providing liquidity, participating in options trading, or engaging in yield farming.

The decentralization of DeFi means that users often need to interact with different platforms or dApps to perform specific actions. This fragmented experience requires users to spend significant time and effort searching for and navigating different places to swap, leading to a cumbersome and inefficient user experience.

Interoperability between different blockchain networks is crucial for seamless asset transfers and accessing a wider range of DeFi opportunities. However, bridging assets across different chains can be complex and time-consuming. Users may need to utilize separate bridging solutions or participate in multiple chains, adding an additional layer of complexity to their user experience.

In conclusion, the UX of DeFi platforms has been a common point of criticism. The complexity and technical nature of DeFi protocols can present challenges for mainstream users, potentially hindering mass adoption.

## LineHub Solution <a href="#linehub-solution" id="linehub-solution"></a>

With LineHub, we want to bridge the gap between transparency and trust offered by DeFi and the user-friendly experience desired by users.

LineHub aims to revolutionize the DeFi landscape by creating a unified platform on Linea that brings together a comprehensive range of services from various sectors.

By collaborating with industry leaders, LineHub seeks to provide users with a streamlined and user-friendly interface, offering a one-stop solution for all their DeFi needs.


# 🪙 LineHub Overview

## An explanation about LineHub and its products <a href="#an-explanation-about-linehub-and-its-products" id="an-explanation-about-linehub-and-its-products"></a>

### An explanation about LineHub and its products

LineHub is a platform pioneering AI next-generation DeFi, aiming to facilitate the DeFi adventure by offering a comprehensive range of DeFi products through a single, AI-powered user-friendly interface. This approach simplifies the process of accessing and utilizing different DeFi offerings, making it more convenient and efficient for users.&#x20;

\
LineHub v1 will offer the following products, all accessible from a single interface on Linea:

1\. Spot trading\
2\. Perp trading (cross-chain aggregator)\
3\. V2-V3 pools for LP\
4\. ALM\
5\. Bridging solutions

6\. Seamless DeFi with AI Assistant <br>

With the growth of the Linea ecosystem, LineHub envisions expanding its feature set over time. By integrating the main leaders of each sector on Linea, LineHub aims to introduce additional products and services that align with the evolving needs of the DeFi community.

## How does LineHub work? <a href="#how-does-linehub-work" id="how-does-linehub-work"></a>

LineHub has plans to propose in the v1 of Line hub, v2-v3 AMM, Perp DEX aggregator, LP products, bridge integration. With all this offering, LineHub expands its reach and enables users on Linea to access DeFi opportunities on a single interface.

LineHub also incorporates an innovative aggregator for Perp trading, enabling traders to access the liquidity of the main Perp DEX available on 12 chains directly from Linea, further expanding their trading opportunities and trading rate.

## Why Linea? <a href="#why-linea" id="why-linea"></a>

Linea has been chosen as the underlying framework for LineHub due to several key factors.

* Ethereum's vision:

With its strong security from Ethereum - the most decentralized blockchain behind Bitcoin, this is an ideal choice to ensure the safety and integrity of user assets and transactions.

* ZK (Zero-Knowledge)

The unique properties of ZK make them an ideal technology for building highly scalable and secure blockchain infrastructures.

* Linea track record & supports

Linea has a strong track record of supporting ecosystem dApps. They have demonstrated a commitment to nurturing and assisting projects within their ecosystem.

The Linea team is the same as MetaMask. This suggests the onboarding experience for new projects joining the Linea ecosystem will be enhanced compared to other platforms.

The Linea team has a history of providing valuable tooling for the Ethereum community (Consensys, MetaMask). They have also taken steps to defend the ethos of the crypto ecosystem, such as filing a lawsuit against the SEC.

* EVM compatibility

One of the key advantages of the Ethereum Virtual Machine (EVM) is its widespread adoption.

Since approximately 80% of blockchain developers build their projects on EVM-based platforms, it would be advantageous for more projects to onboard the Linea ecosystem. This is better for projects to build their comprehensive DeFi hub with experts.

In conclusion, Linea appears to be an ideal choice for building a thriving and secure LineHub since it can ensure the security of users and enhance the projects.


# 📈 Spot & Perpetual Trading

LineHub provides both Perpetual and Spot trading options on its platform, along with a variety of external offerings.

Delve into the subsequent sections to gain insights into these functionalities and their operational mechanics.


# Spot DEX

LineHub provides a V2 & V3 AMM spot DEX, allowing users to trade various assets with ease and efficiency.

Read the following sections to know more about this feature and how it works.


# V2 DEX

A UniV2-style DEX is a type of platform that operates as an Automated Market Maker (AMM), enabling users to trade cryptocurrencies directly through liquidity pools without the need for intermediaries or traditional order books.

The liquidity pools dynamically adjust token prices based on the supply of liquidity and the demand for swapping tokens within each pool.

The underlying smart contract algorithm used in these pools follows the formula: a \* b = k, where:

'a' represents the quantity of one token in the pool.

'b' represents the quantity of another token in the pool.

'k' is a constant value.

As the quantity of one token (a) increases, the quantity of the other token (b) decreases to maintain the constant product (k).

This mechanism ensures that the relative token prices within the pool automatically adjust based on the ratio of tokens present.

Users can have the opportunity to become market makers by providing liquidity to the existing pools.

Furthermore, UniV2-style DEXs offer flexibility for users to create their own custom pools or introduce new token pairs that are not currently available.


# V3 DEX

UniV3-style AMMs have been developed to address certain capital inefficiencies and provide more flexibility for liquidity providers (LPs) and traders. These advancements offer several exciting features:

* Concentrated Liquidity:

UniV3 allows LPs to select their desired price range. By narrowing the range, LPs can earn higher fees when the token price stays within their chosen range. However, there is also an increased risk as LPs may suffer losses if the price moves outside their selected range, causing their liquidity to be converted into a single token.

* Integration of limit orders:

LPs can now set bounds for the price range they choose to provide liquidity for. These bounds effectively act as limit orders. For instance, if an LP has decided to provide liquidity on ETH/USDC in the range 1800-2000:

Below 1800: Their liquidity will be converted 100% to USDC.

Above 2000: Their liquidity will be converted 100% to ETH.

If the ETH price leaves and returns to the range, the liquidity will be converted back to 50/50, and the LP will earn fees again

* Integration of Non-Fungible Tokens (NFTs)

Positions in liquidity pools are represented as NFTs, making each position unique. This allows LPs to have ownership over their specific positions and provides additional flexibility for managing and trading their liquidity.

* Multiple fee options

This feature enables LPs to adapt to the risk and volatility associated with each pool. LPs can select different fee tiers based on their risk appetite, allowing them to align their strategies with the specific characteristics of the assets they are providing liquidity for.


# Perp Dex Aggregator

LineHub's Perp Aggregator aggregates major Perp DEXs across various chains, providing users with access to a wide range of liquidity pools. This aggregation ensures optimal order execution by automatically selecting the most efficient exchange for each transaction.

This approach guarantees that traders enjoy the most favorable conditions for their trades, maximizing efficiency and profitability. Our system is specifically designed to handle the complexities of multi-chain trading while providing a seamless user experience.


# GMX-Like Perp DEX vs LineHub Perp DEX

The main difference for traders in comparison to a GMX-like Perp DEX is how the PnL (profit and loss) of their positions is settled.

In a GMX-like Perp DEX, if you go long on a cryptocurrency like Matic using USDC as collateral, when you close your position, you will receive Matic as your payout. So, the payout is in the same cryptocurrency that you traded.

In LineHub Perps, the settlement works differently. Let's say you go long on Matic using ETH as collateral. In this case, the PnL of your position, which represents your profit or loss, will be paid out in ETH instead of Matic. So, even though you traded Matic, your payout will be in ETH.

To put it simply, if you choose ETH as your collateral asset, it becomes your reference asset for calculating your profit or loss. When you close your position, you will receive the combination of your collateral (ETH) and the PnL (calculated in ETH) as your payout.

It's important to highlight the fee dynamics for LPs in relation to traders. LPs earn fees for providing liquidity to a platform, and these fees are accumulated directly into their LP position along with the PnL of their position.

* Traders Earning Money: LPs may experience a decrease in their position value as fees are deducted from their LP position when traders make profitable trades.
* Traders Losing Money: LPs benefit from traders' losses as the added liquidity helps increase their position value and potentially offset any losses they may have incurred.


# 🔥Seamless DeFi with AI Assistant

LineHub is designed to enhance your DeFi journey by bringing together a wide array of DeFi products in one streamlined, user-friendly interface. This structure simplifies access and usage of various DeFi solutions, making the experience more convenient and efficient for users.

In collaboration with leading AI experts, LineHub is at the forefront of integrating dynamic AI features into its platform. Development is already underway for innovative AI-driven functionalities.

AI Assistant: LineHub everages a cutting-edge LLM to offer users an advanced AI Assistant, integrated seamlessly with the LineHub dApp. This AI bot answers user queries by consolidating information from public documentation, while also capable of executing simple tasks like token swaps and more based on user prompts.

<br>


# Automated Liquidity Management

While UniV3-style pools offer several advantages for liquidity providers (LPs), they also present challenges that can be addressed through automated liquidity management.

UniV3-style pools require active management from LPs to maintain optimal positions. LPs need to regularly monitor and adjust their positions within the pool to maximize their returns.

In addition, to effectively optimize their return on investment in UniV3 pools, LPs need to possess a strong understanding of DeFi concepts and strategies.

Automated liquidity management provides LPs with a hassle-free and efficient way to participate in liquidity provision. LPs can passively earn rewards while the system takes care of optimizing their positions, allowing for a seamless and rewarding LP experience.


# Bridging Solution

LineHub has integrations with Starkgate powered by LayerZero, as well as Squid powered by Axelar. These bridging solutions are considered leaders in the cross-chain interoperability sector, facilitating seamless onboarding of projects onto LineHub.


# Aggregation

LineHub's Perp Aggregator aggregates major Perp DEXs across various chains, providing users with access to a wide range of liquidity pools. This aggregation ensures optimal order execution by automatically selecting the most efficient exchange for each transaction.

This approach guarantees that traders enjoy the most favorable conditions for their trades, maximizing efficiency and profitability. Our system is specifically designed to handle the complexities of multi-chain trading while providing a seamless user experience.


# On-chain Casino Games


# Sports Betting


# More

### **Innovative chain abstraction mechanism**

LineHub's Perp Aggregator revolutionizes the trading experience by incorporating an innovative chain abstraction mechanism. This mechanism allows users to seamlessly trade across multiple chains without the need to leave their preferred chain or perform additional actions.

With LineHub's chain abstraction, traders can initiate their trade on Linea and the Perp Aggregator intelligently routes and settles the trades across more than 11 chains supported by LineHub's DeFi ecosystem.

This means that traders can enjoy the benefits of trading on multiple chains, accessing different liquidity pools, and optimizing their trading strategies, all directly from Linea thanks to LineHub.

It also allows users to trade with leverage of up to 100x across various assets:

* Cryptocurrencies
* Commodities, provide options for those who prefer tangible, traditional assets like gold
* Forex, allowing users to speculate on fluctuating currency values such as EUR, USD, JPY
* Indices, giving traders the chance to profit from broad market movements rather than focusing on individual stocks

### **Enhanced Security**

LineHub prioritizes security by relying on multiple price feed providers across supported chains.

With redundancy from three providers:

* @PythNetwork
* @chainlink
* @API3DAO

LineHub ensures reliable and accurate price data.

### **Higher efficiency and functionality**

LineHub's Perp DEX is designed with individual pools for each collateral asset on each chain. This unique architecture allows for better risk management, asset isolation, and optimized return on investment for liquidity providers.

Traders benefit from faster transaction execution, deep Open Interest, and the flexibility to settle and trade in their preferred collateral assets without incurring extra fees, greatly improving the UX of traders.

In conclusion, LineHub's Perp DEX design aims to provide a more efficient, effective, and profitable trading environment for all participants.


# How to easily earn LXP-L on LineHub with AI feature?

Linea, a Layer 2 solution backed by ConsenSys (the parent company of MetaMask), is currently running the Linea Surge program to boost TVL on the chain. Participants providing liquidity (> $24) will likely receive $LXP-L airdrops, which may convert to Linea tokens.

As a pioneering project on Linea, LineHub users can also earn $LXP-L, contributing to the platform’s growth.

## Earning LXP-L on LineHub with AI feature

1. Head to LineHub, connect your wallet&#x20;
2. Open Surface Area at the ✨ icon in the lower right corner.

   <figure><img src="/files/PYmePrdzy3EnB1iXSXH1" alt=""><figcaption></figcaption></figure>
3. Decide whether to use @DexV2 or @DexV3 for supplying liquidity.

   \
   Specify Your Action. For example:

   "I want to add 7 dollars of liquidity with ETH and USDT tokens on @DexV2."&#x20;

<figure><img src="/files/6r89WgBZ5myeankutdzI" alt="" width="563"><figcaption></figcaption></figure>

4. Click "Add Liquidity", and Double-check the quoted transaction details, then validate it by signing using your connected wallet.&#x20;

<figure><img src="/files/SnzzuiwaW0aw7c82Je2A" alt="" width="563"><figcaption></figcaption></figure>

Earning LXP-L is easy like never before! <br>

<br>


# How to use AI assistant

LineHub everages a cutting-edge LLM to offer users an advanced AI Assistant, integrated seamlessly with the LineHub dApp. This AI bot answers user queries by consolidating information from public documentation, while also capable of executing simple tasks like token swaps and more based on user prompts.

Users can experience the AI ​​feature right on LineHub's homepage.

## AI Asistant&#x20;

1. Head to LineHub, connect your wallet&#x20;
2. Open Surface Area at the ✨ icon in the lower right corner.&#x20;

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

3. Type @ to display the functions that Assistant AI can assist you with immediately.

<figure><img src="/files/YxekyXY2aKG5Uvz2vEy4" alt="" width="563"><figcaption></figcaption></figure>

4. Select one of the commands you'd like to execute and experience its speed compared to manual actions.


# How to use Zap to add liquidity in LineHub DEX V3

Traditionally, adding liquidity to concentrated pools like USDT/ETH can be complex and inefficient. For example, converting $10,000 USDT to match the 30% USDT and 70% ETH pool ratio could impact prices or cause transaction failure.

Recognizing this, LineHub has partnered with KyberSwap to introduce KyberZap into Pool DEX v3, streamlining liquidity provision regardless of complexity.

**Key advantages of KyberZap:**

* **Simplified Liquidity:** KyberZap makes adding liquidity as easy as swapping tokens.
* **Price Impact Reduction:** The internal Aggregator ensures efficient token swaps, minimizing price effects.
* **No Leftover Tokens:** On-chain algorithms adapt to pool changes, optimizing token swaps and reducing leftovers.

## How to use Zap to add liquidity?&#x20;

1. Access LineHub and connect your wallet. \
   Go to the Pool section and choose DEX V3 Liquidity.

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

2. Choose "Single Deposit" and the token you want to add. Zap will automatically suggest some suitable vaults.

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

3. Pick one from the available vaults.
4. Enter your deposit amount and let Zap handle the rest!

The Zap feature automatically swaps your current token at the best available rate using a DEX Aggregator. It also selects the most optimal liquidity pool and range to ensure maximum profit.&#x20;


# 🏈 Team

**Blockchain Development Team**

* Richard , 0xR - Senior Fullstack Software Engineer + Development Management (CTO)
* Marc , 0xMty - Senior Fullstack Software Engineer
* Simon , SdCrypt0 - Senior Fullstack Software Engineer
* Haining , 0xNx. - Senior Fullstack Software Engineer
* Leon , 0xL - Senior Backend Software Engineer
* YaLing , 0xLynn - Senior Frontend Engineer

**Business Development and Strategies**

* Steve 0xMetavault - Co-founder / Administration
* Anna 0xMetavault - Marketing Lead / Business Development
* Quinny - Business Development Lead
* Sylvan - Business Development
* Andy - Content Marketing
* Lemon - Content Writer
* Victoria - Community Manager


# 🛣️ Roadmap

Finalized Products

LineHub has finalized the development of the following core products:

* Decentralized Exchange (DEX) \[v2/v3]
* Perpetual Contracts
* Farming
* Meme Token

Upcoming Products

In addition to the finalized products, LineHub is also planning to launch the following new offerings:

* Prediction Market
* Normal Binary Options
* Exotic Binary Options
* Sportsbetting
* On-chain Casino Games


# 📜 Smart Contract Overview

#### V2 DEX Smart Contracts: <a href="#v2-dex-smart-contracts" id="v2-dex-smart-contracts"></a>

V2Factory: 0x7811DeF28977060784cC509641f2DD23584b7671

UniswapV2Router02: 0xA3Bd10B6e957ac63462CA14Ca201d4642Dff454d

V3Factory: 0x6c379d538F2F7cb642851e154A8E572D63238DF4

SwapRouter: 0xC7e403a78c6Fc39E02da3979682a38488F9B2ff6

NonfungiblePositionManager: 0xD27166FA3E2c1a2C1813d0fe6226b8EB21783184

NonfungibleTokenPositionDescriptor: 0x5c86A0F591620f65E596dEd222a6B343f66a28D4

NFTDescriptor: 0xC56A20C91411Cf091EA74eC29a2f4b81CC852Ac5

QuoterV2: 0x83A98E35e602Ee710678389329037eEE09C41CDc

TickLens: 0x47E34401D5A741a1d601e312486963f4B9b98176

V3Migrator: 0x5e614dA74C440Fe0933213d8aEA11a68F1DCd32d

v2Pair\_InitCodeHash: 0xa260a786091ae492a14c305b5f6a26fcd7449673b40f2bd80349cec61734ab0a

v3Pool\_InitCodeHash: 0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54

#### Perp Contracts: <a href="#perp-contracts" id="perp-contracts"></a>

AddressStorage : 0x0300F0DDf24eE089ed5aa573E8E632612b977CEF

ProxyAdmin: 0xB3a8A2cb2E6cB6591c664ED6492c5cAE2DBfc298

Timelock: 0x2938e103AA81A66CB41A79E0DA8Aee28357529D6

ReferralStorage: 0x4E439D13a88845f4c4c039FAa07F2642B5748E33

TradingValidator : 0x7761de3694Cf01717f1EaedCF7b692e009F3FE26

FundingTracker : 0x2702c075A074739E4a09D929195E553b75c45e6E

OrderBook: 0x006b9144636e9f3D3D013710b05f7350d6f45E78

Store: 0x00744A65cFC59ACBa312Ade7ABf77379A041Ae26

PositionManager: 0x18cD96f731C42f550BcE876CA7cB32ca449daD67

Executor: 0x09B573a41D389FeF53cB3ABeaEBFDEBF9A32Dbaa

Api3 : 0xcea91eAA9f4d968C082efE8E48A107e6A74fEF21

ReferralReader: 0xe454e530935F165508E03fBb11b6E55E0462F2A1

BatchSender : 0x289a8F5799229DD626e8e8df1546f4aA45fE4524


