I have been looking at the Ethereum prices for gas costs (transaction fees?).
Gas tracking resources — https://etherscan.io/gastracker
I noticed that simply sending a transaction is actually decently cheap, about under $1.
What’s seems to be costly for making transactions is smart contract calls.
My assumption is that, the more operations a smart contract runs to execute its task the costlier it’s is in terms of fees.
It is said that swapping, costs about $16 per contract call.
I am assuming that this is expensive because the swap is probably made via an automated market maker like uniswap. (i.e lots of code to run)
Here is my idea.
What if I am to strip down the concept of swapping a coin in to a very simple smart contract.
By simple, I mean;
- No order books
- No market making
- Higher dimensional swaps (ability to swap any combination of assets)
- No Deposits
- No Withdraws
How the basic swap application would work. (Let’s say a PEPE/USDC swap application)
- Create a contract that only holds PEPE & USDC
- Periodically push exchange rates between PEPE/USD to contract from centralised exchange
- When users send USDC to swap contact it simply uses the stored exchange rate to send an equivalent amount of PEPE
- When users send an an amount of PEPE to the swap contract it also uses the stored exchange rate to send back a proportional amount of USDC to the sender.
- Has basic error handling (when not enough USDC or PEPE to swap, unsupported coins etc)
I am assuming that these stripped down smart contracts would cost way less since there would be less compute.
Why may this be useful.
-
Cheaper transaction costs for fee sensitive users.
-
Easier to implement
-
Lower surface of attack and hence, reduced contract risk (hacking risk)
My questions for this forum.
a) Has this minimalist approach to smart contracts been explored?
b) Can it help in solving fee issues?
c) If it can help, by how much can fees be reduced?