This script helps you to interact with SQUADs multisig on Solana network
Dependencies for the project can be installed as easy as
yarn installFirst, inside of the project's directory create .env file. It's content should be similar to this template:
CONFIG_PATH = /absolute/path/to/this/repo/jup-playground/config.yaml
ANCHOR_PROVIDER_URL = https://api.mainnet-beta.solana.com
ANCHOR_WALLET = /absolute/path/to/your/key/.config/solana/id.jsonWe personally recommend you to use a provider instead of a public node. For example, QuickNode
Notice that ANCHOR_WALLET file is an absolute path to the serialized key previously generated by the solana-keygen
binary.
CONFIG_PATH points to the project's folder where next you should create a file called config.yaml, there you write
all the information about your multisig and what liquidity you would like to provide from the multisig behalf. Example
configuration for WSOL looks so:
squads_multisig:
  program_idl: /path/to/repo/squads-helper/idl/squads_multisig.json
  multisig_address: <multisig address taken from settings>
  vault_pda: <vault address taken from URL for example>
wormhole:
  coins:
    - coin: WBTC
      decimals: 8
      token_address: 3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh
  chains:
    - name: Ethereum
      alt_table: GgiDHrbL3s6yaNeXi7Kd5BhkHRq6xL2geoKXUUqEZSN5
      token_bridge_relayer: 3vxKRPwUTiEkeUVyoZ9MXFe1V71sRLbLqu1gRYaWmehQ
      token_bridge: wormDTUJ6AWPNvk59vGQbDvGJmqbDTdgWgAqcLBCgUb
      core_bridge: worm2ZoG2kUd4vFXhvjh93UUH596ayRfgQ2MgjNMTth
      alt_accounts:
        - 7oPa2PHQdZmjSPqvpZN7MQxnC7Dcf3uL4oLqknGLk2S3
        - 2yVjuQwpsvdsrywzsJJVs9Ueh4zayyo5DYJbBNc3DDpn
        - Gv1KWf8DT1jKv5pKBmGaTmVszqa56Xn8YGx2Pg7i7qAk
        - 9bFNrXNb2WTx8fMHXCheaZqkLZ3YCCaiqTftHxeintHy
        - worm2ZoG2kUd4vFXhvjh93UUH596ayRfgQ2MgjNMTth
        - wormDTUJ6AWPNvk59vGQbDvGJmqbDTdgWgAqcLBCgUb
      remaining_accounts:
        - 7oPa2PHQdZmjSPqvpZN7MQxnC7Dcf3uL4oLqknGLk2S3
        - 2yVjuQwpsvdsrywzsJJVs9Ueh4zayyo5DYJbBNc3DDpn
        - Gv1KWf8DT1jKv5pKBmGaTmVszqa56Xn8YGx2Pg7i7qAk
        - 9bFNrXNb2WTx8fMHXCheaZqkLZ3YCCaiqTftHxeintHy
        - worm2ZoG2kUd4vFXhvjh93UUH596ayRfgQ2MgjNMTth
        - wormDTUJ6AWPNvk59vGQbDvGJmqbDTdgWgAqcLBCgUb
jupiter_perps:
  program_idl: /path/to/repo/squads-helper/idl/perpetuals.json
  program: PERPHjGBqRHArX4DySjwM6UJHiR3sWAatqfdBS2qQJu
  alt_table: 4dQKV2ZFadFwG4YuUPiYNnWBvRu4xn8knHj8NkW6tCJA
  pool: 5BUwFW4nRbftYTDMbgxykoFWqWHPzahFSNAaaaJtVKsq
  perpetuals: H4ND9aYttUVLFmNypZqLjZ52FYiGvdEB45GmwNoKEjTj
  lp_token_mint:
    decimals: 6
    coin: JLP
    token_address: 27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4
  alt_accounts:
    - PERPHjGBqRHArX4DySjwM6UJHiR3sWAatqfdBS2qQJu
    - 37hJBDnntwqhGbK7L6M1bLyvccj4u55CCUiLPdYkiqBN
    - 5BUwFW4nRbftYTDMbgxykoFWqWHPzahFSNAaaaJtVKsq
    - H4ND9aYttUVLFmNypZqLjZ52FYiGvdEB45GmwNoKEjTj
    - AVzP2GeRmqGphJsMxWoqjpUifPpCret7LqWhD8NWQK49
    - 7xS2gz2bTp3fwCC7knJvUWTEU9Tycczu6VhJYKgi1wdz
    - AQCGyheWPLeo6Qp9WpYS9m3Qj479t7R636N9ey1rEjEn
    - 5Pv3gM9JrFFH883SWAhvJC9RPYmo8UNxuFtv5bMMALkm
    - G18jKKXQwBbrHeiK3C9MRXhkHsLHf7XgCSisykV46EZa
    - 4vkNeXiYEUizLdrpdPS1eC2mccyM4NUPRtERrk6ZETkk
    - FYq2BWQ1V5P1WFBqr3qB2Kb5yHVvSv7upzKodgQE5zXh
    - AFZnHPzy4mvVCffrVwhewHbFc93uTHvDSFrVH7GtfXF1
    - hUqAT1KQ7eW1i6Csp9CXYtpPfSAvi835V7wKi5fRfmC
    - 6Jp2xZUTWdDD2ZyUPRzeMdc6AFQ5K3pFgZxk2EijfjnM
    - Fgc93D641F8N2d1xLjQ4jmShuD3GE3BsCXA56KBQbF5u
    - 7UVimffxr9ow1uXYxsr4LHAcV58mLzhmwaeKvJ1pjLiE
    - 42amVS4KgzR9rA28tkVYqVXjq9Qa8dcZQMbH5EYFX6XC
    - 4cSM2e6rvbGQUFiJbqytoVMi5GgghSMr8LwVrT9VPSPo
    - Dpw1EAVrSB1ibxiDQyTAW6Zip3J4Btk2x4SgApQCeFbX
    - HT2PLQBcG5EiCcNSaMHAjSgd9F98ecpATbk4Sk5oYuM
  remaining_accounts:
    - 7xS2gz2bTp3fwCC7knJvUWTEU9Tycczu6VhJYKgi1wdz
    - AQCGyheWPLeo6Qp9WpYS9m3Qj479t7R636N9ey1rEjEn
    - 5Pv3gM9JrFFH883SWAhvJC9RPYmo8UNxuFtv5bMMALkm
    - G18jKKXQwBbrHeiK3C9MRXhkHsLHf7XgCSisykV46EZa
    - 4vkNeXiYEUizLdrpdPS1eC2mccyM4NUPRtERrk6ZETkk
    - FYq2BWQ1V5P1WFBqr3qB2Kb5yHVvSv7upzKodgQE5zXh
    - AFZnHPzy4mvVCffrVwhewHbFc93uTHvDSFrVH7GtfXF1
    - hUqAT1KQ7eW1i6Csp9CXYtpPfSAvi835V7wKi5fRfmC
    - 6Jp2xZUTWdDD2ZyUPRzeMdc6AFQ5K3pFgZxk2EijfjnM
    - Fgc93D641F8N2d1xLjQ4jmShuD3GE3BsCXA56KBQbF5u
    - 7UVimffxr9ow1uXYxsr4LHAcV58mLzhmwaeKvJ1pjLiE
    - 42amVS4KgzR9rA28tkVYqVXjq9Qa8dcZQMbH5EYFX6XC
    - 4cSM2e6rvbGQUFiJbqytoVMi5GgghSMr8LwVrT9VPSPo
    - Dpw1EAVrSB1ibxiDQyTAW6Zip3J4Btk2x4SgApQCeFbX
    - HT2PLQBcG5EiCcNSaMHAjSgd9F98ecpATbk4Sk5oYuM
  # https://solscan.io/tx/5XVom2kcuU3gvJRXeS1rGGH3D74tByEVveaRtMj2CKwkv8d2sukPWKwqdRjwfwe4RC2DMXa2yUcu32827k78T2kh
  # https://solscan.io/tx/2ZB23Mp3bFXuKgCde2TPZDh8x16m3eAfnzKAZ6zyaY6Bq9LoaguxQy6ZjYyxX98VKA1QYT3WswttD4PJG9D5wAqs
  coins:
    - coin: WSOL
      decimals: 9
      token_address: So11111111111111111111111111111111111111112
      input_accounts:
        transfer_authority: AVzP2GeRmqGphJsMxWoqjpUifPpCret7LqWhD8NWQK49
        perpetuals: H4ND9aYttUVLFmNypZqLjZ52FYiGvdEB45GmwNoKEjTj
        pool: 5BUwFW4nRbftYTDMbgxykoFWqWHPzahFSNAaaaJtVKsq
        custody: 7xS2gz2bTp3fwCC7knJvUWTEU9Tycczu6VhJYKgi1wdz
        custody_doves_price_account: FYq2BWQ1V5P1WFBqr3qB2Kb5yHVvSv7upzKodgQE5zXh
        custody_pythnet_price_account: 7UVimffxr9ow1uXYxsr4LHAcV58mLzhmwaeKvJ1pjLiE
        custody_token_account: BUvduFTd2sWFagCunBPLupG8fBTJqweLw9DuhruNFSCm
        lp_token_mint: 27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4
        token_program: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
        event_authority: 37hJBDnntwqhGbK7L6M1bLyvccj4u55CCUiLPdYkiqBN
        program: PERPHjGBqRHArX4DySjwM6UJHiR3sWAatqfdBS2qQJu
    # https://solscan.io/tx/4R4oK8wj6HfYRFXtU27mihJwbyZtkfJRDaHEtsVqoJKu6CopCoSMCbDYVSn9Mn2CzgfvTbCNWkBrpXhQNtwHUodx
    # https://solscan.io/tx/2vRwgoYhQGJCTShL15TUKWAZ8ysXFzycpbKsHB38bAcsLBSKtgAwf9p5DbhUqnD57bXcTfXG5F5VinVcxsWDUUKN
    - coin: USDC
      decimals: 6
      token_address: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
      input_accounts:
        transfer_authority: AVzP2GeRmqGphJsMxWoqjpUifPpCret7LqWhD8NWQK49
        perpetuals: H4ND9aYttUVLFmNypZqLjZ52FYiGvdEB45GmwNoKEjTj
        pool: 5BUwFW4nRbftYTDMbgxykoFWqWHPzahFSNAaaaJtVKsq
        custody: G18jKKXQwBbrHeiK3C9MRXhkHsLHf7XgCSisykV46EZa
        custody_doves_price_account: 6Jp2xZUTWdDD2ZyUPRzeMdc6AFQ5K3pFgZxk2EijfjnM
        custody_pythnet_price_account: Dpw1EAVrSB1ibxiDQyTAW6Zip3J4Btk2x4SgApQCeFbX
        custody_token_account: WzWUoCmtVv7eqAbU3BfKPU3fhLP6CXR8NCJH78UK9VS
        lp_token_mint: 27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4
        token_program: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
        event_authority: 37hJBDnntwqhGbK7L6M1bLyvccj4u55CCUiLPdYkiqBN
        program: PERPHjGBqRHArX4DySjwM6UJHiR3sWAatqfdBS2qQJu
    # https://solscan.io/tx/3mtUPcu5CsUW8pmnvknCXcS4ZA4C6ZfcwaNm6HPEGaKzuGaeksDaFW7C2qt1hwkZZEiMSxpnp9U2BXKTmbeG7byL
    # https://solscan.io/tx/2sVLz4z682SEeEX1szgiWE9H6SuwByFr2XxkxApmbejWHavUKG3ppKaDMTQ6chVJ2RRnYzdTRxWgZjVhj6nZyPX2
    - coin: WETH
      decimals: 8
      token_address: 7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs
      input_accounts:
        transfer_authority: AVzP2GeRmqGphJsMxWoqjpUifPpCret7LqWhD8NWQK49
        perpetuals: H4ND9aYttUVLFmNypZqLjZ52FYiGvdEB45GmwNoKEjTj
        pool: 5BUwFW4nRbftYTDMbgxykoFWqWHPzahFSNAaaaJtVKsq
        custody: AQCGyheWPLeo6Qp9WpYS9m3Qj479t7R636N9ey1rEjEn
        custody_doves_price_account: AFZnHPzy4mvVCffrVwhewHbFc93uTHvDSFrVH7GtfXF1
        custody_pythnet_price_account: 42amVS4KgzR9rA28tkVYqVXjq9Qa8dcZQMbH5EYFX6XC
        custody_token_account: Bgarxg65CEjN3kosjCW5Du3wEqvV3dpCGDR3a2HRQsYJ
        lp_token_mint: 27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4
        token_program: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
        event_authority: 37hJBDnntwqhGbK7L6M1bLyvccj4u55CCUiLPdYkiqBN
        program: PERPHjGBqRHArX4DySjwM6UJHiR3sWAatqfdBS2qQJu
    # https://solscan.io/tx/3hDyhhBhg5jd8pASrbzLXfaGh6zUJDNf1WhZyUWg7TySfX6QDLtMfVAtUHjyxteed26SeeC5DMbGz6PXdpPiy2vD
    # https://solscan.io/tx/51F7iD7wuXdgMDyTuj9g4Lj7W27MctLvVs3LuXWff3E93puiJrZ28poo9xNLm4H4GpHFryXQD6tFvG1nN7A1Dgv7
    - coin: USDT
      decimals: 6
      token_address: Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB
      input_accounts:
        transfer_authority: AVzP2GeRmqGphJsMxWoqjpUifPpCret7LqWhD8NWQK49
        perpetuals: H4ND9aYttUVLFmNypZqLjZ52FYiGvdEB45GmwNoKEjTj
        pool: 5BUwFW4nRbftYTDMbgxykoFWqWHPzahFSNAaaaJtVKsq
        custody: 4vkNeXiYEUizLdrpdPS1eC2mccyM4NUPRtERrk6ZETkk
        custody_doves_price_account: Fgc93D641F8N2d1xLjQ4jmShuD3GE3BsCXA56KBQbF5u
        custody_pythnet_price_account: HT2PLQBcG5EiCcNSaMHAjSgd9F98ecpATbk4Sk5oYuM
        custody_token_account: Gex24YznvguMad1mBzTQ7a64U1CJy59gvsStQmNnnwAd
        lp_token_mint: 27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4
        token_program: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
        event_authority: 37hJBDnntwqhGbK7L6M1bLyvccj4u55CCUiLPdYkiqBN
        program: PERPHjGBqRHArX4DySjwM6UJHiR3sWAatqfdBS2qQJuPlease notice that for given configuration only multisig information and paths change. In addition, if you decide to
provide
liquidity
in any other token then all you need is to add a new item inside coins array, all you need is to find an example
transaction on solscan.io and copy several fields from there into your config. You must never
modify accounts field, they are all the same for every type of liquidity. Usually everything stays the same except
custody, custody_doves_price_account, custody_pythnet_price_account, custody_token_account, funding_account
and lp_token_account
Example of how to run the script:
yarn run wormhole-ethereum --amount 123WBTC --recipient 0xABCDEF... --fee-tolerance 100Notice that --amount option is case sensitive and should be used with capital letters. --recipient is a hex address
in ethereum network who will receive these tokens. --fee-tolerance is a maximum fee tolerance for token bridge
relayer. Please note that this option is only make sence in time when we create a proposal, not executing it.
Example of how to run the script:
yarn run create-proposalGiven instructions create a new Draft proposal in Multisig. Logs will provide you with a new proposal index. Memorize it for further usage
Currently supported instructions:
- Batch Add Liquidity
Example of how to run the script:
yarn run activate-proposal --proposal-index 60This instruction will make proposal visible for members in SQUADs UI
Example of how to run the script:
yarn run simulate-proposal --proposal-index 60This instruction will make simulate the execution and print out the logs. Please notice that log can sometimes exceed 64kb and log will be truncated by the node
Example of how to run the script:
yarn run check-proposal --proposal-index 60This instruction will print out the content of the proposal. As for now it can only show AddLiquidity2 and RemoveLiquidity2 instructions for Jupiter
Example of how to run the script:
yarn run show-multisigThis instruction will print out the multisig information. transactionIndex is a number of the latest proposal
Example of how to run the script:
yarn run execute-proposal --proposal-index 60Execution is only possible if proposal has reached a threshold and has Approved status. Beware that it's highly recommended to execute the proposal through given CLI and not through the UI. At the moment of writing this manual, SQUADs UI can't execute all the transactions from the batch and only executes the first transaction from the batch
Example of how to run the script:
yarn run add-liquidity --amount 123USDC --slippage-tolerance 0.01Notice that --amount option is case sensetive and should be used with capital letters. --slippage-tolerance is a
ratio, where 1.0 is 100% and means how many tokens we're okay to loose in case if we provide a significant amount of
tokens.
Example of how to run the script:
yarn run batch-add-liquidity --amount 123USDC --slippage-tolerance 0.01 --proposal-index 60Notice that --amount option is case sensetive and should be used with capital letters. --slippage-tolerance is a
ratio, where 1.0 is 100% and means how many tokens we're okay to loose in case if we provide a significant amount of
tokens. --proposal-index is the latest proposal index for your multisig. To check this number please look at SQUADs
section
Example of how to run the script:
yarn run remove-liquidity --amount 123JLP --slippage-tolerance 0.5 --denom-out USDCNotice that --amount option is case sensetive and should be used with capital letters, in case of remove-liquidity
script it always must have JLP denom at the end. --denom-out is a denomination of a token you want to perform a
withdrawal in. --slippage-tolerance is a ratio, where 1.0 is 100% and means how many tokens we're agree to loose in
case if we provide a significant amount of tokens.