DegenHive
Search
K

Config Module

DegenHive's master control panel for defining operational rules, fees, and governance access.
Welcome aboard, hive navigator! This is your tour guide to Config module, which acts as the master control panel for configuring our hive's exchange, DegenHive DEX. Get to know the protocol's engine room before you navigate through its various elements.

OBJECTS

Config: A shared object, which acts as our DEX's rulebook. Houses settings such as coin decimals, stable coin identifiers, fees for different pool types, and treasury percent. All the important info our DEX needs to function.
HiveDaoCapability & DexDaoCapability: Born when the Config module package is launched 🚀, they take residency in DEX_DAO and HIVE_DAO modules. They're the gatekeepers 🛡️, controlling access to various functions across DegenHive - accessible via Governance proposal only!
Treasury: Our treasure chest 🏦! This is where we tuck away SUI tokens, ready to fund hive-approved projects.
FeeInfo: The IRS of our DEX 🧾. It outlines the fee structure for different pool types in the exchange.

Constants ⚙️

Our constants are the pillars that hold our hive up, ensuring the DEX runs like a well-oiled machine. They're like speed limits 🛣️, ensuring we're always in control.
  1. 1.
    INIT_TREASURY_PERCENT: This constant represents the initial treasury fee percentage, which is set to 10% at the genesis of the DEX (Decentralized Exchange).
  2. 2.
    WEIGHTED_TOTAL_FEE_BPS: This parameter is the initial fee charged by the weighted pools. It is set to 35 basis points at genesis, which equates to 0.35%.
  3. 3.
    WEIGHTED_HIVE_FEE_PERCENT: This constant determines the percentage of the weighted pool fee that goes to the protocol. It is initially set to 34%, and this fee is used for SUI buybacks.
  4. 4.
    STABLE_TOTAL_FEE_BPS: This is the initial fee charged by the stable pools, set to 10 basis points at genesis or 0.1%.
  5. 5.
    STABLE_HIVE_FEE_PERCENT: This parameter represents the percentage of the stable pool fee that goes to the protocol, set at 35% for SUI buybacks.
  6. 6.
    CURVED_TOTAL_FEE_BPS: This constant refers to the initial fee charged by the curved pools, set at 40 basis points at genesis, equivalent to 0.4%.
  7. 7.
    CURVED_HIVE_FEE_PERCENT: This parameter is the proportion of the curved pool fee that goes to the protocol, initially set at 42% for SUI buybacks.
  8. 8.
    MIN_FEE: The minimum value of fee chargeable on each swap, represented as 1/10000 or 0.01%.
  9. 9.
    MAX_FEE: The maximum value of fee chargeable on each swap, represented as 100/10000 or 1%.
  10. 10.
    MIN_HIVE_FEE: The minimum value of the total protocol fee, set at 30%.
  11. 11.
    MAX_HIVE_FEE: The maximum value of the total protocol fee, set at 50%.
  12. 12.
    MIN_TREASURY_FEE: The minimum value of the total collected protocol fee that goes to the SUI treasury, set at 5%.
  13. 13.
    MAX_TREASURY_FEE: The maximum value of the total collected protocol fee that goes to the SUI treasury, set at 25%.

📝 FUNCTIONS EXECUTABLE VIA PROPOSALS VIA HIVE DAO 📝

Time for some game-changers! ⚡ These functions are the trump cards ♠️, capable of reshaping the hive's rules. But power comes with responsibility! They can only be called into action through proposals approved by the wisdom of our hive members.
1️⃣ add_coin_decimals: This function lets the hive add tokens (with their decimal values) to the DEX config. Perfect for those shy coins without a metadata object, like SUI, or coins that are Balance-struct wrappers (think LP coins).
2️⃣ add_stable_identifer_by_type & add_stable_identifer: Want a new stablecoin identifier in the DEX config? No problem! Stable identifiers are great for easy understanding of curved pool types' price scales and functions.
3️⃣ remove_stable_identifer_type & remove_stable_identifer: Let's keep the house clean! These functions allow the removal of a stablecoin identifier from the DEX config.
4️⃣ update_default_fee_for_curve: Need to adjust the default fee for a Curve type? You've got it! This function is your go-to tool.
That's your primer to the Config module of DegenHive DEX. Happy sailing! ⛵️