Skip to content

Commit 5c89e8c

Browse files
author
JoaoCampos89
committed
fix
1 parent c031655 commit 5c89e8c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/trade.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,12 @@ export const executeTrade = async (market: MarketData) => {
4040
}
4141
}
4242
console.log(`doing a buy a amount of ${randomBuyAmount} base token`)
43-
4443

4544

4645
if (!IS_SIMULATION) {
4746
const gasEstimator = await getGasEstimation(market.chainId);
48-
const { data, to, value, gas, gasPrice } = quote.data;
49-
const tx = await signer.sendTransaction({ data, to, value, gasLimit: gas, gasPrice, ...gasEstimator });
47+
const { data, to, value, gas, gasPrice } = quote.data.transaction;
48+
const tx = await signer.sendTransaction({ data, to, value, ...gasEstimator });
5049
console.log(`waiting buy trade to be validated onchain: `, tx)
5150
await tx.wait();
5251
console.log('buy trade validated onchain')
@@ -93,8 +92,8 @@ export const executeTrade = async (market: MarketData) => {
9392

9493
if (!IS_SIMULATION) {
9594
const gasEstimator = await getGasEstimation(market.chainId);
96-
const { data, to, value, gas, gasPrice } = quote.data;
97-
const tx = await signer.sendTransaction({ data, to, value, gasLimit: gas, gasPrice, ...gasEstimator });
95+
const { data, to, value, gas, gasPrice } = quote.data.transaction;
96+
const tx = await signer.sendTransaction({ data, to, value, ...gasEstimator });
9897
console.log(`waiting sell trade to be validated onchain:`, tx)
9998
await tx.wait();
10099
console.log('sell trade validated onchain')

0 commit comments

Comments
 (0)