Interest Protocol
  • 👋Welcome to Interest Protocol
  • Overview
    • Sui💧
      • Contracts
        • Memez
        • Libs 📚
      • Suicoins
        • Swap
        • Dollar-Cost Averaging (DCA)
        • Airdrop
          • Suiplay Airdrop
        • Incinerator
        • Send
        • Merger
        • Suicoins Terminal
      • Memez.gg
        • Coins on Memez.GG
        • Memez.Fun
          • SDK
            • Pump API
            • Interfaces
          • Configuration
          • Migrators
          • Bonding Curve
          • Fees
      • IPX Coin Standard
    • Movement
      • Interest Protocol Decentralized Exchange (DEX)
        • Key Features
        • Core Innovations
      • sr-AMM
      • Token
        • Tokenomics
        • Utility
      • GTM
    • Audits
    • Security
    • Deprecated
      • Coin X Oracle 🔮
        • Pyth Network
        • Switchboard
      • Sui Tears 💧
        • Airdrop
          • Airdrop
          • Airdrop Utils
          • Linear Vesting Airdrop
        • Capabilities
          • Access Control
          • Owner
          • Quest
          • Timelock
        • Collections
          • Bitmap
          • Coin Decimals
        • DeFi
          • Oracle
          • Farm
          • Fund
          • Linear Vesting Wallet
          • Linear Clawback Vesting Wallet
          • Vesting
        • Governance
          • DAO
          • DAO Admin
          • DAO Treasury
        • Utils
          • ASCII
          • Comparator
          • Merkle Proof
          • Vectors
        • Math
          • Fixed Point 64
          • Fixed Point Roll
          • Fixed Point Wad
          • Int
          • Math64
          • Math128
          • Math256
      • CLAMM🐚
        • Hooks
      • Whitepapers
  • Glossary
Powered by GitBook
On this page
  • Design
  • Hooks
  • Examples

Was this helpful?

Export as PDF
  1. Overview
  2. Deprecated
  3. CLAMM🐚

Hooks

PreviousCLAMM🐚NextWhitepapers

Last updated 1 year ago

Was this helpful?

Design

Hooks follow the same design principle as Sui's . It allows developers to enforce rules to pools. The rules are completed by calling the rule's module and collecting its witness. Rules can be anything from custom oracles to fee on swap.

Hooks

The CLAMM supports 8 hooks:

  • Start Swap: This hook must be completed before a swap transaction.

  • Finish Swap: A swap transaction must fulfill this hook to finish.

  • Start Add Liquidity: This hook must be completed before a user adds liquidity.

  • Finish Add Liquidity: A transaction to add liquidity must fulfill this hook to finish.

  • Start Remove Liquidity: This hook must be completed before a user removes liquidity.

  • Finish Remove Liquidity: A transaction to remove liquidity must fulfill this hook to finish.

  • Start Donate: This hook must be completed before a swap transaction.

  • Finish Donate: A swap transaction must fulfill this hook to finish.

Pools are not required to have hooks and a pool can have a Start Swap hook without a Finish Swap hook. Hooks are set at deployment and cannot be changed afterwards.

Examples

We will provide a set of standard hooks that will be automatically resolved via the SDK. Please refer to them on how to use your own hooks!

Kiosk transfer policy
https://github.com/interest-protocol/hooks