b14g - Lower capital barriers to Bitcoin staking
HomeFollow us on X
  • Introduction
    • Problem Statement
    • Untapped market
  • Architecture
    • Dual Staking
    • Merge Marketplace
  • Products
    • Merge Marketplace on Core Chain
    • dualCORE
      • Design of Liquid Dual-Staking Vault (dualCORE)
  • User Guides
    • User Guide: Merge Marketplace
    • User Guide: dualCORE Vault
  • FAQ
    • dualCORE FAQs
    • Merge Marketplace on Core FAQs
    • Merge Staking Testnet -01 (Closed) FAQs
    • Chinese AMA - Merge Marketplace & dualCORE vault
  • Audits
  • Official links
    • b14g App
    • Blog
    • X (Twitter)
    • Telegram
    • Discord
Powered by GitBook
On this page
  • Design Summary​
  • User Perspective
  • Implementations​
  • dualCORE/CORE Conversion Ratio Calculation​
  • Deposit/Redeem Restrictions & Dues Protection
  • ABI
  1. Products
  2. dualCORE

Design of Liquid Dual-Staking Vault (dualCORE)

PreviousdualCORENextUser Guides

Last updated 2 months ago

Design Summary

  • We introduce the dualCORE Vault along with its standard ERC-20 token, dualCORE.

  • Users interact with the vault to mint, redeem (normal/instant mode), and withdraw their assets.

  • The vault applies yield strategies within the b14g Merge Marketplace, which directly interacts with the Core Staking Contract to earn dual-staking yields.

  • All value accrued within the vault is reflected in the dualCORE token’s value.

  • The CORE/dualCORE conversion ratio is auto-updated daily, aligning with Core staking’s turn-round mechanism.

  • To optimize yield strategies, system operators have additional methods to rebalance and adjust vault allocations.

User Perspective

Deposit & Mint

  • Users deposit CORE into the dualCORE Vault, which mints dualCORE tokens (ERC-20) based on the current dualCORE/CORE exchange rate and sends dualCORE tokens to the user's wallet.

  • Throughout the day (UTC), users can mint dualCORE at the same conversion ratio. Example: If the conversion ratio is 1:1.2, depositing 120 CORE will mint 100 dualCORE.

Redeem

Users can always redeem their dualCORE tokens for CORE at the current exchange rate. Example: If the current conversion ratio is 1:1.2, redeeming 100 dualCORE will return 120 CORE.

There are 2 redemption modes:

  • Normal Redemption: Once users request normal redemption from the system, it takes 1 day for them to withdraw CORE tokens to their wallet (no redemption fee).

  • Instant Redemption: Instant redemption lets users withdraw CORE immediately to their wallet without any redemption period (with a 10% fee).

Common ERC-20 Use Cases

Since dualCORE is a standard ERC-20 token, it can be transferred, used in DeFi protocols, provided as liquidity on DEXs, swapped, and more.

User Methods in dualCORE Vault

  • stake() → Deposit CORE and mint dualCORE.

  • unbond() → Request redemption from dualCORE to CORE (normal redemption).

  • withdraw() → Withdraw CORE to wallet once the normal redemption period ends.

  • withdrawDirect() → Withdraw CORE immediately to wallet with no redemption period applied (instant redemption).

Operator Methods in dualCORE Vault

After each turn round in Core staking mechanism, the vault collects rewards from Merge Marketplace orders and stakes them back to compound returns. During this process, the vault moves CORE from lower-yielding orders to higher-yielding ones to maximize vault overall APY.

And after that the conversion ratio of dualCORE/CORE can also be updated. The formula for that is:

Total Amount of CORE in the vault / dualCORE.totalsupply()

Since Core staking rewards are only distributed once per day, the conversion rate remains unchanged throughout the day until the next turn round.

Deposit/Redeem Restrictions & Dues Protection

The Core staking contract enforces these rules:

  • When delegating CORE, the amount must be >= 1 CORE.

  • When undelegating CORE:

    • The amount must be >= 1 CORE, and

    • The remaining CORE left on a validator of this address must be >= 1 or =0.

Since these restrictions also apply to Merge Marketplace, and the Vault applies yield strategies within the Merge Marketplace, it must adhere to the same rules when executing stake(), unbond(), and withdrawDirect() operations.

ABI

// abi for reading conversion rate from contract

[{
    "inputs": [
        {
            "internalType": "uint256",
            "name": "_dualCore",
            "type": "uint256"
        }
    ],
    "name": "exchangeCore",
    "outputs": [
        {
            "internalType": "uint256",
            "name": "",
            "type": "uint256"
        }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
}]

The function calculates the amount of CORE received when a given amount of dualCORE is provided. For example, if the input parameter is 1 dualCORE (1e18), the corresponding output is 1.039864488620697759 CORE (1039864488620697759).

// abi for Deposit (stake())
[
{
    "inputs": [],
    "name": "stake",
    "outputs": [],
    "stateMutability": "payable",
    "type": "function"
}
]

When a user deposits CORE to mint dualCORE, they simply call the stake() function and send the desired amount of CORE as msg.value. Based on the current CORE/dualCORE exchange rate, the vault will mint the corresponding amount of dualCORE.

// abi for Normal Redemption (unbond() and Withdraw()) and Immediate Redemption (withdrawDirect())

[
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "dualCoreAmount",
                "type": "uint256"
            },
            {
                "internalType": "bool",
                "name": "claim",
                "type": "bool"
            }
        ],
        "name": "unbond",
        "outputs": [],
        "stateMutability": "payable",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "withdraw",
        "outputs": [],
        "stateMutability": "payable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "dualCoreAmount",
                "type": "uint256"
            },
            {
                "internalType": "bool",
                "name": "claim",
                "type": "bool"
            }
        ],
        "name": "withdrawDirect",
        "outputs": [],
        "stateMutability": "payable",
        "type": "function"
    }
]

- Normal Redemption: Call unbond(amount of dualCORE to withdraw, true). After a 1-day delay, call withdraw() to complete the process.

- Immediate Redemption: Call withdrawDirect(amount of dualCORE to withdraw, true) for instant withdrawal.

Implementations

ReInvest() → Periodically reinvests CORE into orders on to maximize Core dual-staking yield and auto-compound rewards. The system reallocates funds by topping up the highest-yielding orders and withdrawing from the lowest-yielding invested ones.

dualCORE/CORE Conversion Ratio Calculation

dualCORE Vault contract address:

For example, in this transaction , the user sent 3 CORE to the contract via msg.value, and the contract minted 3 dualCORE in return.

​
​
Merge Marketplace
​
0xee21ab613d30330823D35Cf91A84cE964808B83F
here