Booster Package

Booster Integration Guide

Table of Contents

  1. Introduction

  2. Understanding CKBoost

  3. Installation

  4. Quick Start

  5. Core Concepts

  6. Step-by-Step Integration

  7. API Reference

  8. Advanced Usage

  9. Best Practices

  10. Troubleshooting

  11. 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:

  1. Users submit boost requests when they need faster ckBTC conversion

  2. Liquidity providers (you) evaluate and accept requests based on risk parameters

  3. Acceleration reduces conversion time from 1 hour to 7-10 minutes

  4. 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 handling

  • big.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 phrase

  • host - 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

  1. Secure Mnemonic Storage

  1. Error Handling

Performance

  1. Batch Operations

  1. Caching

Monitoring

  1. Logging

  1. Metrics

Troubleshooting

Common Issues

"Cannot find module" Error

Solution:

Identity/Authentication Errors

Solutions:

  1. Verify your mnemonic phrase is correct

  2. Check network connectivity

  3. Ensure proper host configuration

Insufficient Funds

Solutions:

  1. Check your ckTESTBTC balance

  2. Ensure you have approved enough tokens

  3. 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:

  1. Check Network Latency

  1. Optimize Polling Frequency

  1. Use Connection Pooling


Source code and sample

ckBoost packages are completely open-source and can be found on Github: https://github.com/ckboost/ckboost-packagesarrow-up-right

Sample application source, using @ckboost/booster package can be found here:

https://github.com/ckboost/ckboost-packages/tree/main/samplearrow-up-right


Happy boosting! 🚀

Last updated