Use pooled fee in an inner transaction

Hello,
I’m creating a contract in which there’s a call that submits an inner asset transfer transaction. What I was doing before is that I was grouping that app call with a payment of 1000 algo to the escrow such that the inner tx fees were paid. I thought that I can achieve the same result pooling the fees. So I modified the params of the app call chainging the flat_fee to true and the fee to 2000 such that 1000 of that 2000 should be used in the inner transaction. And then broadcast only the app call with modified fees. But I’m getting this error
TransactionPool.Remember: transaction GCKGCK7AV3LOWO7Z6E6XKB5COAWFW2VZHSYE7IWVFPRCGFSBTQ3Q: account JHPYLVBQQMW2ZWJ37IQPB72TLD2UEYOQTXXVIA24Q3GZVF2JOTTYPYZKCQ balance 499000 below min 500000 (4 assets)
It seems like the fees are not pooled as the inner tx is using the escrow balance to broadcast the tx. How can achieve this without having a group with a payment to the escrow, if it’s possible?

I just went through the same process. You don’t need to group it with a pay txn, you just need to increase the fee used on the transaction setting e.g. after you compose the transaction object, set txn.fee = 2000 before the transaction is signed and submitted. Unfortunately it’s not very clear from the documentation.

Thanks, yes, that was my second iteration. Before I had a group [pay(fee=1000, aamt=1000), appCall(fee=1000)]. Then what I actually did was appCall(fee=2000). But this is giving me that error.

Fee pooling with inner transaction should work.
Are you doing a single inner transaction?
Can you check that the fee is set properly? (export the transaction Encoding and Decoding - Algorand Developer Portal and inspect using goal clerk inspect - do not do the conversion to base64).

You can also force the field of fee in the inner transaction to be 0, and see what happens.

1 Like

I believe prices are set automatically

Yes, by default fees are set automatically.
Setting it to 0 is a good way to ensure the application account never pays fees.
I think in @aleve99’s case it may help them debug the program too.

1 Like

Ok thanks @fabrice I will try to do that

Fixin the inner transaction fee to 0 worked for fee pooling, thanks!

If I’m right you need to fund the escrow account of the app with the minimum of 100000 for the inner tx to work?