Forums  > Pricing & Modelling  > Gas cost of Smart Contract  
     
Page 1 of 1
Display using:  

nikol


Total Posts: 1483
Joined: Jun 2005
 
Posted: 2022-04-28 21:08
How to estimate gas cost of smart contract such as derivative?

Suppose it is reversal perpetual. And lets it be like the one by MCDEX AMM
https://github.com/mcdexio/mai-protocol-v3

- trade at margin / collateral
- bids/asks are calculated from demand/supply and account some risk profile measured upon the current book

If I sell option and use B-S to price it, why do I have to calculate exponentas and logs at gas cost?

I need very high level idea only to make optimal contract design.

... What is a man
If his chief good and market of his time
Be but to sleep and feed? (c)

silverside


Total Posts: 1458
Joined: Jun 2004
 
Posted: 2022-05-11 09:28
i know very little about commodities (even less about "smart contracts")

however, following last years negative oil price spike,

I think a normal (rather than log-normal) model for prices makes more sense. So Bachelier rather than B/S.


pj


Total Posts: 3669
Joined: Jun 2004
 
Posted: 2022-05-11 09:55
.

The older I grow, the more I distrust the familiar doctrine that age brings wisdom Henry L. Mencken

nikol


Total Posts: 1483
Joined: Jun 2005
 
Posted: 2022-05-11 12:36
@silverside

It was not about option price... But about this: EVM "spends" mining resource to calculate B/S (or whatever) price. The calculator-program can be represented as low level assembly code. So my question is how to estimate that cost.

... What is a man
If his chief good and market of his time
Be but to sleep and feed? (c)

jslade


Total Posts: 1250
Joined: Feb 2007
 
Posted: 2022-05-11 13:03
You have to predict network congestion. I guess you can also hedge with this depending on your application: https://gastoken.io/

"Learning, n. The kind of ignorance distinguishing the studious."

silverside


Total Posts: 1458
Joined: Jun 2004
 
Posted: 2022-05-11 13:13
ok ... computational cost rather than gas (petrol) cost ... clearly i have a lot to learn.

nikol


Total Posts: 1483
Joined: Jun 2005
 
Posted: 2022-05-11 15:13
@jslade

Thank you very much ! Exactly what I was looking for.

... What is a man
If his chief good and market of his time
Be but to sleep and feed? (c)

among1


Total Posts: 18
Joined: Apr 2022
 
Posted: 2022-11-09 07:04
Great article, I think I have the same opinion as you. I hope you will have many more good articles.
fall guys
Previous Thread :: Next Thread 
Page 1 of 1