Hamsterpocket (Pocket) is an Open Source self-managed dollar-cost-averaging protocol that lets users create and run their own saving pools (“pockets”) that will automatically execute the chosen strategies over time.
-
Convenient - Users only need to set up the desired pools and strategies once, then top up (reload) said pools with the required funds for execution anytime.
-
Trustless - Users are able to manage their own pools. Every pocket can only be paused, resumed, terminated and withdrawn at will by the pockets’ owners.
-
Flexible use cases:
• Run a TWAP strategy on-chain
• Create a simple saving pool for one or multiple assets
• Set-and-forget vaults for medium or long-term spot purchases
- hamsterpocket-backend - Backend repository
- hamsterpocket-frontend - Frontend repository/DApp
- hamsterpocket-program - Rust smart contract repository
Mainnet | Devnet |
---|---|
BW5RwMCPY85ch6efYE3Ev43ZQpJytvvjSNbJ2beC9MzV | BW5RwMCPY85ch6efYE3Ev43ZQpJytvvjSNbJ2beC9MzV |
Raydium markets API: https://api.raydium.io/v2/sdk/liquidity/mainnet.json
Create a new Hamsterpocket project with Open Source integration in just a few steps.
git clone https://github.com/CaviesLabs/hamsterpocket-program.git <project_name>
Go to the newly created directory and install the required dependencies:
cd <project_name>
yarn
Hamsterpocket supports only Yarn package manager. If you don't have it installed, please follow the official Yarn installation guide.
Please refer to the .env.example
to adjust your desired configuration. Please contact khang@cavies.xyz or dev@cavies.xyz for any inquiries.
Run the solana test validator
solana-test-validator --no-bpf-jit --reset
Run the test
$ anchor test --skip-local-validator
# pocket_registry
# ✔ [initialize_swap_program] should: deployer initializes pocket registry successfully
# ✔ [initialize_swap_program] should: deployer fails to re-initialize the pocket registry
# ✔ [update_operator] should: deployer can update operators list (453ms)
#
# pocket
# ✔ [create_pocket] should: anyone can create their pocket (477ms)
# ✔ [create_token_vault] should: pocket owner can create token vault successfully (473ms)
# ✔ [pause_pocket] should: owner should pause pocket successfully (469ms)
# ✔ [pause_pocket] should: owner should not pause pocket that was already paused
# ✔ [restart_pocket] should: owner can restart the paused pocket successfully (436ms)
# ✔ [close_pocket] should: owner can close pocket successfully (470ms)
# assets
# ✔ [deposit] should: owner can deposit assets to pocket successfully (485ms)
# ✔ [withdraw] should: owner can withdraw assets from pocket successfully (935ms)
(1) Get new program address
anchor build
solana address -k target/deploy/pocket-keypair.json
# above program will output the address of program
# replace all `BW5RwMCPY85ch6efYE3Ev43ZQpJytvvjSNbJ2beC9MzV` with your new address
(2) Deploy the program on mainnet
anchor deploy --program-name pocket --provider.cluster mainnet-beta \
--provider.wallet ~/.config/solana/id.json
Hamsterpocket is an Open Source project and we encourage everyone to help us making it better. If you are interested in contributing to the project, please feel free to do so.
If you have any questions about contributing, please refer to our twitter - we are happy to help you!
Discovered a 🐜 or have feature suggestion? Feel free to create an issue on Github.
Hamsterpocket is and always will be Open Source, released under MIT Licence.
How you can help us:
- Contribute - this is how the Core Team is supporting the project.
- Spread the word - tell your friends, colleagues, and followers about Hamsterpocket.
- Create content - write a blog post, record a video, or create a tutorial. We will be happy to share it on our social media channels.
We are growing and we are looking for talented people to join our team. If you are interested in working with us, please check our Careers page.
Feel free to submit your inquiries to dev@cavies.xyz or hello@cavies.xyz