Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(BACK-1842): dex gas costs #894

Open
wants to merge 7 commits into
base: test/gas-estimation
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@paraswap/dex-lib",
"version": "4.0.23",
"version": "4.0.24-gas-estimations-adjustments.0",
"main": "build/index.js",
"types": "build/index.d.ts",
"repository": "https://github.com/paraswap/paraswap-dex-lib",
Expand Down
3 changes: 2 additions & 1 deletion src/dex/angle-staked-stable/angle-staked-stable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import { SimpleExchange } from '../simple-exchange';
import { AngleStakedStableConfig, Adapters } from './config';
import { AngleStakedStableEventPool } from './angle-staked-stable-pool';

const AngleStakedGasCost = 80000;
// https://dashboard.tenderly.co/paraswap/paraswap/simulator/51688afb-c603-48cf-aa2c-9629c65b1bf9/gas-usage
const AngleStakedGasCost = 70_000;

export class AngleStakedStable
extends SimpleExchange
Expand Down
1 change: 0 additions & 1 deletion src/dex/angle-transmuter/angle-transmuter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
ExchangePrices,
PoolPrices,
AdapterExchangeParam,
SimpleExchangeParam,
PoolLiquidity,
Logger,
NumberAsString,
Expand Down
3 changes: 2 additions & 1 deletion src/dex/balancer-v1/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export const MAX_POOL_CNT = 1000;
export const MIN_USD_LIQUIDITY_TO_FETCH = 100;
export const BALANCES_MULTICALL_POOLS_LIMIT = 200;
export const MAX_POOLS_FOR_PRICING = 5;
export const BALANCER_SWAP_GAS_COST = 120 * 1000;
// https://dashboard.tenderly.co/paraswap/paraswap/simulator/2ae61b00-ad00-41e7-bfcd-a7e4fb3534ca?trace=0.3.0.0
export const BALANCER_SWAP_GAS_COST = 150 * 1000;

export const BalancerV1Config: DexConfigMap<DexParams> = {
BalancerV1: {
Expand Down
3 changes: 2 additions & 1 deletion src/dex/bancor/bancor-gas-estimation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ describe('Bancor Gas Estimation', () => {
const BNT = Tokens[network]['BNT'];
const amount = 100000000n;

it('convert', async () => {
// https://dashboard.tenderly.co/paraswap/paraswap/simulator/bcb58187-2a53-4d7f-b0b7-f1cce81ef0c8/gas-usage
it('convert2', async () => {
await testGasEstimation(
network,
USDT,
Expand Down
4 changes: 3 additions & 1 deletion src/dex/weth/weth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,13 @@ export class Weth

if (!isWETHSwap) return null;

const gasCost = isETHAddress(srcToken.address) ? 6_500 : 9000;

return [
{
prices: amounts,
unit: this.unitPrice,
gasCost: this.poolGasCost,
gasCost,
exchange: this.dexKey,
poolAddresses: [this.address],
data: null,
Expand Down