Stake bfBTC
Currently, we support RedStone Oracle for price feeds. BitFi plans to integrate more underlying asset oracles in the future.
Preview Stake
Description: Preview the amount of bfBTC tokens you will receive for a specified deposit amount.
Parameters:
amount
: The expected amount of underlying asset to deposit
Return Value:
The estimated amount of bfBTC to be received
Notes:
underlyingDecimals = 8 or 18
(BTCB & BTC on Bitlayer are 18; hemiBTC is 8)minAmount
acts as slippage protectionRecommended to set a 1% buffer to prevent deposit failures due to epoch updates
Helps estimate bfBTC amount before actual deposit
Stake on EVM
Description: Deposit underlying assets to receive bfBTC tokens on EVM-compatible chains.
Parameters:
amount
: The deposit amount of underlying assetminAmount
: Minimum acceptable amount of bfBTC to be minted (recommended: 1% buffer)
Chain-Specific Requirements:
Ethereum: Requires WBTC approval
BSC: Requires BTCB approval
Bitlayer: Uses native token (value sent in transaction)
Hemi: Uses hemiBTC
Calculation Formula (Ethereum WBTC):
Where:
Recv
: Amount of bfBTC received (8 decimals)DepositAmount
: Amount of WBTC deposited (8 decimals)OraclePrice
: WBTC/BTC price from oracleRatio
: Exchange ratio between BTC and bfBTC
Special Cases:
Hemi & BSC: Oracle Price fixed at 1 BTC equivalent for BTCB & hemiBTC deposits
Bitlayer: No amount parameter required; value sent in transaction
Notes:
Requires prior approval for contract to use underlying tokens
Transaction reverts if received amount < minAmount
Underlying assets transferred to
underlyingWallet
Emits
Deposit
event with transaction details
Stake on BTC
Description: Process native BTC deposits from Bitcoin network.
Parameters:
users
: Array of user addresses receiving bfBTCamounts
: Array of BTC deposit amountsnativeTxs
: Array of Bitcoin transaction hashes
Process Flow:
User deposits BTC on Bitcoin network
Multisig manager confirms deposit
Multisig manager calls
depositNative
to mint bfBTCUsers receive bfBTC tokens
Notes:
Only callable by multisig manager address
Each native transaction can only be processed once
Uses current ratio for bfBTC calculation
Emits
DepositNative
event for each successful depositRequires contract to be unpaused
Additional Information
Native deposits require administrator processing
Each native transaction hash must be unique
Batch processing supported for efficiency
Security measures prevent double-processing
Pausable functionality available for emergencies
Last updated