Wrapped SOL (wSOL) explained

Wrapped SOL is SOL inside a token account, so programs can treat it like any other token. How wrapping works and how to unwrap leftovers.

Updated

SOL is not a token in the technical sense. It is the balance of an account, counted in lamports, while every other asset lives in token accounts managed by a token program. Programs that trade or lend tokens would need separate code paths for SOL. Wrapped SOL (wSOL) avoids that: it is SOL held inside a token account, so it behaves like any other token.

How wrapping works

Wrapped SOL has its own mint, So11111111111111111111111111111111111111112, the “native mint”. A token account for it is a native account: its token balance is not a separate number but the lamports it holds above its rent deposit.

  1. Create a token account for the native mint, usually your associated token account for it.
  2. Send SOL to that account with an ordinary transfer.
  3. Call SyncNative, which updates the token balance to match the lamports.

Now the SOL can be swapped, deposited or lent through the token program like USDC or any other token.

Unwrapping

To unwrap, close the account. CloseAccount normally refuses accounts with a balance, but native accounts are the exception: closing one sends every lamport in it, the wrapped SOL and the rent deposit, to the destination as plain SOL. There is no partial unwrap; to keep some wSOL, transfer it to another wSOL account first.

Leftover wSOL accounts

Swap apps wrap and unwrap SOL for you, usually inside the same transaction. When something goes wrong, or an app leaves the account open on purpose, a wSOL account stays behind:

  • Empty: it still holds its rent deposit. Closing it returns that, like any empty token account.
  • With a balance: your wallet probably shows it as a token called Wrapped SOL. Unwrapping in the wallet closes the account and returns balance and deposit together.

Why the excess rent cannot be withdrawn separately

For ordinary token accounts, WithdrawExcessLamports returns the SOL above the rent minimum. On a native account those extra lamports are the token balance, so the program rejects the instruction with NativeNotSupported. Unwrapping does the job instead and returns everything. The UNRENT scanner therefore leaves wSOL accounts with a balance for you to unwrap in your wallet.

In short

  • Wrapped SOL is SOL inside a token account, so programs can handle it like any other token.
  • Its balance is the account’s lamports above the deposit; SyncNative keeps the two in step.
  • Closing the account unwraps it and returns the balance and the deposit as SOL.

Sources

Keep reading