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
  • token_type
  • stake_params_type
  • fees_type
  • farm_type
  • user_info_type
  • baker_type
  • tok_meta_type
  • storage_type - main contract storage
  • full_storage_type - storage root
  1. Smart Contracts
  2. Farming
  3. QFarm contract

Storage and types overview

token_type

type fa12_type          is address

type fa2_type           is [@layout:comb] record [
  token                   : address;
  id                      : token_id_type;
]

type token_type         is
  FA12                    of fa12_type
| FA2                     of fa2_type

stake_params_type

Field
Type
Description

staked_token

FA1.2/FA2 staked token

is_v1_lp

bool

Flag that indicates: QuipuSwap V1 LP token staked or not

type stake_params_type  is [@layout:comb] record [
  staked_token            : token_type;
  is_v1_lp                : bool;
]

fees_type

Field
Type
Hint
Description

harvest_fee

nat

Float value multiplied by 1e+16

Fee that applies in time of rewards claiming

withdrawal_fee

nat

Float value multiplied by 1e+16

Fee that applies in time of withdrawing (unstaking) tokens only in farms with timelock. Applies only in case of early withdrawal

burn_reward

nat

Float value multiplied by 1e+16

type fees_type          is [@layout:comb] record [
  harvest_fee             : nat;
  withdrawal_fee          : nat;
  burn_reward             : nat;
]

farm_type

Field
Type
Description

fees

Fees that applies to the farming

upd

timestamp

Last time of farm's rewards updating

stake_params

Staking parameters

reward_token

QuipuSwap Governance token

timelock

nat

Timelock in seconds (0 for farms without timelock)

current_delegated

key_hash

A baker account TEZ tokens are currently delegated for

next_candidate

key_hash

A best candidate to become current delegated

paused

bool

Flag that indicates: farm is paused or not

reward_per_second

nat

Reward per second

reward_per_share

nat

Accumulator for reward per 1 staked token's unit

staked

nat

Total count of staked tokens in farm

claimed

nat

Total count of claimed tokens

start_time

timestamp

Farm's start time

fid

fid_type (nat)

Farm's ID

type farm_type          is [@layout:comb] record [
  fees                    : fees_type;
  upd                     : timestamp;
  stake_params            : stake_params_type;
  reward_token            : fa2_type;
  timelock                : nat;
  current_delegated       : key_hash;]
  next_candidate          : key_hash;
  paused                  : bool;
  reward_per_second       : nat;
  reward_per_share        : nat;
  staked                  : nat;
  claimed                 : nat;
  start_time              : timestamp;
  fid                     : fid_type;
]

user_info_type

Field
Type
Description

last_staked

timestamp

Last time when user staked tokens

staked

nat

Total amount of tokens staked by user

earned

nat

Amount of tokens earned by user

claimed

nat

A mount of tokens claimed by user per all time

prev_earned

nat

Amount of tokens staked by user multiplied by rewards per share

prev_staked

nat

Total amount of tokens staked by user in previous contract call

allowances

set(address)

Set of user's allowances for staked tokens transfer

type user_info_type     is [@layout:comb] record [
  last_staked             : timestamp;
  staked                  : nat;
  earned                  : nat;
  claimed                 : nat;
  prev_earned             : nat;
  prev_staked             : nat;
  allowances              : set(address);
]

baker_type

Field
Type
Description

period

nat

Period during which baker will be banned (in seconds)

start

timestamp

Ban start time

type baker_type         is [@layout:comb] record [
  period                  : nat;
  start                   : timestamp;
]

tok_meta_type

Field
Type
Description

token_id

nat

Token ID

token_info

map(string, bytes)

Mapping of token's keys to token's info

type tok_meta_type      is [@layout:comb] record [
  token_id                : nat;
  token_info              : map(string, bytes);
]

storage_type - main contract storage

Field
Type
Description

farms

Mapping of all farmings on the contract

referrers

big_map(address, address)

Mapping of users' addresses to their referrers' addresses

users_info

Mapping of farms' IDs and users' addresses (in pair) to users' info

votes

big_map((fid_type * key_hash), nat)

Mapping of farms' IDs and bakers' addresses (in pair) to votes for this bakers

candidates

big_map((fid_type * address), key_hash)

Mapping of farms' IDs and users' addresses (in pair) to users' candidates in voting

banned_bakers

Mapping of banned bakers' addresses to their ban info

token_metadata

Mapping of tokens' IDs to tokens' metadata

qsgov

fa2_type

QuipuSwap Governance token info (address and token ID)

qsgov_lp

address

admin

address

Administrator of the contract

pending_admin

address

Pending administrator that should accept his new administrator role (if it is possible)

burner

address

proxy_minter

address

baker_registry

address

farms_count

nat

Number of farms created on this contract

type storage_type       is [@layout:comb] record [
  farms                   : big_map(fid_type, farm_type);
  referrers               : big_map(address, address);
  users_info              : big_map((fid_type * address), user_info_type);
  votes                   : big_map((fid_type * key_hash), nat);
  candidates              : big_map((fid_type * address), key_hash);
  banned_bakers           : big_map(key_hash, baker_type);
  token_metadata          : big_map(fid_type, tok_meta_type);
  qsgov                   : fa2_type;
  qsgov_lp                : address;
  admin                   : address;
  pending_admin           : address;
  burner                  : address;
  proxy_minter            : address;
  baker_registry          : address;
  farms_count             : nat;
]

full_storage_type - storage root

Field
Type
Description

storage

storage_type

Actual storage of the contract

q_farm_lambdas

big_map(nat, bytes)

Contract's lambda-methods

metadata

big_map(string, bytes)

type full_storage_type  is [@layout:comb] record [
  storage                 : storage_type;
  q_farm_lambdas          : big_map(nat, bytes);
  metadata                : big_map(string, bytes);
]
PreviousQFarm contractNextEntrypoints overview

Last updated 3 years ago

The % of the rewards that will be minted to the transaction sender when he calls entrypoint

big_map(fid_type, )

big_map((fid_type * address), )

big_map(key_hash, )

big_map(fid_type, )

Address of the on QuipuSwap DEX

contract address

contract address

contract address

Contract's metadata according to

burn_farm_rewards
QUIPU/TEZ LP token
Burner
ProxyMinter
BakerRegistry
TZIP-016
token_type
fees_type
stake_params_type
fa2_type
farm_type
user_info_type
baker_type
tok_meta_type