Skip to main content

Migrating from Squads multisig

This guide demostrates how to migrate from Squads multisig.

Prerequisites

Before you begin, make sure you have the following installed:
  • Bun (latest version)
  • The PublicKey of the Multisig
  • A Member of the multisig with some SOL for transaction fees

Setup

First, clone the swig-ts repository and navigate to the migrate-from-squads example:
The example already includes all necessary dependencies:
  • @sqds/multisig for Squads Multisig functionality
  • @swig-wallet/classic for Swig wallet functionality
  • @solana/web3.js for Solana interactions
  • chalk for colorful console output

Understanding the Code

The example demonstrates several key concepts:
  1. Extrating data from the Squads multisig account
  2. Creating a Swig with multiple authorities in a single transaction
  3. Updating Swig roles
Let’s break down the main components:

1. Decode the multisig account

Before swapping, we need to ensure the Swig account has the necessary token accounts:

2. Extract data needed to create a Swig

3. Create a Swig including all the members as authorities

The most critical part is properly separating and handling instructions:

Next steps

  1. Asset Transfer:
  • Transfer of assets can be done from the Squads multisig dashboard.
  • Assets should be transferred to the wallet address of the newly created Swig.

Running the Example

  1. Prepare a member keypair file of the squad mulitig. (This will also be the transaction fee payer).
  2. Get the address of the squads multisig.
  3. Run the example:
The example will:
  • Get all the members of the squads multisig
  • Include all members of the squads multisig as authorities in a newly created swig.

Production Considerations

  1. Security:
    • Securely manage keypairs and private keys
    • Implement proper error recovery mechanisms
    • Add transaction timeout handling
  2. Performance:
    • Consider using RPC endpoints with higher rate limits
    • Implement proper retry mechanisms
  3. User Experience:
    • Add progress indicators for multi-step operations