> ## Documentation Index
> Fetch the complete documentation index at: https://solana.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> This page is part of the Solana developer documentation at https://solana.com/developers/docs. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get the page as Markdown.
> Index of all pages: https://solana.com/llms.txt. Per-section indexes such as https://solana.com/developers/docs/payments/llms.txt are smaller; prefer them when working on one task.
> Coding agents: install the official Solana skill for current APIs and conventions with `npx skills add https://github.com/solana-foundation/solana-dev-skill` (also served at https://solana.com/SKILL.md).
> Code in the cookbook and task pages comes from tested example files. Prefer it over writing API calls from memory.

# SOL 전송

> 계정 간에 SOL을 전송하는 방법

<Note>
  `cargo add --dev litesvm solana-sdk@4` 및 `cargo add --dev
  solana-system-interface --features bincode` 실행이 필요합니다
</Note>

## 전체 테스트

```rust tests/transfer_test.rs
use litesvm::LiteSVM;
use solana_sdk::{
    signature::{Keypair, Signer},
    transaction::Transaction,
};
use solana_system_interface::instruction as system_instruction;

#[test]
fn test_sol_transfer() {
    let mut svm = LiteSVM::new();

    // Create accounts
    let alice = Keypair::new();
    let bob = Keypair::new();

    // Fund alice with 10 SOL
    svm.airdrop(&alice.pubkey(), 10_000_000_000).unwrap();

    // Create transfer instruction
    let transfer_ix = system_instruction::transfer(
        &alice.pubkey(),
        &bob.pubkey(),
        1_000_000_000, // 1 SOL
    );

    // Build transaction
    let tx = Transaction::new_signed_with_payer(
        &[transfer_ix],
        Some(&alice.pubkey()),
        &[&alice],
        svm.latest_blockhash(),
    );

    // Send and verify
    let result = svm.send_transaction(tx).unwrap();

    // Check balances
    assert_eq!(svm.get_balance(&bob.pubkey()).unwrap(), 1_000_000_000);
    assert!(svm.get_balance(&alice.pubkey()).unwrap() < 9_000_000_000);

    println!("Transfer successful!");
    println!("Compute units used: {}", result.compute_units_consumed);
    println!("Transaction logs:\n{}", result.pretty_logs());
}
```

## 핵심 사항

1. **계정 생성**: `Keypair::new()`를 사용하여 테스트 계정을 생성합니다
2. **자금 충전**: `airdrop()`를 사용하여 계정에 SOL을 충전합니다
3. **시스템 명령어**: SOL 전송에는 `system_instruction::transfer()`(`solana-system-interface` 제공)를 사용합니다
4. **잔액 확인**: 트랜잭션 후 잔액을 확인하여 전송이 제대로 이루어졌는지 검증합니다
5. **트랜잭션 수수료**: 트랜잭션 수수료로 인해 Alice의 잔액은 9 SOL보다 약간 적습니다
