---
name: cdp-solana
description: Creates Solana accounts, transfers SOL and SPL tokens using tx-encode with v0 transactions. Handles faucet funding on devnet.
---

# cdp-solana

Solana account management and transfers.

## Create account

```
cdp solana accounts create name=<name>
```
Verify: `cdp solana accounts get <address>` and `cdp solana accounts by-name <name>`

## Fund (devnet)

```
cdp solana faucet address=<address> token=sol
```
Faucet tokens: sol, usdc. Faucet is rate-limited per address per 24h window. If limit hit, wait or fund from another account. Verify:
```
cdp solana token-balances get solana-devnet <address>
```

## SOL transfer

1. Encode (produces v0 transaction automatically):
   ```
   cdp util tx-encode --network solana-devnet --to <recipient> --value <lamports> --from <sender>
   ```

2. Decode and verify:
   ```
   cdp util tx-decode <base64>
   ```

3. Sign:
   ```
   cdp solana accounts sign transaction <sender> transaction=<base64>
   ```

4. Send:
   ```
   cdp solana accounts send transaction network=solana-devnet transaction=<signedTransaction>
   ```

5. Verify:
   ```
   cdp solana token-balances get solana-devnet <sender>
   ```

If `InsufficientFundsForRent` → new recipient accounts require at least 890000 lamports (0.00089 SOL) for rent-exemption. Send at least 1000000 lamports.

## SPL token transfer

```
cdp util tx-encode --network solana-devnet --to <recipient> --value <atomic_units> --from <sender> --token <mint_address>
```
Value is in atomic token units (e.g., 1000000 for 1 USDC with 6 decimals).

Then sign and send as above.

## Sign message

```
cdp solana accounts sign message <address> message="<message>"
```

## Import / Export

See `/cdp-accounts-import-export` — works the same as EVM but uses base58 keys.

## Notes

- tx-encode auto-generates v0 transactions with recent blockhash.
- Solana faucet amounts: ~0.00125 SOL — enough for a few test transfers.
- SPL token transfers require the recipient to have an associated token account (created automatically by the transfer instruction if funded).
