All Hinkal transactions go through Relayers - Ethereum addresses that post transactions to Hinkal on user’s behalf for some incentive.
For example, when a user swaps assets, they generate zk-proof that they are eligible to swap a given amount of the first asset in return for the incoming amount of the second asset. From the viewpoint of outsiders, the swap transaction will be submitted from the relayer's public Ethereum address to Hinkal Pool smart contract.
Similarly, when a user wants to deposit, stake, unstake or withdraw funds in/from a liquidity pool, they generate zk-proof that they are eligible to perform the action to the pool. To claim rewards, the user generates zk-proof showing that they are eligible to receive a certain amount of funds. The Relayer makes the transaction on behalf of the user.
Since the protocol implements UTXO based model of commitments and nullifiers, the swapped amount (for swaps) or the amount of rewards (for staking) should be known at the time of zk-proof generation. At the time of the transaction submission, it is unknown how many other transactions will be submitted in the current block.
To fairly compensate for the costs, and tackle the risks of gas fees, slippage and smart-contract parameter changes that affect payoffs (e.g. CRV emission rate), the Unexpected Payoffs are compensated to the user using stealth addresses generated before the transaction is submitted.
Gas Fees
Hinkal uses gas stations to accurately predict the gas needed to compensate the relayer for gas spent before the transaction is submitted.
The amount received by the user is calculated as follows:
Hinkal calculates gas fees with the use of gas stations
Users have the option to change slippage tolerance (or leave at default value).
Hinkal’s variable costs are calculated based on the transaction type and token amount.
Based on those, users get an accurate estimate of the token amount they will receive once the transaction is executed