A simple API to estimate the gas cost of common dApp Smart Contract function calls
- token:
cDAI
|cETH
|cBAT
|cUSDC
- amount: string
Optional Params
- speed:
slow
|average
|fast
- token:
cDAI
|cETH
|cBAT
|cUSDC
- amount: string
Optional Params
- speed:
slow
|average
|fast
- GET
/api/compound/mint?token={token}&amount={amount}
- GET
/api/compound/redeemUnderlying?token={token}&amount={amount}
Required Params: token
, amount
Optional Params: speed
GET https://gas-estimate-api.xyz/api/compound/mint/?token=cDAI&amount=50
# Response
{
"success": true,
"result": {
"timestamp": 1598193854974,
"estimation": 181404,
"fee": 0.015963552
}
}
Required Params: token
, amount
Optional Params: speed
GET https://gas-estimate-api.xyz/api/compound/redeemUnderlying?token=cETH&amount=1.5&speed=fast
# Response
{
"success": true,
"result": {
"timestamp": 1598193938072,
"estimation": 151910,
"fee": 0.01473527
}
}