# Overview

Welcome to **Bean Exchange**, the Monad’s native DeFi Hub. Its It is built for traders, liquidity providers, and protocol builders who value capital efficiency, real yield, and a seamless user experience.

Our mission at Bean is to build modular DeFi infrastructure that maximizes on-chain performance and supports the growth of the Monad ecosystem.

***

#### **Core Products**

* **Perpetual Market:** Vault-backed leveraged trading with real yield distributed to stakers.
* **Spot Market:** Powered by **DLMM** and **DAMM**, enabling low-slippage trades and flexible LP strategies.

#### **Protocol Infrastructure**

Bean is underpinned by two core vault systems that manage liquidity and reward distribution:

* **Turbo Vault:** A compact yield station where users can ape in and farm effortlessly. Backed by diversified strategies across Bean’s core protocols, it powers the perpetual market while maximizing capital efficiency through dynamic asset allocation.
* **Lite Turbo Vault:** Mapped one to one with DLMM spot pools, the Lite Turbo Vault automates capital allocation between spot liquidity and external yield markets such as lending platforms or liquid staking protocols. It is designed for passive LPs seeking yield without active management.

***

This document introduces the core protocol and product design of Bean Exchange across spot and perpetual markets. It serves as a starting point for anyone looking to understand, use, or contribute to the Bean ecosystem.

**Ready to trade, farm, or build? Start exploring Bean today.**


# Tokenomics

TBA


# Trading Perp


# Markets & Collateral

#### Market Selection

* **Available Markets**: Select from supported perpetual markets (e.g., BTC/USD, ETH/USD, SOL/USD)
* **Index Price Feed**: Each market uses aggregated price feeds from multiple exchanges to reduce manipulation risk
* **Market Types**:
  * **Fully Backed Markets**: Open interest limited by pool reserves, all profits fully backed
  * **Synthetic Markets**: Cross-collateral positions with ADL protection when needed

#### Pool Selection

* **Multiple Pools Per Market**: Choose between different collateral pairs (e.g., ETH-USDC, ETH-USDT)
* **Pool Composition**: Each pool consists of:
  * Long Token: Backs long positions
  * Short Token: Backs short positions
* **Pool Shifting**: Move liquidity between pools with same backing tokens without sell fees

#### Collateral Options

* **Long Positions**:
  * Index token collateral: Amplified exposure (e.g., 1 ETH position + 1 ETH collateral = 2 ETH exposure)
  * Stablecoin collateral: Isolated long exposure, easier to switch between long/short
* **Short Positions**:
  * Index token collateral: Useful for delta-neutral strategies to earn funding fees
  * Stablecoin collateral: Pure short exposure, easier to switch directions
* **Collateral Management**: Deposit or withdraw collateral anytime via "Edit" button to adjust leverage and liquidation price

#### Leverage System

* **Max Leverage**: Dynamically adjusts based on pool utilization
  * Decreases as open interest increases to protect pool
  * Only affects opening/increasing positions, not existing positions
  * Interface shows warnings when max leverage would be exceeded
* **Leverage Display**: Configurable as (position size) / (collateral) or (position size + PnL) / (collateral)


# Orders

#### Market Order

* **Instant Execution**: Executes immediately at current market price
* **Order Flow**:
  * User submits order request transaction
  * Keeper executes order with price impact applied
  * Position opens with network fee deducted
* **Price Impact**: Positive (better price) if balancing pool, negative (worse price) if imbalancing
* **Trading Modes**:
  * **Classic**: On-chain wallet signature per trade, uses your wallet's RPC
  * **Express**: Off-chain message signing, GMX broadcasts via Gelato, premium RPCs
  * **Express + One-Click**: Auto-signed with local sub-account key, no popups, limited by authorized action count

#### Limit Order

* **Trigger Price**: Order activates when mark price reaches specified level
* **Execution**: Subject to price impact and acceptable price tolerance
* **Features**:
  * Edit trigger price before execution
  * Set acceptable price impact threshold
  * Order appears in "Orders" tab
* **Non-Execution Scenarios**:
  * Mark price never reached the trigger level
  * Insufficient liquidity at trigger price
  * Max allowed leverage would be exceeded
  * Acceptable price not met due to price impact

#### Stop Market Order

* **Purpose**: Open position when price moves against favorable direction (breakout strategy)
* **Execution**: Market order that executes regardless of price impact
* **Key Differences from Limit**:
  * No acceptable price requirement
  * Guaranteed execution if trigger price hit and liquidity available
  * Higher slippage risk in volatile markets

#### TP/SL

* **Take Profit (TP)**:
  * Closes position automatically when profit target reached
  * Subject to acceptable price impact setting
  * Receives token based on position type (long = index token, short = stablecoin)
* **Stop Loss (SL)**:
  * Closes position automatically to limit losses
  * Executes regardless of price impact
  * Critical protection against liquidation
* **Auto-Cancel Feature**:
  * Automatically cancels TP/SL when position fully closed
  * Enabled by default, can be disabled in Settings
  * Limits: 10 orders/position (Arbitrum), 5 orders/position (Avalanche)
* **Management**: Create via "Close" button, "Set TP/SL" menu, or TP/SL tab in trade box


# Fees


# Trading Fee & Price Impact

**Trading Fees**

* **Opening/Closing Positions**: 0.04% or 0.06% of position size
  * 0.04% if trade balances long/short ratio
  * 0.06% if trade imbalances pool
* **Swap Fees**:
  * Regular tokens: 0.05% or 0.07%
  * Stablecoins: 0.005% or 0.02%
  * Lower fee when balancing pool

**Price Impact**

* **Positive Impact**:
  * Occurs when trade balances pool
  * Better entry/exit price than market
  * Increases tokens received in swaps
  * Example: Opening long when shorts > longs
* **Negative Impact**:
  * Occurs when trade imbalances pool
  * Worse entry/exit price than market
  * Decreases tokens received in swaps
  * Example: Opening long when longs > shorts
* **Calculation**: Based on pool balance and trade size
* **Visibility**: Always displayed in interface before trade execution

**Price Impact Rebates**

* **Threshold**: Each market has maximum acceptable price impact (\~1%)
* **Rebate Process**:
  * Close position with >1% negative impact
  * Excess impact becomes claimable after \~10 days
  * Example: 3% impact → 2% rebate claimable
* **Purpose**: Protect traders during high volatility, prevent manipulation
* **Scope**: Only applies to closing/decreasing positions


# Borrow Fee

* **Purpose**:
  * Prevents liquidity reservation abuse (equal long/short positions)
  * Incentivizes liquidity provision when utilization high
* **Calculation**: Based on pool utilization percentage
* **Fee Direction**:
  * More longs than shorts → longs pay fee
  * More shorts than longs → shorts pay fee
* **Rate Display**: Real-time rate shown in interface, updates based on utilization
* **Continuous Accrual**: Accumulates while position open, applied on close


# Funding Fee & Claim

**Funding Fee Mechanism**

* **Adaptive Funding**: Rates adjust gradually to balance long/short ratio
* **Payment Direction**:
  * Longs > shorts → longs pay shorts
  * Shorts > longs → shorts pay longs
* **Rate Adjustment**:
  * Gradually increases when imbalanced
  * Stops at upper limit or when balanced
  * Reverses direction if imbalance flips
* **Real-Time Rates**: Displayed per hour in interface and stats page

**Claiming Funding**

* **Positive Funding**: Accumulates as claimable balance
* **Claim Process**: Click "Claim" button in "Claimable Funding" box on Trade page
* **Frequency**: Claim anytime, no restrictions
* **Payment Token**: Same as position collateral

**Arbitrage Opportunities**

* **High Funding Scenarios**:
  * Open opposite position to collect funding
  * Delta-neutral strategies with same-token collateral
  * Example: Long position > shorts → short ETH with ETH collateral
* **Considerations**: Funding tends toward zero as pool balances


# Dynamic Fee

* **Network Fee (Execution Cost)**:
  * Covers keeper transaction costs
  * Displayed as "Max Network Fee" (overestimated)
  * Excess refunded after execution
  * Overestimation buffer configurable in Settings
* **Two-Transaction Model**:
  * User sends request transaction
  * Keeper executes order on-chain
* **Fee Components**:
  * Gas price fluctuation buffer
  * Keeper service costs
  * Network congestion adjustments
* **Cost Optimization**: Use Express/One-Click mode for better RPC infrastructure


# Order History

#### View & Management

* **Historical Records**: Complete log of all executed orders
* **Order Details**:
  * Timestamp and execution price
  * Position size and leverage
  * Entry/exit prices with price impact
  * Fees paid (trading, network, borrow, funding)
  * Profit/Loss calculations
* **Filter Options**:
  * By market and pool
  * By order type
  * By date range
  * By status (executed, failed)

#### Transaction Tracking

* **Order Status**:
  * Pending: Waiting for keeper execution
  * Executed: Successfully filled
  * Frozen: Trigger hit but conditions not met
  * Cancelled: Manually cancelled by user
* **Failed Orders**: View reasons for non-execution
* **Export Functionality**: Download history for records


# Active Positions

#### Position Monitoring

* **Real-Time Updates**:
  * Current position size and leverage
  * Unrealized PnL (profit/loss)
  * Entry price and current mark price
  * Liquidation price with distance indicator
  * Accumulated funding and borrow fees
* **Position Details**:
  * Collateral amount and type
  * Index token and pool information
  * Opening timestamp
  * Position ID for tracking

#### Position Management

* **Edit Collateral**:
  * Deposit: Improve liquidation price, reduce risk
  * Withdraw: Extract excess collateral (if safe)
  * Real-time liquidation price recalculation
* **Partial Close**: Close percentage of position
* **Full Close**: Close entire position, realize all PnL
* **Size Adjustment**: Increase via "..." menu options

#### Profit/Loss Calculation

* **Formula**: PnL = (position size) × (price change %)
* **Long Position**:
  * Profit when price increases
  * Loss when price decreases
  * Paid in index token
* **Short Position**:
  * Profit when price decreases
  * Loss when price increases
  * Paid in stablecoin
* **Collateral Value**: Separate from position PnL (if different token)

#### Attached Orders

* **TP/SL Display**: Shows attached take profit and stop loss orders
* **Quick Access**: Edit or cancel TP/SL directly from position row
* **Visual Indicators**: Color-coded profit targets and stop levels


# Liquidation

#### Liquidation Mechanism

* **Trigger Condition**: When (collateral - losses - fees) falls below threshold
* **Threshold Levels**:
  * Non-synthetic markets: 0.4% - 1% of position size
  * Synthetic markets: Higher thresholds for safety
  * Newly listed markets: 0.45%+ for volatility
* **Price Calculation**: Based on oracle price, not including price impact
* **Actual Liquidation**: Applies real positive/negative price impact when closing

#### Liquidation Fees

* **Fee Structure**:
  * 0.2% for fully backed markets
  * 0.3% for synthetic markets
  * 0.45% for high volatility/new markets
* **Fee Deduction**: Taken from remaining collateral
* **Remaining Collateral**: Returned to account after fees

#### Prevention Strategies

* **Monitor Liquidation Price**:
  * Check regularly, especially with >10x leverage
  * Consider borrow and funding fee accumulation
  * Liquidation price is dynamic, not static
* **Add Collateral**: Use "Edit" button to deposit and reduce risk
* **Reduce Leverage**: Partially close position to increase safety margin
* **Set Stop Loss**: Automatic closure before liquidation
* **Balanced Positions**: Avoid max leverage in volatile markets

#### Auto-Deleveraging (ADL)

* **Applies To**: Synthetic markets only
* **Trigger**: When pending profits exceed pool threshold
* **Process**:
  * Most profitable positions deleveraged first
  * Partial or full automatic closure
  * Ensures market solvency
  * All profits payable at closure
* **Prevention**: Occurs in extreme market moves, rare in fully backed markets
* **Notification**: Interface shows ADL risk levels

#### Risk Indicators

* **Liquidation Distance**: Percentage from current to liquidation price
* **Health Factor**: Position safety metric (green/yellow/red)
* **Fee Accumulation**: Real-time borrow and funding cost display
* **Pool Utilization**: Higher utilization = higher risk of ADL (synthetic markets)
* **Volatility Alerts**: Warnings during high volatility periods


# Spot Market

Bean Exchange's spot market is built on a dual-model architecture that combines the strengths of two distinct market-making mechanisms: **DLMM** (Dynamic Liquidity Market Maker) and **DAMM** (Dynamic Automated Market Maker).

This system enables high-efficiency spot trading while offering liquidity providers flexibility in managing capital, yield, and volatility exposure.

***

Dive right in&#x20;

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden data-card-cover data-type="image">Cover image</th><th data-hidden data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>What is DLMM?</strong> </td><td>Higher capital efficiency and fee potential for LPs.</td><td><a href="/spot-market/dlmm">DLMM</a></td><td><a href="https://426644680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfDNdlTvpFcwV2kJRwNX5%2Fuploads%2FbG3pnu7vj8Aa26dWrX30%2FChatGPT%20Image%2019_46_55%2015%20thg%2010%2C%202025.png?alt=media&amp;token=ac080998-6994-40e0-b63a-87b18837665e">ChatGPT Image 19_46_55 15 thg 10, 2025.png</a></td><td><a href="/spot-market/dlmm">DLMM</a></td></tr><tr><td><strong>What is DAMM?</strong></td><td>Greater flexibility and control over liquidity distribution.</td><td></td><td><a href="https://426644680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfDNdlTvpFcwV2kJRwNX5%2Fuploads%2FhddJjpI6QG3tiUnlV8AF%2FChatGPT%20Image%2019_59_20%2015%20thg%2010%2C%202025.png?alt=media&amp;token=b2fc97b9-c9eb-4f2e-b0b1-9c579d44ff3e">ChatGPT Image 19_59_20 15 thg 10, 2025.png</a></td><td></td></tr><tr><td><strong>User Guide</strong></td><td>Step-by-Step guide to provide liquidity on Bean Spot Market</td><td><a href="/user-guide">User Guide</a></td><td><a href="https://426644680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfDNdlTvpFcwV2kJRwNX5%2Fuploads%2F1KlPoG86t0EJ6KQ8oPvC%2F2025-10-15%2020.05.20.jpg?alt=media&amp;token=5400478e-2463-473a-ad06-52c7836e7deb">2025-10-15 20.05.20.jpg</a></td><td></td></tr></tbody></table>


# DLMM

**The Dynamic Liquidity Market Maker (DLMM)** is Bean Exchange’s custom-built architecture for spot trading on Monad. Inspired by systems like Trader Joe's Liquidity Book and Meteora, it is engineered to optimize capital efficiency, execution quality, and LP profitability in a performant and composable DeFi environment.

***

### **Design Motivation**

The DLMM is motivated by a simple question:

> How can we maximize capital efficiency for LPs while delivering low-slippage execution for traders—without requiring active position management?

The answer builds on the evolution of prior AMM models:

| Model                                              | Key Benefit                                                                                                    | Limitation                                                                             |
| -------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| **Traditional AMMs** (e.g., Uniswap v2)            | Use the classic `x * y = k` invariant. Simplicity, passive provisioning, composable with other DeFi protocols. | Inefficient capital use. High slippage. Capital is spread across infinite price range. |
| **Concentrated Liquidity AMMs** (e.g., Uniswap v3) | Allocate liquidity within custom price ranges. Improved capital efficiency, tighter spreads.                   | High complexity. Requires active position management and in                            |

Bean’s DLMM extends these models by offering **precision, programmability, and dynamic adaptivity**—in a system optimized for Monad’s parallel VM.

***

### Core Components of DLMM

#### **I. Bin-Based Price Segmentation:**

* **Definition**: The price curve is divided into discrete, fixed-width price bins.
* **Function**: Each bin acts as a standalone liquidity pool at a single price point.
* **Execution**: Swaps within a bin occur at zero slippage; multi-bin swaps route seamlessly across adjacent bins.
* **Implication**: LPs can target capital with surgical precision, eliminating waste in inactive price zones.

#### **II. Composable Liquidity Shapes**

* **Definition**: LPs can distribute liquidity non-uniformly across multiple bins to form custom shapes.
* **Examples**:
  * **Concentrated spike** for stable pairs
  * **Asymmetric skew** for directional bias
  * **Wide spread** for volatile assets
* **Implication**: Enables advanced strategies without the need for external rebalancers or frequent user intervention.

#### **III. Dynamic Fee Adjustment**

* **Definition**: Swap fees automatically adjust based on real-time market volatility.
* **Mechanism**:
  * In high-volatility regimes, fees increase to offset LP risk.
  * In low-volatility regimes, fees tighten to improve execution and volume.
* **Implication**: Enhances LP returns during riskier periods and incentivizes deeper liquidity during calm conditions.

This allows Bean’s spot market to operate as a high-performance DEX while offering order book-like precision with AMM-level composability.

***

In the next sections, we’ll explore the three core components of DLMM in details.


# The Bin architecture

The Bin Architecture is the foundational framework of Bean’s DLMM. It models the liquidity pool as a sequence of discrete and fixed-price segments, known as bins, rather than a continuous price curve.

<figure><img src="https://426644680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfDNdlTvpFcwV2kJRwNX5%2Fuploads%2FLiHFG2XjLEWzX2hA2MPl%2Fbean%20bin.png?alt=media&amp;token=7f3c6747-f4c5-4166-a0c1-92181e5f4480" alt=""><figcaption></figcaption></figure>

This design introduces order book-like precision to the AMM model while preserving composability and automation.

***

## 1. Fixed Price Bins

Each bin corresponds to a static, predefined price level. The price *pi* of bin index *i* is defined by the following relation:

<h3 align="center">  <span class="math">p_i = p_0*(1+\frac{bin step}{10,000})^i</span></h3>

{% hint style="info" %}

* *pi*: The price in bin number i&#x20;
* *p*o: The starting price (reference bin at index 0)
* binStep: spacing between bins in basis points (bps)
* *i*: bin index (positive or negative)
  {% endhint %}

For example, an LP sets the initial price of the MON/USDC pair at 0.0500, and assumes a bin step of 1 bps. The resulting bin prices are:

| Bin Index (i) | Formula                 | Price (USDC/MON) |
| ------------- | ----------------------- | ---------------- |
| -2            | $$0.0500\*1.0001^{-2}$$ | **0.049990**     |
| -1            | $$0.0500\*1.0001^{-1}$$ | **0.049995**     |
| 0             | $$0.0500$$              | **0.050000**     |
| +1            | $$0.0500\*1.0001^1$$    | **0.050005**     |
| +2            | $$0.0500\*1.0001^2$$    | **0.050010**     |

***

## **2. Liquidity Composition**

In Bean DLMM, liquidity is divided into discrete price bins, with each bin representing a fixed exchange rate between two tokens in a trading pair:

* **Base Token:** The asset supplied by liquidity providers. This is the token being bought or sold (e.g., MON).
* **Quote Token:** The asset used to price the base token. It serves as the unit of account (e.g., USDC).

However, **not all bins contain reserves of both tokens**. The presence and composition of token reserves depend on the bin’s function relative to the current market price.

### **Initial or Active Bin**

The **initial bin** is selected by liquidity providers to define the price level where they expect trades to occur. This price is typically aligned with the current market rate.

Consequently, the initial bin becomes the **first active bin** in the pool and must hold both the **base token** and the **quote token**. This ensures the pool can support **two-directional trading**, allowing users to execute swaps in either direction (for example, MON to USDC and USDC to MON).

### **Surrounding or Non-Active Bin**

Bins adjacent to the active bin serve as unidirectional liquidity reservoirs. Each surrounding bin contains only one token, either the base token or the quote token, depending on its position relative to the active price.

These bins remain inactive until a price movement promotes one of them to the active bin, where it can facilitate swaps in a single direction based on its token reserve.

***

## **3. Trading Mechanism**

In Bean DLMM, swaps are executed **bin by bin**, beginning with the **active bin**, which holds reserves for both tokens in the pair.

### **Execution Logic**

When a user initiates a trade (for example, swapping USDC for MON), the protocol does the following:

1. The protocol removes MON (base token) from the active bin
2. The user’s USDC (quote token) is deposited into the same bin
3. The swap is executed at the bin’s fixed exchange rate

As long as the active bin has sufficient reserves, trades occur at that bin’s fixed price with zero slippage.

### **Multi-Bin Routing**

If the reserves of the base token in the active bin are fully depleted, the protocol automatically routes the trade to the next bin in the direction of the swap. This new bin becomes the active bin, and the process continues at the next fixed price level.

Each swap dynamically shifts the active bin along the price curve, creating a discrete, predictable trading path across bins.

***

## 4. Price Movement

In Bean DLMM, price evolves through discrete bin traversal, where each bin represents a fixed exchange rate. The active price moves bin by bin as liquidity is consumed.

### **Bin Indexing**

Bin 0 be the initial (reference) bin, aligned with the LP’s selected price. Bin positioning and reserve logic:

| Bin Index | Price Relation        | Position       | Token Reserve    |
| --------- | --------------------- | -------------- | ---------------- |
| `i < 0`   | Below reference price | Left of bin 0  | Quote token only |
| `i = 0`   | Reference price       | Initial bin    | Both tokens      |
| `i > 0`   | Above reference price | Right of bin 0 | Base token only  |

### **Active Price Transition**

The active bin is where trades occur. When its token reserves are fully consumed, the active price moves to the next bin.

**Moving Right:** Occurs during buying pressure, meaning the price increases.

For example, users swap USDC → MON, selling USDC to buy MON.

* The protocol removes MON (base token) from the active bin
* If MON is fully consumed, the next bin to the **right** becomes active.
* The new bin reflects a **higher price** for MON (fewer MON per USDC in the pool)

**Moving Left:** Occurs during selling pressure, meaning the price decreases.

For example, users swap MON → USDC, selling MON to buy USDC.

* The protocol removes USDC (quote token) from the active bin
* If USDC is fully consumed, the next bin to the **left** becomes active
* The new bin reflects a **lower price** for MON (more MON per USDC)

This bin-based model mirrors an on-chain order book. It enables deterministic price progression, minimizes slippage for traders, and gives LPs precise control over where to deploy capital.


# The Liquidity Shape

In Bean DLMM, liquidity is distributed across discrete price bins, and LPs can choose different **liquidity shapes** to define how their capital is allocated across those bins. Each shape represents a different strategy to manage trade-offs between capital efficiency, fee capture, and price exposure.

Liquidity shapes allow LPs to:

* Concentrate capital around the current market price for maximum efficiency
* Spread liquidity across wider price bands for passive exposure
* Strategically position liquidity to automate buy-low/sell-high logic

Bean currently supports three core liquidity shapes:

* Spot
* Curve
* Bid-Ask

Below is a detailed explanation of how each shape works, followed by a comparison table to help you decide.

## 1. Spot Shape&#x20;

The Spot shape distributes liquidity evenly across a defined price range (e.g., ±5% around the current market price). This creates a flat distribution where each bin receives the same amount of liquidity.

This is similar to CLMM ranges in traditional DEXs but divided discretely by bins. Each bin holds a balanced share of the LP's total allocation, allowing the price to drift within the band while still enabling trades.

### **How it works**

* LPs specify a range (e.g., ±5% from current price)
* Liquidity is split equally among bins within this range
* Each bin can support two-way swaps as long as it has reserves

### **Visual Example**

<figure><img src="https://426644680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfDNdlTvpFcwV2kJRwNX5%2Fuploads%2FIxeEPvdNV9caoA0sw22V%2Fspot_liquidity_mon_usdc_split_bar.png?alt=media&amp;token=ce5f456c-12f7-49d1-aea2-331db8fe9488" alt=""><figcaption></figcaption></figure>

***

## 2. Curve Shape&#x20;

The Curve shape concentrates most of the liquidity near the center (usually the current price), then gradually decreases it toward the edges. This creates a smooth, bell-curve-like distribution, ideal for price action hovering around a mean value.

This strategy is optimal when trading volume clusters near a central price level and aims to maximize capital efficiency while still allowing modest drift.

### **How it works**

* Most bins near the current price receive a higher allocation
* Outer bins receive less, forming a Gaussian-like curve
* Useful for mean-reverting or sideways markets

### **Visual Example**

<figure><img src="https://426644680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfDNdlTvpFcwV2kJRwNX5%2Fuploads%2FJGTI6SxWlW2speXQY8bW%2Fcurve_liquidity_mon_usdc_split_bar.png?alt=media&amp;token=65f20042-84fc-4750-88d4-4f56c75e2c1f" alt=""><figcaption></figcaption></figure>

***

## 3. Bid-Ask Shape&#x20;

The Bid-Ask shape places liquidity at two peaks on either side of the current price, leaving little or no liquidity in the center. This design simulates a traditional order book's bid-ask spread.

The strategy is great for capturing swings in both directions. LPs can accumulate tokens when the price dips and offload when it pumps, passively executing a buy-low/sell-high routine.

### **How it works**

* Liquidity is allocated to two zones: one below and one above current price
* Mid-price bins are left empty or sparsely populated
* Useful for highly volatile or mean-reverting assets

### **Visual Example**

<figure><img src="https://426644680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfDNdlTvpFcwV2kJRwNX5%2Fuploads%2Fk5kEePqOiKJPbvaBp8ro%2FBid-Ask.jpg?alt=media&amp;token=eaddff58-c784-41fc-b47d-590760c9792f" alt=""><figcaption></figcaption></figure>

***

## Liquidity Shape Comparison

| Strategy | When to Use                                                | Strengths                                              | Trade-Offs                                             | IL Rish | Upkeep |
| -------- | ---------------------------------------------------------- | ------------------------------------------------------ | ------------------------------------------------------ | ------- | ------ |
| Spot     | Stablecoin pairs, passive LPs, wide price windows          | High uptime, transparent IL, minimal upkeep            | Less capital efficiency, lower APR in volatile markets | Low     | Low    |
| Curve    | Sideways/range-bound pairs, large caps                     | Capital efficient, high fee capture near current price | Requires rebalancing if price trends too far           | Medium  | Medium |
| Bid-Ask  | Volatile or mean-reverting markets, memecoins, passive DCA | Captures fees from large swings, auto buy/sell cycles  | Higher IL risk, inactive at mid-range                  | High    | High   |


# Dynamic Fee

Bean's DLMM introduces a **Dynamic Fee** system — a smart, self-adjusting mechanism that tunes trading fees in real-time, based on volatility, price movement, and deposit behavior. The goal is simple: reward LPs fairly during volatile periods, keep costs low for traders during calm times, and make the protocol sustainable long-term.

#### **Core Objectives**

| Stakeholder                   | Goals                                                                                                                      |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| **Liquidity Providers (LPs)** | <p>✅ Volatility-adjusted returns</p><p>✅ Minimum guaranteed base fees</p><p>✅ Protection against toxic/imbalanced flow</p> |
| **Traders**                   | <p>✅ Lower fees during stable periods</p><p>✅ Predictable and transparent pricing</p><p>✅ Fair cost during volatility</p>  |
| **Protocol**                  | <p>✅ Consistent revenue share</p><p>✅ Adaptive market efficiency</p><p>✅ Built-in risk controls</p>                        |

***

## 1. Fee Architecture

Bean calculates the total trading fee as:

$$
TotalFee = Base Fee + Variable Fee
$$

{% hint style="info" %}
Base Fee : The fixed minimum charged regardless of volatility

Variable Fee: Increases as price volatility rises
{% endhint %}

All calculations utilize 9-decimal precision (1,000,000,000 = 100%)

System safeguards:

* Max Total Fee: 10%
* Max Protocol Share: 25% of total fees

### Base Fee:

Provides a fixed floor to reward LPs even in calm markets.&#x20;

$$
Base Fee = Base Factor \* Bin Step \* 10
$$

{% hint style="info" %}

* Base Factor: Set during pool creation (e.g., 100)
* Bin Step: The price gap between adjacent bins (e.g., 5)
* 10: Fixed scaling Constant
  {% endhint %}

*Think of this as your guaranteed minimum paycheck.*

### Variable Fee:

Encourages LPs to stay in volatile markets by rewarding them with higher fees.

$$
Variable Fee = (Volatility Accumulator × Bin Step)² × Variable Fee Control ÷ 100
$$

{% hint style="info" %}

* Volatility Accumulator: Measures recent price fluctuations
* Variable Fee Control: Adjusts sensitivity (e.g., 2500 = 0.25x)
  {% endhint %}

*The more the price jumps around, the more LPs earn.*

### Worked Example:

Given:&#x20;

* Base Factor = 100
* Bin Step = 5
* Volatility Accumulator = 50,000
* Control = 2,500

Results:&#x20;

```
Base Fee = 100 × 5 × 10 = 5,000 (0.0005%)
Variable Fee = (50,000 × 5)² × 2,500 ÷ 100 = 1,562,500,000,000 (0.156%)
Total Fee = 0.1565%
```

***

## 2. Volatility Management System

To avoid manipulation and overreaction to short-term noise, Ferra introduces a decay-based tracking system.

### Accumulator Formula:

$$
Volatility Accumulator = Volatility Reference + (Current Bin ID − Reference Bin ID) × 10,000
$$

Tracks how far price has moved from its last "anchor" bin.

### Time-Weighted Decay Logic:

| Time Passed Since Last Update (Δt) | Behavior                              |
| ---------------------------------- | ------------------------------------- |
| **Δt < t\_f (Filter)**             | No update — blocks spam/MEV           |
| **t\_f ≤ Δt < t\_d (Decay)**       | Volatility decays by reduction factor |
| **Δt ≥ t\_d (Reset)**              | Full reset of volatility tracker      |

*Think of it like a memory that forgets old volatility if things calm down.*

### Worked Example:

```
T=0: 8-bin move → Accumulator = 80,000
T=45s: 3-bin move → Accumulator = 70,000 (decay applies)
T=350s: 1-bin move → Reset to 10,000
```

***

## 3. Specialized Fee Types

### Composition Fee:

Prevents LP manipulation from imbalanced deposits (e.g., only one token).

$$
Composition Fee = Excess Amount × Total Fee × (Total Fee + 1)
$$

* Triggered when a deposit skews the ideal token ratio.
* Applies **only** in active bins.

### Flash Loan Fee:

Charged on flash loans independently of volatility.&#x20;

$$
Flash Loan Fee = Loan Amount × Flash Loan Rate ÷ 1,000,000,000
$$

* Max Fee: 10%
* Flat Rate: Does not vary with volatility

### Worked Example:&#x20;

Given:&#x20;

* Excess deposit: 300 USDC
* Total fee: 1%

Results:&#x20;

```
Composition Fee = 300 × 0.01 × 1.01 = 3.02 USD
```

***

## 4. Fee Distribution Logic

Fees are distributed proportionally based on LP contribution per bin.

### Bin-Level Fee Growth:

$$
Fee Growth Per Unit = Accumulated Fees ÷ Total Bin Liquidity
$$

### LP Earnings Formula:

$$
LP Fees = LP Liquidity × (Current Fee Growth - Last Claimed Growth)
$$

Ensures long-term LPs earn more if they stay in active bins.

### Worked Example:&#x20;

Given:&#x20;

* Total Fee: 100 USDC
* Protocol Share: 20%

Results:&#x20;

```
Protocol = 100 × 20% = 20 USDC  
LPs = 80 USDC
```

***

## 5. Configuration Parameters

| Type                          | Parameters                                                                                      |
| ----------------------------- | ----------------------------------------------------------------------------------------------- |
| Static (Set on Pool Init)     | Base Factor, Variable Fee Control, Protocol Share, Max Volatility, t\_f, t\_d, Reduction Factor |
| Dynamic (Updated with Trades) | Volatility Accumulator, Reference Bin, Last Update Timestamp                                    |


# DAMM


# Introduction to DAMM

### Overview

Dynamic Automated Market Maker (DAMM) represents an evolution in AMM architecture, dynamically adjusting pricing and liquidity strategies based on real-time market conditions. This adaptive approach optimizes capital efficiency, minimizes slippage, and protects liquidity providers—surpassing traditional static AMMs that operate on fixed formulas like x\*y=k. DAMM incorporates intelligent mechanisms that align pool prices during volatility, reducing arbitrage exploitation while enhancing trading efficiency.

### Core Features

#### Dynamic Fee System

Fixed base fees with volatility-responsive dynamic components—currently capped at 20%, expanding to 90%. This mechanism amplifies LP returns during high-volatility periods through automated fee scaling.

#### Anti-Bot Protection

On-chain fee scheduling initiates with elevated fees that decay over time (linear or exponential), protecting launches from sniper bots. Schedules operate via Unix timestamps or blockchain slots.

#### Hybrid Concentrated Liquidity

Partial concentration model combining CLMM capital efficiency with constant-product simplicity (x\*y=k). Pool creators define fixed price ranges at deployment—concentrating liquidity for optimal execution while maintaining protocol elegance. Post-deployment range adjustments are disabled, balancing efficiency with operational simplicity.

#### Liquidity Management

* **Permanent Locks**: Locked liquidity represented as tradeable NFTs, enabling tokenization and integration with staking/governance systems
* **Vesting Schedules**: Time-locked liquidity with programmable release mechanisms
* **Single-Sided Provisioning**: Bootstrap pools using single tokens, reducing launch barriers

#### Optimal Use Cases

DAMM architecture serves:

* LPs pursuing enhanced yields through dynamic optimization
* Projects requiring robust launch infrastructure
* Launchpads building sustainable liquidity frameworks

The combination of anti-sniper mechanisms and single-token initialization positions DAMM as the premier solution for memecoin and emerging token deployments—delivering professional-grade infrastructure for high-velocity markets.


# Protocol Description

### Core Mechanism: Hybrid AMM Design

DAMM implements the constant-product formula (x·y=k) enhanced with concentrated liquidity features:

* **x**: Token A reserves
* **y**: Token B reserves
* **k**: Invariant constant (preserved post-swap, excluding fees)

Unlike traditional AMMs, DAMM enables concentrated liquidity within the constant-product framework. Pool creators define immutable price ranges at initialization, concentrating capital within specific bands for enhanced efficiency—combining AMM simplicity with CLMM capital optimization.

#### Technical Implementation

**Price Range Parameters**: Creator-defined min/max boundaries restrict trading within specified bands, reducing slippage and maximizing capital utilization.

**Liquidity Mechanics**: LPs deposit proportionally to current pool price within ranges. Single-sided deposits supported for simplified launches.

**Invariant Management**: Maintains x·y=k while adjusting effective liquidity based on price boundaries—creating hybrid AMM/CLMM behavior.

### Fee Architecture

DAMM implements multi-layered fees without auto-compounding, enabling flexible claiming in single or dual tokens.

#### Base Fee

Fixed percentage set at initialization (e.g., 0.3%). Applied uniformly to all swaps as input percentage.

#### Dynamic Fee

Volatility-responsive component adding up to 20% of base fee (expanding to 100%). Calculated on-chain using price movement metrics similar to DLMM's Volatility Accumulator.

Example: 0.3% base + 0.06% dynamic (20% of base) = 0.36% total

#### Anti-Sniper Scheduler

Protects launches through time-decaying fees:

**Linear Decay:**

```
// formular Linear
```

**Exponential Decay:**&#x57;here:

* F(t): Current fee
* F\_init: Initial fee (up to 80% for memecoins)
* F\_final: Target fee (e.g., 0.3%)
* T: Decay duration
* λ: Decay constant

Fees can decay based on Unix timestamps or blockchain slots, starting high (e.g., 50%) and normalizing over predetermined periods.

### Swap Execution

#### Process Flow

1. **Input Submission**: User specifies input amount, output token, slippage tolerance
2. **Fee Computation**: Total fee = base + dynamic + scheduler (if active)
3. **Price Calculation**:
   * Current price: P = y/x
   * Output amount:  \[formular]
4. **Range Validation**: Rejects or partially executes if price exits boundaries
5. **Reserve Update**:
   * x\_new = x + Δx
   * y\_new = y - Δy
   * Maintains invariant: x\_new · y\_new = k
6. **Fee Distribution**: Accumulated for LP claims
7. **Output Delivery**: User receives Δy tokens

### Liquidity Management

#### Adding Liquidity

**Standard Process:**

* Execute `add_liquidity` with token amounts
* Single-sided deposits auto-calculate equivalent ratios
* Receive position NFT representing pool share
* Cost: \~0.022 SUI deployment fee

**Range Constraints:** Deposits must align with pool boundaries. Out-of-range prices may restrict single-sided entries.

#### Withdrawing Liquidity

**Withdrawal Mechanics:**

* Call `remove_liquidity` with position details
* Receive proportional token shares based on current reserves
* Claim fees separately or during withdrawal

**Lock Mechanisms:**

* Permanent locks create tradeable NFTs
* Vesting schedules enable gradual unlocking
* Locked positions maintain fee claiming rights

### Advanced Features

#### Position NFTs

* **Permanent Locks**: Immutable liquidity generating tradeable fee-earning NFTs
* **Governance Integration**: NFTs usable in staking/voting systems
* **Fee Tokenization**: Separate fee rights from principal liquidity

#### Single-Sided Initialization

* **Launch Optimization**: Deploy pools with single token (e.g., 100,000 PROJECT tokens)
* **Price Bootstrapping**: Market determines paired token accumulation
* **Risk Consideration**: Elevated impermanent loss during price discovery

#### Scheduled Activation

* **Timestamp Control**: Unix-based pool activation timing
* **Slot-Based Alternative**: Blockchain height activation
* **Coordinated Launches**: Ensures synchronized pool opening

### Implementation Efficiency

DAMM achieves \~90% cost reduction versus traditional CLMM deployments while maintaining advanced features. The hybrid architecture balances sophisticated liquidity management with operational simplicity, creating optimal infrastructure for both institutional and retail participants in volatile markets.


# Turbo Vault


# Multi Asset


# Bean Liquidity Token - BLP


# Two-Tier Architecture


# Master Pool


# Secondary Pools


# Market By Risk Tiers


# ETF-Style Portfolio Management


# Lite Turbo Vault

### Introduction

Automated liquidity management vault for DLMM pools.

**Goals:**

1. Simplify DLMM liquidity provision
2. Automate liquidity rebalancing across price ranges
3. Optimize capital efficiency through multi-strategy deployment
4. Aggregate fees and rewards for vault shareholders

### Architecture

```
                    ┌──────────┐
                    │  Keeper  │
                    └─────┬────┘
                          │
                          ▼
        ┌─────────────────────────────────┐
        │     Lite Turbo Vault            │
        │  ┌────────┐ ┌────────┐ ┌─────┐ │
        │  │  DLMM  │ │ Buffer │ │ Inv │ │
        │  └────────┘ └────────┘ └─────┘ │
        └──────────────┬──────────────────┘
                       │ 1:1
                       ▼
                ┌─────────────┐
                │   LBPair    │
                └─────────────┘
```

**Components:**

1. DLMM Liquidity - Active positions in price bins
2. Buffer - Idle tokens (deposits, fees, rewards)
3. Investment Handlers - Optional yield strategies
4. Keeper - Owner managing vault operations
5. LBPair - Underlying DLMM pool

### Parameters

| Parameter                     | Description                                                  |
| ----------------------------- | ------------------------------------------------------------ |
| `protocolFeeRate`             | Protocol fee on trading fees (basis points, max 5000)        |
| `feeRecipient`                | Protocol fee recipient address                               |
| `depositXMax` / `depositYMax` | Maximum single deposit per token                             |
| `maxTotalSupply`              | Vault share supply cap                                       |
| `binThreshold`                | Maximum allowed bin crosses                                  |
| `twapInterval`                | TWAP validation period (seconds)                             |
| `whitelistedAddress`          | Optional exclusive depositor                                 |
| `currentRange`                | Distribution config (deltaIds, distributionX, distributionY) |

### Use Cases

#### Deposit

1. User transfers tokenX and/or tokenY to vault
2. Vault calculates shares based on total assets
3. Mint shares proportional to deposit value
4. Tokens remain in buffer

#### Withdraw

1. User burns vault shares
2. Calculate proportional X/Y amounts
3. Transfer tokens from available liquidity
4. Distribute reward tokens proportionally

#### Rebalance

**Trigger:** Owner only

**Steps:**

1. Remove all DLMM liquidity
2. Collect pending fees and rewards
3. Withdraw from investment handlers (optional)
4. Redeploy with new distribution parameters
5. Invest to handlers (optional)

**Input:** RebalanceParams (amounts, deltaIds, distributions, handler indexes)

#### Compound

**Trigger:** Anyone

**Steps:**

1. Collect pending fees and rewards
2. Redeploy buffer using current distribution
3. No liquidity removal required

#### Force Add/Remove LP

**Owner Functions:**

1. `addLiquidity` - Deploy buffer to DLMM with current distribution
2. `removeLiquidity` - Remove all DLMM liquidity to buffer
3. `removeLiquidityPartially` - Remove percentage of liquidity to buffer

#### Force Invest/Divest

**Owner Functions:**

1. `invest` - Deploy buffer to handler by index
2. `divest` - Withdraw from handler by index
3. `addInvestmentHandler` - Register new handler
4. `removeInvestmentHandler` - Remove handler (must be empty)

#### Admin Functions

1. `setFeeRecipient` - Update fee recipient
2. `setProtocolFeeRate` - Update protocol fee rate
3. `setWhitelist` - Set whitelisted depositor
4. `setDepositMax` - Set deposit limits
5. `setMaxTotalSupply` - Set share cap
6. `setBinThreshold` - Set bin cross threshold
7. `setTwapInterval` - Set TWAP period
8. `setDistribution` - Update default distribution
9. `setPaused` - Pause/unpause deposits and withdrawals

#### Prevent TWAP Price Manipulation

**Protection Mechanism:**

1. Check bin crosses during `twapInterval` period
2. Compare against `binThreshold` limit
3. Revert if crosses exceed threshold
4. Applied on every deposit

### Rebalancing Method

#### Distribution System

**Delta-Based Parameters:**

1. `deltaIds` - Bin offsets from active bin

```
   Example: [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5]
```

2. `distributionX` - X token weights (sum = 1e18)
3. `distributionY` - Y token weights (sum = 1e18)

#### Rebalancing Process

1. **Remove Positions**
   * Burn LP tokens from all tracked bins
   * Receive tokens to buffer
2. **Settle Claims**
   * Collect trading fees
   * Collect farming rewards
   * Transfer protocol fee to recipient
3. **Withdraw Investments** (optional)
   * Withdraw all from handlers if enabled
4. **Calculate Range**
   * Get current active bin ID
   * Apply deltaIds to determine target bins
   * Validate range bounds
5. **Deploy Distribution**
   * Build liquidityConfigs from parameters
   * Transfer tokens to LBPair
   * Mint LP tokens
   * Track deployed bin IDs
6. **Deploy to Handlers** (optional)
   * Invest specified amounts by handler index

#### Features

1. TWAP price manipulation protection
2. Asymmetric distribution support
3. Single-transaction rebalancing
4. Multi-strategy deployment

### Keeper Rebalancing Strategy

#### Metrics to Monitor

1. **APY Comparison**
   * DLMM pool trading fees APY
   * Lending protocol APY
   * LSD staking APY
   * Calculate optimal allocation
2. **Effective Liquidity**
   * Current liquidity depth in active bins
   * Liquidity utilization rate
   * Buffer vs deployed ratio
3. **Trading Behavior**
   * Volume distribution across bins
   * Active bin movement patterns
   * Fee generation per bin
   * Optimal LP shape for current market

#### Rebalancing Triggers

1. **Time-Based**
   * Daily scheduled rebalance
   * Check all metrics at fixed intervals
2. **Demand-Driven**
   * Spike in trading volume (LP utilization high)
   * Active bin moved significantly from range center
   * Large deposits in buffer waiting deployment
3. **Yield-Driven**
   * Lending rewards increase significantly
   * LSD APY spikes above DLMM fees
   * New farming incentives available

#### Decision Process

1. Evaluate current allocation performance
2. Compare yields across strategies
3. Assess liquidity needs vs yield opportunity
4. Calculate optimal distribution and amounts
5. Execute rebalance with new parameters

### External Protocol Monitoring

#### Health Monitoring

1. **Lending Protocol Safety**
   * Monitor utilization rates
   * Track bad debt accumulation
   * Check collateral health ratios
   * Verify oracle price feeds
2. **LSD Protocol Safety**
   * Monitor validator performance
   * Track slashing events
   * Verify withdrawal queue depth
   * Check redemption rate stability
3. **Risk Indicators**
   * TVL sudden drops
   * Unusual withdraw patterns
   * Smart contract upgrades
   * Security incidents reported

#### Emergency Response

1. **Monitoring Alerts**
   * Set threshold alerts for each metric
   * Multi-channel notification system
   * Priority levels for different risks
2. **Emergency Withdrawal**
   * Keeper triggers emergency divest
   * Withdraw all funds from affected handler
   * Move assets to vault buffer
   * Pause new investments to handler
3. **Post-Emergency Actions**
   * Remove compromised handler
   * Redistribute assets to safe strategies
   * Notify vault users
   * Update risk parameters


# User Guide


# Integration


# DLMM SDK

This SDK provides tools and utilities to interact with the Bean Spot DEX protocol on Monad, built upon the DLMM (Discrete Liquidity Market Maker) architecture inspired by the Liquidity Book model. It enables developers to simulate swaps, fetch bin-level liquidity data, compute fee structures, and integrate seamlessly with the spot pool logic on-chain.

***

### 1. Overview

* **Protocol:** [Bean](https://bean.exchange/)
* **Architecture**: Discrete Liquidity Market Maker (DLMM)
* **Chain**: Monad
* **Package**: `@bean-exchange/spot-sdk`
* **License**: MIT

This SDK is designed for developers building:

* Front-end dApps (swap UI, LP dashboards)
* Trading bots / aggregators
* Analytics / research tools
* Automated liquidity strategies

***

### 2. Installation

Install the SDK via npm or yarn:

```bash
npm install @bean-exchange/spot-sdk
# or
yarn add @bean-exchange/spot-sdk
```

***

### 3. Building & Testing

Compile and run tests using standard workflows:

```bash
yarn          # install dependencies
yarn build    # compile source code
yarn test     # run unit tests (WIP)
```

***

### 4. Usage Example

```ts
import { Pool } from '@bean-exchange/spot-sdk'

const monUsdcPool = new Pool({
  token0: MON_ADDRESS,
  token1: USDC_ADDRESS,
  binStep: 5,
  baseFactor: 100,
  variableFeeControl: 2500
})

const price = monUsdcPool.getCurrentPrice()
const swapEstimate = monUsdcPool.simulateSwap(BigInt(1000e6), USDC_ADDRESS)
console.log(`Output MON: ${swapEstimate.outputAmount}`)
```

***

### 5. Core Classes & Interfaces

#### `Pool`

Represents a DLMM pool and provides utilities for:

* price computation
* swap simulation
* fee calculation
* liquidity distribution

**Constructor:**

```ts
new Pool({
  token0: Address,
  token1: Address,
  binStep: number,
  baseFactor: number,
  variableFeeControl: number
})
```

**Key Methods:**

* `getCurrentPrice(): BigNumber`
* `simulateSwap(inputAmount: BigInt, tokenIn: Address): SwapResult`
* `getLiquidityDistribution(): BinData[]`
* `calculateFees(): FeeBreakdown`

#### `SwapResult`

```ts
interface SwapResult {
  outputAmount: bigint
  feeAmount: bigint
  routeBins: number[]
}
```

#### `BinData`

```ts
interface BinData {
  binId: number
  price: number
  reserve0: bigint
  reserve1: bigint
}
```

#### `FeeBreakdown`

```ts
interface FeeBreakdown {
  baseFee: number
  variableFee: number
  totalFee: number
}
```

***

### 6. Fee Architecture

#### Total Fee = Base Fee + Variable Fee

**Base Fee**

```ts
BaseFee = baseFactor × binStep × 10
```

Ensures minimum compensation for LPs.

**Variable Fee**

```ts
VariableFee = ((volatilityAccumulator × binStep)^2 × variableFeeControl) / 100
```

Adapts to short-term volatility, compensates LPs during turbulent markets.

***

### 7. Volatility Management

Volatility Accumulator:

```ts
volatility = referenceVolatility + (currentBin - referenceBin) * 10_000
```

Decay Logic:

* **< filterTime** → ignore update (anti-manipulation)
* **< decayTime** → partial decay
* **> decayTime** → full reset

***

### 8. Composition Fee

Applied to deposits that unbalance a bin:

```ts
CompositionFee = excessAmount × totalFee × (totalFee + 1)
```

Discourages single-token dumps into active bins.

***

### 9. Fee Distribution

* **Protocol Share**: Configurable (max 25%)
* **LP Share**: Remainder of fees

```ts
ProtocolFee = TotalFee × ProtocolShare / 10_000
LPFee = TotalFee - ProtocolFee
```

***

### 10. MIT License

This SDK is released under the MIT License.

***

### 11. Repository

* GitHub: [BeanExchange/spot-sdk](https://www.npmjs.com/package/@bean-exchange/spot-sdk?activeTab=readme)
* Maintainer: @bean-exchange

For bug reports, contributions, or feature requests, please open an issue or submit a ticket on GitHub.


# Contracts

TBA


# Aggregator

TBA


# Audit

<table><thead><tr><th width="162.98828125">Audit Field </th><th width="137.5625">Audit Firm </th><th>Audit Report </th></tr></thead><tbody><tr><td>DLMM Spot </td><td>Verichains </td><td><a href="https://github.com/verichains/public-audit-reports/blob/main/Verichains%20Public%20Audit%20Report%20-%20Bean%20Exchange%20DLMM%20-%20v1.0.pdf"><code>https://github.com/verichains/public-audit-reports/blob/main/Verichains%20Public%20Audit%20Report%20-%20Bean%20Exchange%20DLMM%20-%20v1.0.pdf</code></a></td></tr></tbody></table>


