Dusa Documentation

website·Indexed 32 days ago

https://docs.dusa.io/

Developer documentation for Dusa, featuring a comprehensive SDK and smart contract reference. Includes guides for adding and removing liquidity, executing trades, and opening pools, as well as technical specifications for the Router and Factory contracts, interfaces like IERC20 and IRouter, and core concepts such as bin liquidity and vesting systems.

Tokens
45K
Snippets
303
Records
435
Agent score
53%

What's inside Dusa

  1. Overview of the Liquidity Book protocol

    Liquidity Book is a decentralized liquidity engine developed by Trader Joe and utilized by the Dusa platform. Unlike centralized exchanges that use order books, Liquidity Book uses user-provided pools of funds to facilitate trades directly on the blockchain. It is designed to increase capital efficiency for liquidity providers and improve execution speed and profitability for traders.
  2. Overview of Limit Order Hooks mechanism

    Limit Order Hooks enable automated buy (BID) or sell (ASK) orders at predetermined price levels. This is achieved by establishing a one-sided liquidity position at a specific bin price outside the current market price. The order executes automatically when the liquidity pool price crosses or moves entirely past the order's bin price. Upon execution, the liquidity position is burned, and the resulting tokens are held by the Limit Order contract until claimed.
  3. Overview of the Massa Vesting System

    The Vesting System is a suite of smart contracts used to lock MRC-20 tokens for a beneficiary and release them gradually. It supports an initial immediate release, an optional cliff period, and a subsequent linear vesting schedule. All calculations are performed on-chain, ensuring transparency and verifiability without off-chain components.
  4. Overview of Dusa SDK core classes

    The Dusa SDK provides four primary classes to manage liquidity and trading operations: PairV2, RouteV2, TradeV2, and Bin. These classes are used to perform tasks such as executing trades, adding or removing liquidity, and claiming fees.
  5. Overview of Dusa Protocol and Liquidity Book architecture

    Dusa Protocol utilizes the Liquidity Book architecture, a capital-efficient Automated Market Maker (AMM). Key features include zero slippage for swaps within bins, surge pricing (dynamic fees) during high volatility, high capital efficiency for high-volume trading with low liquidity, and flexible liquidity distribution strategies for providers.
  6. Overview of On-Chain Dollar Cost Averaging (DCA)

    Dollar Cost Averaging (DCA) on this platform is an automated strategy implemented via smart contracts using deferred calls. It allows users to convert a fixed amount of one token into another at regular intervals, reducing the impact of market volatility by averaging the entry price. The system is entirely on-chain, ensuring transparency and reducing counterparty risk. Each trade is verified against an on-chain quoter and oracle to ensure price volatility is within a set threshold before execution; otherwise, the trade is rescheduled.
  7. Use the Hooks library to trigger external contract hooks

    The Hooks library is used to execute calls to a hook contract based on specific event flags. It provides a suite of before and after methods that correspond to protocol actions. Each method typically requires HooksParameters (encoded) and action-specific arguments. The call is only executed if the corresponding flag (e.g., AFTER_SWAP_FLAG) is set.
  8. Understand the Dusa v2 ve(3,3) ecosystem

    Dusa v2 utilizes a ve(3,3) design to balance liquidity and governance. The system revolves around two primary roles:

    1. Liquidity Providers (LPs): Earn $DUSA emissions. They do not receive swap fees.
    2. Voters (veDUSA holders): Lock $DUSA to receive veDUSA (an NFT). They direct where $DUSA emissions are allocated and receive 100% of protocol trading fees plus any voter incentives ("bribes").
  9. Understand Liquidity Book swap fee components

    Traders pay a swap fee to liquidity providers during a swap. The total swap fee ($f_{sf}$) consists of two components: a base fee ($f_{bf}$) and a variable fee ($f_{vf}$). The fee rate is applied to the swap amount in each liquidity bin and distributed proportionally to the liquidity providers in that bin. Fees are held separately from liquidity and are claimable by providers.
  10. Understand the Jelly Token ($JELLY) reward system

    $JELLY is a non-transferable reward token used by the Dusa Protocol to align user incentives with protocol longevity. Unlike the primary governance token ($DUSA), $JELLY cannot be traded, gifted, or sold on secondary markets. It is distributed to active users and Liquidity Providers (LPs) and can be redeemed for $DUSA based on specific timelines.
  11. Sample struct overview

    The Sample struct is used to track weighted average cumulative data, including IDs, volatility, and bin crossings, associated with a specific timestamp. It implements the Serializable interface.