Quipuswap
  • introduction
    • What is QuipuSwap?
    • Participants
    • QuipuSwap subprojects
      • QuipuSwap Farms
      • Quipuswap Stable DEX
      • Token to Token Swaps
      • Governance (text-only)
  • Get Started
    • Install Wallet
    • How to get TEZ
    • How to find my tokens
    • Connect wallet
    • FAQ
  • Dex Guides
    • Overview
    • Types of the exchange (Token/TEZ, Token/Token)
    • How to use the DEX
      • Trade
      • How to add liquidity to an existing liquidity pool
      • How to create a new liquidity pool
      • How to remove liquidity
      • How to vote for a baker
      • How to ban/veto a baker
  • Tezos Tokens
    • What is a Token?
    • What is the difference between FA1.2 and FA2 standards?
    • QUIPU Tokenomics
  • Smart Contracts
    • Dex token edition
      • Overview
      • Dex
      • Exceptions
    • QuipuSwap stable swap DEX
      • šŸ› ļøDeveloper module
        • šŸ“„Storage & action types
        • šŸ”µDeveloper setter entrypoints
          • set_dev_address
          • set_dev_fee
      • šŸ Standalone DEX
        • šŸ“„Storage and types overview
        • 🟔Initialization
          • set_admin_function
          • set_dev_function
          • set_dex_function
          • set_token_function
        • 🟠Add new dex
          • add_pool
        • šŸ”µDEX methods
          • invest
          • swap
          • šŸ“¤Divesting
            • divest
            • divest_imbalanced
            • divest_one_coin
          • šŸ¤‘DEX rewards
            • claim_referral
            • stake
        • šŸ› ļøDeveloper methods
          • claim_developer
          • Dev module entrypoints
        • šŸ›‘Admin methods
          • add_rem_managers
          • ramp_A
          • set_admin
          • set_fees
          • stop_ramp_A
      • šŸ­Factory
        • šŸ“„Storage and types overview
        • 🟔Initial setup
          • set_init_function
          • set_dev_function
          • DEX compiled codebase setup
            • set_admin_function
            • set_dex_function
            • set_token_function
        • 🟠Initialize new DEX flow
          • add_pool
          • start_dex
        • šŸ’±Deployed from factory DEX
          • šŸ“„Storage and types overview
          • 🟔Initialization
            • copy_dex_function
            • freeze
          • šŸ”µDEX methods
          • šŸ› ļøClaim developer rewards
          • šŸ›‘Admin methods
        • šŸ›‘Developer methods
          • claim_rewards
          • šŸ§‘ā€šŸ’»Factory management
            • 🟢Factory params
              • set_burn_rate
              • set_price
              • set_whitelist
            • šŸ”µDev module entrypoints
    • Dex 2.0
      • ā‰ļøErrors overview
      • 🄐BakerRegistry contract
        • Storage and types overview
        • Entrypoints overview
          • validate
          • register
      • āš™ļøFlashSwapsProxy contract
        • Storage and types overview
        • Entrypoints overview
          • default
      • 🧺Bucket contract
        • Storage and types overview
        • Entrypoints overview
          • fill
          • pour_out
          • pour_over
          • withdraw_rewards
          • ban_baker
          • vote
          • default
        • On-chain views overview
          • is_banned_baker
          • get_tez_balance
          • get_user_candidate
      • āš–ļøAuction contract
        • Storage and types overview
        • Entrypoints overview
          • Auction entrypoints
            • receive_fee
            • launch_auction
            • place_bid
            • claim
          • Admin entrypoints
            • set_admin
            • confirm_admin
            • set_baker
            • set_fees
            • set_auction_duration
            • set_min_bid
            • update_whitelist
            • withdraw_dev_fee
            • withdraw_public_fee
            • burn_bid_fee
      • šŸ¦DexCore contract
        • Storage and types overview
        • Entrypoints overview
          • DEX entrypoints
            • launch_exchange
            • invest_liquidity
            • divest_liquidity
            • swap
            • withdraw_profit
            • claim_interface_fee
            • claim_interface_tez_fee
            • withdraw_auction_fee
            • vote
          • Admin entrypoints
            • set_admin
            • confirm_admin
            • set_flash_swaps_proxy
            • set_auction
            • add_managers
            • set_fees
            • set_collecting_period
            • update_token_metadata
            • ban
          • Permits' entrypoints
            • permit
            • set_expiry
          • FA2 entrypoints
            • transfer
            • update_operators
            • balance_of
          • Callbacks
            • launch_callback
            • flash_swap_callback
            • close
        • On-chain views overview
          • check_is_banned_baker
          • get_reserves
          • get_total_supply
          • get_swap_min_res
          • get_toks_per_share
          • get_cumulative_prices
          • get_collecting_period
    • Trusted contracts
    • Farming
      • Referral system overview
      • Fees overview
      • Rewards precision overview
      • BakerRegistry contract
        • Storage and types overview
        • Entrypoints overview
          • validate
          • register
      • Burner contract
        • Storage and types overview
        • Entrypoints overview
          • default
          • burn_callback
      • ProxyMinter contract
        • Storage and types overview
        • Entrypoints overview
          • Admin entrypoints
            • add_minter
            • withdraw_tokens
            • set_admin
            • confirm_admin
          • Minter entrypoint
            • mint_tokens
      • QFarm contract
        • Storage and types overview
        • Entrypoints overview
          • Farming entrypoints
            • deposit
            • withdraw
            • harvest
          • FA2 entrypoints
            • transfer
            • update_operators
            • balance_of
          • Admin entrypoints
            • set_admin
            • confirm_admin
            • set_fees
            • set_reward_per_second
            • set_burner
            • set_proxy_minter
            • set_baker_registry
            • set_is_v1_lp
            • ban_bakers
            • add_new_farm
            • pause_farms
            • burn_tez_rewards
            • withdraw_farm_depo
            • update_token_metadata
          • Other entrypoints
            • burn_farm_rewards
            • default
      • TFarm contract
        • Storage and types overview
        • Entrypoints overview
          • Farming entrypoints
            • deposit
            • withdraw
            • harvest
          • FA2 entrypoints
            • transfer
            • update_operators
            • balance_of
          • Admin entrypoints
            • set_admin
            • confirm_admin
            • set_fees
            • set_reward_per_second
            • set_burner
            • set_baker_registry
            • set_is_v1_lp
            • ban_bakers
            • add_new_farm
            • pause_farms
            • burn_tez_rewards
            • claim_farm_rewards
            • withdraw_farm_depo
            • update_token_metadata
          • Other entrypoints
            • default
  • Brand and Logos
Powered by GitBook
On this page
  1. Smart Contracts
  2. QuipuSwap stable swap DEX
  3. Factory
  4. Initialize new DEX flow

add_pool

This entrypoint allows anyone to deploy a new own DEX pool.

QUIPU token should be approved (updated operators) before calling this method.

Call parameters

Parameters logically close to Standalone variant of Add new dex, but there is no "reserves" field in tokens_info mapping (because invest performs at second step - start_dex) and some additional config parameters.

  • default_referral - the address that would be the default referral at the new pool.

  • managers - a set of addresses that allowed to manipulate LP token metadata at the new pool.

  • metadata - metadata of deployed contract.

  • token_metadata - metadata of the LP token at the new pool.

Field
Type
Description

a_constant

nat

input_tokens

set(token_t)

sorted set of FA2/FA1.2 tokens to add as DEX.

tokens_info

map(token_pool_idx_t,token_prec_info_t)

map of rates and precisions config

default_referral

address

default referral that will be used in operations with the referral.

managers

set(address)

set of managers that allowed to change LP token metadata.

metadata

big_map(string, bytes)

token_metadata

big_map(token_id_t, token_meta_info_t)

type token_prec_info_t  is [@layout:comb] record [
  rate                    : nat;
  precision_multiplier    : nat;
]

type pool_init_param_t  is [@layout:comb] record [
  a_constant              : nat;
  input_tokens            : set(token_t);
  tokens_info             : map(token_pool_idx_t, token_prec_info_t);
  default_referral        : address;
  managers                : set(address);
  metadata                : big_map(string, bytes);
  token_metadata          : big_map(token_id_t, token_meta_info_t);
]
PreviousInitialize new DEX flowNextstart_dex

Last updated 3 years ago

constant "A" as represented as .

contract metadata by

mapping each token metadata by

šŸ­
🟠
Aāˆ—nnāˆ’1A*n^{n-1}Aāˆ—nnāˆ’1
TZIP-016
TZIP-012