Booster Package
Booster Integration Guide
Table of Contents
Introduction
Understanding CKBoost
Installation
Quick Start
Core Concepts
Step-by-Step Integration
API Reference
Advanced Usage
Best Practices
Troubleshooting
Sample script
Introduction
The @ckboost/booster package is a TypeScript SDK designed for liquidity providers who want to participate in the CKBoost ecosystem. This package enables you to provide liquidity services that accelerate ckBTC conversion times, earning fees in the process.
Who This Guide Is For
Liquidity Providers: Individuals or organizations wanting to provide ckBTC liquidity services
DeFi Developers: Building applications that offer liquidity provision features
Financial Services: Companies looking to offer accelerated Bitcoin conversion services
Prerequisites
Basic understanding of TypeScript/JavaScript
Familiarity with Internet Computer Protocol (ICP)
Understanding of Bitcoin and ckBTC concepts
Node.js 16+ installed
Understanding CKBoost
The Problem
Traditional ckBTC conversion requires waiting for 6 Bitcoin confirmations, which typically takes about 1 hour. This delay creates friction for users who need faster access to their ckBTC.
The Solution
CKBoost creates a marketplace where:
Users submit boost requests when they need faster ckBTC conversion
Liquidity providers (you) evaluate and accept requests based on risk parameters
Acceleration reduces conversion time from 1 hour to 7-10 minutes
Fees are earned by liquidity providers for this service
Market Dynamics
Installation
Package Installation
Dependencies
The package automatically includes all necessary dependencies:
@dfinity/agent- ICP communication@dfinity/identity- Identity management@dfinity/principal- Principal handlingbig.js- Precise decimal calculations
Quick Start
Here's a minimal example to get you started:
Core Concepts
Booster Account
A booster account is your registered identity in the CKBoost system:
Boost Requests
When users need faster conversion, they create boost requests:
Risk Assessment
As a liquidity provider, you should evaluate:
Amount size: Larger amounts = higher risk
Fee percentage: Higher fees = better profit
User history: Repeat users may be lower risk
Market conditions: Bitcoin volatility affects risk
Step-by-Step Integration
Step 1: Setup and Identity
Step 2: Account Registration
Step 3: Liquidity Management
Step 4: Request Monitoring
Step 5: Request Evaluation and Acceptance
API Reference
Constructor
Creates a new booster instance.
Parameters:
mnemonics- Your 12-word recovery phrasehost- ICP network host (optional, defaults to mainnet)
Initialization Methods
initialize()
Initializes the connection to ICP and sets up the actor. Must be called before other methods.
Account Management
registerBoosterAccount()
Registers your account as a liquidity provider. Only needs to be called once.
getBoosterAccount()
Retrieves your booster account information.
updateBoosterDeposit(amount)
Updates the amount of ckTESTBTC you have available for boosting.
Boost Operations
getPendingBoostRequests()
Retrieves all pending boost requests from users.
acceptBoostRequest(requestId)
Accepts a specific boost request.
Token Operations
getBalance()
Gets your ckTESTBTC balance in satoshis.
transfer(to, amount)
Transfers ckTESTBTC to another account.
approve(spender, amount)
Approves another account to spend your ckTESTBTC.
Utility Methods
formatBTC(satoshis)
Converts satoshis to BTC decimal format.
parseBTC(btc)
Converts BTC decimal string to satoshis.
getPrincipal()
Returns your principal identifier.
Advanced Usage
Automated Booster Bot
Risk Scoring System
Best Practices
Security
Secure Mnemonic Storage
Error Handling
Performance
Batch Operations
Caching
Monitoring
Logging
Metrics
Troubleshooting
Common Issues
"Cannot find module" Error
Solution:
Identity/Authentication Errors
Solutions:
Verify your mnemonic phrase is correct
Check network connectivity
Ensure proper host configuration
Insufficient Funds
Solutions:
Check your ckTESTBTC balance
Ensure you have approved enough tokens
Verify your deposit amount
Request Already Accepted
This is normal - another booster accepted the request first. Your system should handle this gracefully:
Debug Mode
Enable detailed logging for troubleshooting:
Performance Issues
If operations are slow:
Check Network Latency
Optimize Polling Frequency
Use Connection Pooling
Source code and sample
ckBoost packages are completely open-source and can be found on Github: https://github.com/ckboost/ckboost-packages
Sample application source, using @ckboost/booster package can be found here:
https://github.com/ckboost/ckboost-packages/tree/main/sample
Happy boosting! 🚀
Last updated