#Excessive transaction fees for contract interactions.

1 messages · Page 1 of 1 (latest)

stable patio
#

Interacting with the Soroban smart contract incurs high gas fees. Although these fees are being sponsored by a source account, building a platform that requires users to constantly interact with my smart contract still results in significant transaction costs.

Is it possible to reduce these gas fees to absolutely nothing? The standard transaction cost for interacting with functions in the Stellar SDK is only 0.0001 XLM, but when integrating with a smart contract, the gas fees are much higher, ranging from 0.01 to 0.5 XLM.

#

Excessive transaction fees for contract interactions.

gentle mulch
#

hey @stable patio can you share a specific invocation that you think is too costly?

stable patio
#

This is my testnet contract interaction for FastBuka

https://stellar.expert/explorer/testnet/contract/CDAT7YWSEGA6XRPIGLVNX5TMBP7P66B5XI3RB6TYFBEFHU2LXHZIUDTL

for the create order function that is being called by a customer there is a transactions fee of 0.5XLM ($0.16), In the situation where a customers makes 2-4 orders in a day, that’s should be a total of 2XLM($0.66). Let’s not forget that XLM is currently down. In the situation whereby XLM is is high, the rate will be more than this. This is the account interaction for a customer.

https://stellar.expert/explorer/testnet/account/GD2L6V62ZODRQ5OBV55NWAUKMQTDD5SDVJ5DCJWN7RNJT5H7KMXV36MD

For a vendor who just wants to updates order status onchain 0.015XLM ($0.05) will be charged for transactions fees.

https://stellar.expert/explorer/testnet/account/GA4IOOC6L3IBGOCYD42CMGR6N7PPFLUS3IXS3MXQELHWREPVCNNFSCUF

@gentle mulch

gentle mulch
#

For a vendor who just wants to updates order status onchain 0.015XLM ($0.05) will be charged for transactions fees.
I think there might be a zero missing? 0.015XLM should be 0.005$ in current rates

stable patio
#

In the case of this customer, for creating an order that involves transferring money into the smart contract, the fee is 0.5XLM which is $0.16

gentle mulch
#

yup yup I agree we need to get these fees lower

#

will take a deeper look at these

stable patio
# gentle mulch yup yup I agree we need to get these fees lower

Please, please do. We’re about to launch on testnet and soon after, mainnet. Issues like this will definitely drive people away from using our platform. Our goal is to create a Web3 solution that benefits users, not make it more costly than the existing Web2 solutions they already have out there.

unreal fable
#

while the fees could be somewhat lower, ultimately I don't think they would go down much in this case. the reason is that 0.5 XLM (out of ~0.52 XLM) of the fee on the bigger transactions comes from the storage rent payment. the transaction creates about 1000 bytes of new data on-chain. for comparison, creating a single classic entry costs 0.5 XLM as well (like a new offer on DEX).
it's a bit tough to tell if this rate is exactly fair, but I can say that it can't go down orders of magnitude, similar to how classic reserve fee can't really go down much. So I would suggest looking into optimizing the storage costs for the entries that you're creating. I would suggest using env.cost_estimate().resources() and env.cost_estimate().fee() to quickly evalute the projected costs for your contract (see an example here: https://github.com/stellar/rs-soroban-sdk/blob/211569aa49c8d896877dfca1f2eb4fe9071121c8/soroban-sdk/src/tests/cost_estimate.rs#L37). while the fees might go down, they can't really go to zero and thus optimizing your contract is going to be valuable for the users.

stable patio
agile spear
#

One thing to consider is the minimum ttl for an entry. Even if you only plan to use/need it for a few days/weeks, the minimum ttl (for which you pay rent upon creation of the entry) is several months.
So if you create a new unique key/value entry for each offer, each one will require several months of rent upon creation.
If you find a way to work with 1 entry per customer, and update it each time to modify/add/remove offers, you could be more efficient, rent fee wise.
Over longer time, it will even out though. And combining the offers in one entry has other effects, you'll need checks to make sure only the right data is modified etc

stable patio
stable patio
#

I was publish events, could this be the reason for the high gas fee?

agile spear
agile spear