Hi guys. I am new to Algorand development and learning to create an AMM protocol using pyteal.
I found this project on github call AlgoSwap. Unfortunately, it is a dead project so I have to ask my question here.
After successfully deploying this AMM application to my Sandbox private network, I was trying to do Add Liquidity for Token 1 and Token 2 flow and had successfully done step 4, sending Token 1 and Token 2 from pooler account to escrow account. But at step 6, sending Liquidity Token from escrow account to pooler account also called refund transaction, when I asks Wallet to sign an atomic transaction group consisting of 3 transactions , it gives me this error: Couldn't sign tx with kmd: key does not exist in this wallet
. Here is the scripts:
export ALGORAND_DATA=~/data
export ESCROW_ADDRESS="AQJHY4PQQJ6PFTQUBLTRKU3343FYNTHET4X7G7XPU2LLV3GXKWEVO4HIAY"
export ESCROW_LOGICSIG="BiAHBgEEA6sBqgECMgQjEkAAejIEJRJAAEAyBCQSQAABADMAECISMwAYIQQSEDMBECISEDMBGCEFEhAxFiEGEjEWJRIREDEQJBIQMQkyAxIQMRUyAxIQQgA2MwAQIhIzABghBBIQMwEQIhIQMwEYIQUSEDEWIQYSEDEQJBIQMQkyAxIQMRUyAxIQQgADIyMSQw=="
export MANAGER_INDEX="170"
export VALIDATOR_INDEX="171"
export TOKEN1_INDEX="172"
export TOKEN2_INDEX="173"
export LIQUIDITY_TOKEN_INDEX="174"
export TEST_ACCOUNT_ADDRESS="AMPVQWZ7UEEXLOMCVHA64CCCX5ULW6ISDDQ4IZFKBO5GPM3I5BLXCMV4FU"
goal app call --app-id ${VALIDATOR_INDEX} --app-arg "str:r" --from ${TEST_ACCOUNT_ADDRESS} --app-account ${ESCROW_ADDRESS} --out=txn1.tx
goal app call --app-id ${MANAGER_INDEX} --app-arg "str:r" --from ${TEST_ACCOUNT_ADDRESS} --app-account ${ESCROW_ADDRESS} --out=txn2.tx
goal asset send -a 4667013917 --assetid ${LIQUIDITY_TOKEN_INDEX} -f ${ESCROW_ADDRESS} -t ${TEST_ACCOUNT_ADDRESS} --out=txn3.tx
cat txn1.tx txn2.tx txn3.tx > combinedtxns.tx
goal clerk group -i combinedtxns.tx -o groupedtxns.tx
goal clerk split -i groupedtxns.tx -o split.tx
goal clerk sign -i split-0.tx -o signout-0.tx
goal clerk sign -i split-1.tx -o signout-1.tx
goal clerk sign -i split-2.tx -o signout-2.tx
cat signout-0.tx signout-1.tx signout-2.tx > signout.tx
goal clerk dryrun -t signout.tx --dryrun-dump --dryrun-dump-format json -o withdraw-liq-dr.json
My understanding of this is that I cannot sign the 3rd transaction because it sends asset from Escrow account, not pooler account and I only have private key of pooler.
So my question is how can I do this refund transactions group properly? Thanks!