Skip to main content

Split SOL

POST /v1/sol/split/execute

Split SOL from one managed wallet into up to five destination wallets in one server-signed transaction.

The source wallet is a SolanaLaser-managed wallet. If source_wallet is omitted, SolanaLaser uses the API key's default wallet.

Split SOL is useful when you want to prepare multiple managed wallets from one source wallet, distribute a fixed amount to one wallet, and allocate the rest by percentage or equal split.

Request

const response = await fetch("https://api.solanalaser.xyz/v1/sol/split/execute", {
method: "POST",
headers: {
"content-type": "application/json",
"x-api-key": "sl_your_key",
},
body: JSON.stringify({
source_wallet: "MANAGED_SOURCE_WALLET",
total_percent: 50,
destinations: [
{wallet: "DESTINATION_1", sol: "1"},
{wallet: "DESTINATION_2", percent: 20},
{wallet: "DESTINATION_3"}
],
confirm: true,
}),
});

const split = await response.json();

Request Fields

FieldTypeRequiredMeaning
source_walletstringNoManaged wallet public key to split from. Defaults to the API key's default wallet.
total_percentnumber or stringNoDefaults to 100. Percentage of the source wallet's spendable balance selected for splitting.
fee_reserve_lamportsintegerNoDefaults to 5000. Added to Sender tip and priority fee to compute the effective reserve.
destinationsarrayYesDestination rules. Must contain 1 to 5 wallets.
confirmbooleanNoDefaults to true. If true, SolanaLaser waits for signature confirmation.

Each destination has:

FieldTypeRequiredMeaning
walletstringYesDestination wallet public key.
solnumber or stringNoFixed SOL amount for this destination. Cannot be used with percent.
percentnumber or stringNoPercentage of transfer_total_lamports for this destination. Cannot be used with sol.

If a destination has neither sol nor percent, it receives an equal share of the unallocated remainder.

How Allocation Works

SolanaLaser first calculates the effective fee reserve:

effective reserve = requested fee_reserve_lamports + Sender tip + priority fee reserve

Then it calculates:

spendable_lamports = source_balance_lamports - effective reserve
transfer_total_lamports = total_percent of spendable_lamports

Destination allocation then happens in this order:

  1. Fixed sol destinations are allocated first.
  2. percent destinations receive their share of transfer_total_lamports.
  3. Destinations without sol or percent split the remaining lamports equally.
  4. If equal splitting leaves dust, earlier equal destinations receive the extra lamports.

Every destination must receive at least one lamport.

Equal Split

This splits the full spendable balance equally between two destinations.

Request

const response = await fetch("https://api.solanalaser.xyz/v1/sol/split/execute", {
method: "POST",
headers: {
"content-type": "application/json",
"x-api-key": "sl_your_key",
},
body: JSON.stringify({
destinations: [
{wallet: "DESTINATION_1"},
{wallet: "DESTINATION_2"}
],
}),
});

const split = await response.json();

Response: 200

{
"source_wallet": "MANAGED_SOURCE_WALLET",
"source_balance_lamports": 10000205000,
"fee_reserve_lamports": 205000,
"spendable_lamports": 10000000000,
"transfer_total_lamports": 10000000000,
"transfer_total_sol": "10.000000000",
"transfers": [
{"wallet": "DESTINATION_1", "lamports": 5000000000, "sol": "5.000000000", "mode": "equal"},
{"wallet": "DESTINATION_2", "lamports": 5000000000, "sol": "5.000000000", "mode": "equal"}
],
"signature": "SOLANA_SIGNATURE",
"confirmed": true,
"confirmation_status": "confirmed"
}

Mixed Split

This selects 50% of spendable SOL, sends 1 SOL to the first destination, sends 20% of the selected transfer total to the second destination, and sends the remaining selected SOL to the third destination.

Request

const response = await fetch("https://api.solanalaser.xyz/v1/sol/split/execute", {
method: "POST",
headers: {
"content-type": "application/json",
"x-api-key": "sl_your_key",
},
body: JSON.stringify({
source_wallet: "MANAGED_SOURCE_WALLET",
total_percent: 50,
destinations: [
{wallet: "DESTINATION_1", sol: "1"},
{wallet: "DESTINATION_2", percent: 20},
{wallet: "DESTINATION_3"}
],
}),
});

const split = await response.json();

Response: 200

{
"source_wallet": "MANAGED_SOURCE_WALLET",
"source_balance_lamports": 10000205000,
"fee_reserve_lamports": 205000,
"spendable_lamports": 10000000000,
"transfer_total_lamports": 5000000000,
"transfer_total_sol": "5.000000000",
"transfers": [
{"wallet": "DESTINATION_1", "lamports": 1000000000, "sol": "1.000000000", "mode": "fixed"},
{"wallet": "DESTINATION_2", "lamports": 1000000000, "sol": "1.000000000", "mode": "percent"},
{"wallet": "DESTINATION_3", "lamports": 3000000000, "sol": "3.000000000", "mode": "equal"}
],
"signature": "SOLANA_SIGNATURE",
"confirmed": true,
"confirmation_status": "confirmed"
}

Response Fields

FieldMeaning
source_walletManaged wallet that signed and paid for the split.
source_balance_lamportsSource SOL balance before the split transaction.
fee_reserve_lamportsEffective reserve after adding requested reserve, Sender tip, and priority fee reserve.
spendable_lamportsBalance available after the effective reserve.
transfer_total_lamportsAmount selected for distribution after applying total_percent.
transfer_total_solHuman-readable SOL version of transfer_total_lamports.
transfersPer-destination transfer list.
transfers.walletDestination wallet.
transfers.lamportsLamports sent to that destination.
transfers.solHuman-readable SOL string for that destination.
transfers.modefixed, percent, or equal.
signatureSubmitted Solana transaction signature.
confirmedtrue when confirmation polling observed the transaction.
confirmation_statusRPC status such as processed, confirmed, or finalized; null when confirm: false.

Common Errors

HTTPDetailMeaning
400destinations must contain between 1 and 5 walletsEmpty split or too many destinations.
400each destination must use either percent or sol, not bothA destination supplied both allocation modes.
400destination cannot be the source walletSplit destination matches the source wallet.
400destination wallets must be uniqueDuplicate destination wallet.
400source balance is too low after fee reserveSource cannot cover the effective reserve.
400total_percent must be greater than 0 and at most 100Invalid selected percentage.
400destination percentages cannot exceed 100Percent destinations exceed the selected transfer total.
400destination amounts exceed selected transfer totalFixed SOL plus percent allocations exceed the selected total.
400destination split does not consume selected transfer totalNo equal destination exists to receive the remainder.
400each destination must receive at least one lamportAllocation rounded a destination to zero.
502Sender or RPC detailUpstream RPC, Sender, or confirmation failed.