How about building multi-assets transaction routing?

Perhaps Approve Txn isn’t a Major issue but Gas fee Assosciated with those Txn is certainly is which might not be worth it converting those Dust Tokens .

I think we might need to 2 things here -

  1. Guaranteed Price Execution via Permits if not Instant
  2. Auto Swapper once a user Sign

I think 1inch can sort of work like An Escrow or something .

Advantages -

  1. Less Fee + Optimization thro Batching All Txn once a day or Twice etc.
  2. Permit use 0 fee & All tokens Selected as Dust will Auto pop up in UI for signin

@RoundElephant @tradersnow @Jindouyun Lemme Know what you think of this Flow Diagram to understand my POV -

All Token will be converted to USDC & sent to Treasury
Auto Buying of 1inch is Possible to be done from Treasury & then it will be Auto Staked in Governance Staking pool .

2 Likes

I don’t think the tokens can be automatically staked for the user. I like the Idea of providing the user a receipt though.

Maybe the surplus contract could be used to do the liquidations, since it already collects other funds and sells them to USDC. To actually take the tokens from the user, permits are a good idea, but there’s a limited list it looks like.

How could these be taken from users? The surplus contract, when doing a liquidation to USDC, could check permits and take user’s tokens, for example, lets say there were users who wanted to liquidate VADER, when a liquidation happens on VADER the contract can use some of these permits every time it does a liquidation since it would only use around 20,000 gas or around $10 at 150 gwei. Getting back to the receipt, the user could claim either portions of it or altogether, like tornado cash nova. This would probably depend on how much has been liquidated so far too. This would keep the contract from holding the user’s information on how much they could claim

What are some cons of this method?
• The treasury would not make as much money since some of it is used to pay the gas to liquidate people’s tokens.
• If a user transfers some or all of this dust out before it’s liquidated, how would the system know to not liquidate a new deposit.
• users couldn’t specify which token they want, they could only be paid in the token the treasury is holding, currently USDC.
• users who lose their receipt forfeit the money as it’s locked away claimable by the receipt only.

2 Likes

Or maybe we can already put a pool by buyingback a portion of 1inch into the staking contract from which a user can claim his entitled amount .

I like his idea of using treasury for funding but before treasury it was used to buyback 1inch anyway . Maybe we can set a limit on allocation of such funding so that it doesn’t dry out but Treasury is not the only way to fund it . There are token unlocks happen each year we can use a portion of that too

Pretty simple . A user won’t be able to claim or if he removed tokens before liq. receipt will be burned . The reciept will record everything

That’s pretty good too if they want it can be converted to usdc or 1inch or may be one1inch [usdt+1inch

]
Perhaps it’s Possible to put expiry on receipt

You’re right if i can convert my dust free of cost , i don’t mind clicking few buttons here & there lol

1 Like

So, it looks like this architecture would save people money on the cost the cost of the swap. Staking in the governance contract is very expensive – it involves minting non-transferable st1INCH for each unique address. Also, I don’t even know if it is possible to mint st1INCH on someone’s behalf (may require contract changes). So, for the purpose of analysis, I’m going to change the last step you show in blue to “1INCH will be auto bought and auto sent to the user”.


Definitions:

  • ERC20_S – the token(s) they’re swapping out of
  • $1INCH – the token that they are receiving. This doesn’t have to be 1INCH, but it is important that everyone receive the same token type and 1INCH is an obvious choice.
  • y – number of unique ERC20 tokens that the user is swapping out of
  • m – the number of people batched together for a particular ERC20_S

Transaction Breakdown:

  • Approving the contract to spend ERC20_S
    • This is between ~50,000 gas
  • Transferring the ERC20_S to the swap pool
    • 30,000 gas
  • Socialized swap cost 1/m
    • Let’s just assume m is very large (best case scenario).
    • ~0 gas if m is arbitrarily large (best case)
    • ~400,000 gas if there is only one person in m, and the trade has to go through two ERC20/ETH pools (worst case)
  • Transferring $1INCH back to the user
    • ~30,000 gas
    • This would only have to happen once per user (instead of per-token like everything else)

So, even the minimum gas cost per user would be = (50,000 gas + 30,000 gas) * y + 30,000 gas ← this is a little over half the cost of a traditional swap.

At current gas costs of 160 gwei, and ETH price of ~$3200, even this best-case scenario would still cost about $50 per token type.


Let me know if you see any errors in my assumptions or math. I still like the idea, I just wanted to give some hard numbers to the transaction cost savings

2 Likes

Hey @RoundElephant . Thx for checking it

Clearing that context a bit because sending it to Each user every time for every dust conversion is far more costly than Sending it to a same pool of tokens . This pool could be 1inch special pool or staking contract .
But the main point is that it’ll not send anything to user but to the pool in batches twice a day etc. instead everytime to save gas . We can further optimize it tho .

& the Receipt generated holds all the info of how much 1inch a user can claim from that pool { Claiming from this pool is THE ONLY TIME user has to pay GAS , Imo most users won’t even claim these converted 1inch tokens because they might want to hodl 1inch }

User should not spend gas that’s why we have to use EIP-2612: permit – 712-signed approvals on each conversions which is supported by these tokens to SAVE ON GAS FEE

This was actually my main point . You don’t need to send tokens to user at all after the Dust Conversion is successfully Done . Instead you send them to a pool [ Batch send twice a day to save gas etc. other ways ] Where user himself has to claim it by spending gas or Leave it as it is in that pool to generate interest [ In future via Applying Trading Strategies on TreaSury ] on those converted 1inch tokens

Good Point . I’m taking this into consideration & it seems there are various ways to tackle this .

  1. Imposing a minimal fee on Dust conversion to cover up for gas costs When batching
  2. A bit higher spread surplus on such Trade conversion to fund gas cost
  3. Governance voted allocation from treasury to cover up gas cost of High Amount .
  4. A per day Limit on Dust conversion

/2

We can further Optimize the Sending of the 1inch Pool Batch which will get distributed to users every 6hrs by using An optional Feature for 1inch DEX users to pay for the gas fee & in return get rewarded from extra fee collected from positive spread surplus during swap or Dust Conversions

Feature will Act as a button & will get activated 10 minutes before the Batch pool is filled with 1inch tokens .

There is a variable reward to incentivize users to press that button. Whoever is first to press the button, earns the reward and sends everyone’s dust to Staking pool or special contract.

Protection Mechanism

The function will contain a protection mechanism in order to limit how quickly two Button press may happen in a row. By design, the second transaction (which receives almost no reward) should fail at a very low gas cost instead of being executed with the full gas usage.

I think using my suggestion above would work well for dust conversion, and adding in a treasury daily allocation would help limit the losses the treasury gets as your suggestions points out.

For the multi asset swap in/out, I think it would be okay for the user to do it themselves because they would be doing multiple swaps anyway.

I think this thread has become two separate things, dust conversion and multi-asset swaps, which will have to work differently from each other. @k06a you’ve been gone for a week but do you have more feedback for us?

1 Like

Dust conversion is actually some sort of Multi Assest swap In , in some way .
Follow-up points were made to justify on how to save txn fee for it efficiently bringing in 1inch as utility

2 Likes

Agree, dust conversion could be one of the user cases of multi-assets swap.
Other cases might be portfolio rebalancing or instant selling out/buying in.
Thanks so much for the discussion, love to see great minds around a community topic.