With this project you can create an executable DCA financial strategy in ICP (Internet Computer Protocol) ecosystem.
- Currently supports only direct canister interactions without front-end
- Token for sell - ICP
- Token to buy - ckBTC
Canister type | Canister id | Stage |
---|---|---|
DCA backend | up2ak-nqaaa-aaaap-qccia-cai | Mainnet |
This call make future transfer from your wallet possible without any additional actions
dfx canister call ryjl3-tyaaa-aaaaa-aaaba-cai icrc2_approve '(record { amount = 40_000; spender = record{owner = principal "up2ak-nqaaa-aaaap-qccia-cai";} })' --ic
CLI result
(variant { Ok = 12_141_598 : nat })
beneficiary change this valuse to your principal id who will receive swap result
tokenToSell ryjl3-tyaaa-aaaaa-aaaba-cai - its ICP Canister ID
tokenToBuy mxzaz-hqaaa-aaaar-qaada-cai - its ckBTC Canister ID
frequency - one of (Daily, Weekly, Monthly)
CLI command to create DCA strategy:
dfx canister call up2ak-nqaaa-aaaap-qccia-cai openPosition '(record { tokenToSell = principal "ryjl3-tyaaa-aaaaa-aaaba-cai"; tokenToBuy = principal "mxzaz-hqaaa-aaaar-qaada-cai"; beneficiary = principal "hfugy-ahqdz-5sbki-vky4l-xceci-3se5z-2cb7k-jxjuq-qidax-gd53f-nqe"; amountToSell = 30_000; frequency = variant {Daily} })' --ic
CLI result
(variant { ok = 0 : nat })
Right after creation, your position will be executed for the first time (usually it takes around 3 minutes). The date of the second purchase depends on the frequency field from the Position
bash scripts/deploy_local.sh
1. dfx deploy dca_backend
dfx canister call ryjl3-tyaaa-aaaaa-aaaba-cai icrc2_approve '(record { amount = 40_000; spender = record{owner = principal "up2ak-nqaaa-aaaap-qccia-cai";} })'
Change the hfugy-ahqdz-5sbki-vky4l-xceci-3se5z-2cb7k-jxjuq-qidax-gd53f-nqe to your principal id who will receive swap result
dfx canister call dca_backend openPosition '(record { tokenToSell = principal "ryjl3-tyaaa-aaaaa-aaaba-cai"; tokenToBuy = principal "mxzaz-hqaaa-aaaar-qaada-cai"; beneficiary = principal "hfugy-ahqdz-5sbki-vky4l-xceci-3se5z-2cb7k-jxjuq-qidax-gd53f-nqe"; amountToSell = 30_000; frequency = variant {Daily} })'
This project is in the beta testing phase. We are actively working on adding new features and improving existing ones. Please be cautious as the software may contain bugs, and its stability is not guaranteed.
By using this project, you agree to do so at your own risk. The authors of the project are not responsible for any potential consequences of using this software.