Core Concept

Accumulate & Invest

Round-ups accumulate in the Buff wallet until the threshold is reached, then auto-swap via Jupiter.

The Flow

PhaseWhat happensWhere
Round-upSpare change transferred to Buff walletPer transaction
AccumulateSOL balance grows in Buff walletAutomatic
Threshold checkBalance compared to USD thresholdAfter each wrap()
SwapSOL → target asset via JupiterWhen threshold reached

Why Accumulate?

Individual round-ups are small ($0.03 - $0.99). Swapping $0.03 worth of SOL into BTC would cost more in swap fees than the amount itself. By accumulating to $5 (default), the swap is meaningful and cost-efficient.

Checking the Balance

check.ts
typescript
1const { state, swap, quote } = await buff.checkAndInvest()
2
3console.log(state)
4// {
5// balanceSol: 0.034,
6// balanceUsd: 5.10, // above $5 threshold!
7// thresholdReached: true,
8// solPriceUsd: 150,
9// }
10
11if (swap) {
12 console.log("Swapped!", swap.txSignature)
13 // Buff wallet now holds BTC (or target asset)
14}

Configuring the Threshold

threshold.ts
typescript
1// Set during init
2const buff = await Buff.init({
3 investThreshold: 10, // wait until $10
4 // ...
5})
6
7// Or change at runtime
8buff.setThreshold(25) // accumulate more before swapping

Supported Assets

AssetTokenMainnet Mint
BTCwBTC (Portal)3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh
ETHwETH (Portal)7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs
SOLNative SOLSo11111111111111111111111111111111111111112
USDCUSDCEPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
USDTUSDTEs9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB
Note
Jupiter handles the swap routing automatically — it finds the best price across all Solana DEXes. The SDK keeps a 0.01 SOL reserve in the Buff wallet for future transaction fees.