Bunicorn
Launch Testnet App
  • What is Bunicorn?
  • Introduction
    • AMM DEX
    • Liquidity Mining
    • NFT Collectibles
  • Getting Started
    • Wallets that Bunicorn supports
    • Get BEP20 Tokens
    • Connect your wallet
    • Bunicorn testnet 101
  • Bunicorn Exchange TUTORIAL
    • Tutorial for Trader
    • Tutorial for Liquidity Provider
      • Setup Proxy
      • Swap native BNB to WBNB to farm
      • How to Add Liquidity on Bunicorn
        • How to add liquidity to a Flexible pool?
        • How to add liquidity to a Stable Pool?
      • How to create a new Flexible pool?
        • How to Create a New Smart Pool
        • How to Create a New Shared Pool
      • How to Remove Liquidity
    • How to Join Token Play Farms
      • Stake LPs to Token Play Farm
      • Stake Single Asset $TOP
    • How to Join Ancient Buni NFT Farms
      • NFT Farm Ends. What should I do?
      • Stake LPs to Join the Ancient Buni Farm
      • Stake Single Asset
      • Harvest NFTs (Ancient Buni)
      • How to transfer Ancient BUNI NFTs to another address?
    • How to Join Bunicorn NFT Farms
      • Prestaking Farm Ends. What's next?
      • Stake LP to Join NFT Farms
      • Stake Single Asset
      • Harvest NFTs (Chest/Egg)
      • How to unlock ingame items from Chest/Egg NFTs
      • How to Transfer Egg/Chest NFTs to another address
    • Fee Structure
  • FAQ
    • What is a Flexible Pool?
    • What is a Stable Pool?
    • Can users create Stable pools themselves?
    • Are there any constraints for setting up a Bunicorn Flexible pool?
    • What are the advantages of a Stable Pool?
  • Glossary
  • SMART CONTRACTS
    • Flexible Pools
      • Exchange Proxy
      • Smart Order Router
      • On Chain Registry
      • Smart Pools
        • Overview
        • Configurable Rights Pool
        • Component Libraries
          • Rights Manager
      • Interfaces
      • Addresses
      • Events
      • API Index
    • Stable Pools
      • Pool Addresses
      • Swap Execution
      • Providing Liquidity
      • Flash Swaps
      • Contract Addresses
      • BuniCornRouter02
      • Pool
      • Pool (ERC-20)
      • Library
  • Subgraph API
    • Stable Pools
      • Entities
      • Sample queries
    • Flexible Pools
      • Entities
      • Sample queries
Powered by GitBook
On this page
  • Smart Contract Owned Controlled Pools ("Smart Pools")
  • Conceptual Capabilities

Was this helpful?

  1. SMART CONTRACTS
  2. Flexible Pools
  3. Smart Pools

Overview

PreviousSmart PoolsNextConfigurable Rights Pool

Last updated 3 years ago

Was this helpful?

Smart Contract Owned Controlled Pools ("Smart Pools")

One very powerful feature of Bunicorn is the concept of Smart Pools. A smart contract controlled pool can fully emulate a finalized pool, while also allowing complex logic to readjust balances, weights, and fees. Some examples include:

  • A pool that adjusts swap fees as a function of the volatility of the pool's assets

  • A pool that updates weights to implement a particular market strategy (e.g., a ).

  • More complex for asset allocation

In a nutshell, Bunicorn has deployed Factory contracts for creating pools. Users deploy new pool contracts by calling create methods on these factories. In both cases, the actual "pool" visible to traders on the public interfaces is a new BPool contract.

If you deploy a Core Pool directly, you are the controller of that pool. If you deploy a Smart Pool, you need to pass in the core BFactory address, since two contracts will be deployed. You are the controller of the Smart Pool - and the Smart Pool itself is the controller of the BPool.

Conceptual Capabilities

There are three categories of things you can do with pools.

  • Trade - using the swap functions

  • Provide liquidity - using the join/exit pool functions (both single- and multi-asset entry and exit are supported)

  • Manage the pool - if you are the controller (e.g., change its parameters)

Core Pools can only be managed until "finalized," after which their parameters are immutable.

Smart Pools are managed according to the rights granted to the controller on creation. For instance, you can create a Smart Pool where the weights can be changed, but the swap fee and token composition are fixed.

  • SWAP (swap_*, joinswap_*, exitswap_*)

  • JOIN (joinPool, joinswap_*)

  • EXIT (exitPool, exitswap_*)

  • CONTROL (bind, unbind, rebind, setSwapFee, finalize)

Notice that e.g. joinswap requires both JOIN and SWAP.

Liquidity Bootstrapping Pool
dynamic strategies