Swapping Assets
Last updated
Last updated
Hinkal Swaps are allowing users to swap supported ERC-20 tokens discreetly. To achieve this functionality, Hinkal uses relayers and APIs from Odos, 1inch and Uniswap.
First, the user selects ‘Swap From’ and ‘Swap to’ tokens, just like they would in any DEX.
Hinkal then fetches rates from Odos, 1inch and Uniswap, and calculates the best rate offered between them. Users can see how much they save.
Users still have the option to change the provider manually to their preferred one.
Costs Breakdown
After the swap rate has been calculated and the best one is selected, Hinkal calculates fees.
Hinkal uses gas stations to accurately predict the gas needed to compensate the relayer for gas spent before the transaction is submitted. Press 'ESTIMATE' to get an accurate estimate of the gas costs at the exact point in time.
You can also change slippage tolerance manually (by pressing the gear icon).
Last is the Hinkal commission, currently set to 3bps, making Hinkal the lowest-cost zk solution enabling discreet transactions in the market.
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.
Since the protocol implements UTXO based model of commitments and nullifiers, the swapped amount should be known at the time of zk-proof generation. At the time of the swap transaction submission, it is unknown how many other swap transactions will be submitted in the current block.
This factor generates unpredictable slippage from the viewpoint of the user and relayer. In order to mitigate the uncertainty factor, the slippage risk is shifted to the relayer. In the low-probability case that the relayer can’t cover slippage costs, the transaction might be reverted.
For a detailed overview of how Hinkal swaps work, head over to Swaps. For a detailed overview of Hinkal's fee structure, check out Costs Breakdown.