opensea-js icon indicating copy to clipboard operation
opensea-js copied to clipboard

`fulfillOrder` using a huge amount of gas

Open rtunazzz opened this issue 5 years ago • 3 comments

Config

Using:

  • web3 1.6.0
  • opensea-js 1.2.0

Issue

I am retrieving a sell order on OS by

const sellOrder = await SEAPORT.api.getOrder({
  side: OrderSide.Sell,
  asset_contract_address: tokenAddress,
  token_id: tokenId,
});

and trying to fulfill it via

const transactionHash = await SEAPORT.fulfillOrder({
  order: sellOrder,
  accountAddress: account,
});

For some reason though, the amount of gas it's trying to use is extraordinarily high, see below image (current gas price at the time of testing was 111475961014 wei so 111475961014 * 14995838 = 1671675452260259800 wei, converted to ETH is about 1.67 ETH just for gas

I tried estimating gas via the estimateGas and getCurrentGasPrice methods and both return reasonable values.

Am I doing something wrong or any idea what might be going on? Would this rather be an issue with the provider I am using?

rtunazzz avatar Oct 06 '21 09:10 rtunazzz

I am also trying to use fulfillOrder method with some questions about gas. I can get the sell order instance and buy NFT by using fulfillOrder() method of seaport instance. But I am wondering if I can set the custom gas_price to sign the transaction just in case that I want to increase the gas price for higher mining priority.

I pass the tokenId, tokenAddress and owner address into as arguments to the .getOrder method to get the order instance. Then use fulfillOder() method to buy that token. But I realize that I am not able to manipulate the gas price section.

The reason why I want to do this is that in order to buy a certain popular token NFT as soon as it gets ready on sale. especially sometimes the valuable (popular) NFT buying transaction could be difficult to sign through using average gas price, so I would like to make the gas_price higher for certain NFT items. Do you think it will be possible? It will be very appreciated if anyone can let me know how to make this approach.

happyeric77 avatar Oct 13 '21 15:10 happyeric77

I am also trying to use fulfillOrder method with some questions about gas. I can get the sell order instance and buy NFT by using fulfillOrder() method of seaport instance. But I am wondering if I can set the custom gas_price to sign the transaction just in case that I want to increase the gas price for higher mining priority.

I pass the tokenId, tokenAddress and owner address into as arguments to the .getOrder method to get the order instance. Then use fulfillOder() method to buy that token. But I realize that I am not able to manipulate the gas price section.

The reason why I want to do this is that in order to buy a certain popular token NFT as soon as it gets ready on sale. especially sometimes the valuable (popular) NFT buying transaction could be difficult to sign through using average gas price, so I would like to make the gas_price higher for certain NFT items. Do you think it will be possible? It will be very appreciated if anyone can let me know how to make this approach.

I was researching the same thing and it's possible but unfortunately not directly via OpenSea's API.


Regarding my issue in case someone has the same problem - it was caused by my program using the wrong wallet (with insufficient funds) so that's why the gas prices were so outrageous.. My mistake.

rtunazzz avatar Oct 22 '21 06:10 rtunazzz

did u find a way to set the gas fee or limit the gas fee on fulfillorder? or at last check what the gas fee will be for a fulfillorder ?

asafd11 avatar Dec 16 '21 19:12 asafd11