WooFi Gas Estimates (#551)
* change gas estimates * changelog * remove comments * fix lerna run lint error
This commit is contained in:
parent
46a7a2e620
commit
9058839645
@ -5,6 +5,10 @@
|
||||
{
|
||||
"note": "Offboard Cream",
|
||||
"pr": 546
|
||||
},
|
||||
{
|
||||
"note": "Change WooFi gas estimates",
|
||||
"pr": 551
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -2657,14 +2657,34 @@ export const DEFAULT_GAS_SCHEDULE: Required<GasSchedule> = {
|
||||
[ERC20BridgeSource.WOOFi]: (fillData?: FillData) => {
|
||||
const woofiFillData = fillData as WOOFiFillData;
|
||||
const quoteTokenAddresses = [BSC_TOKENS.USDT, AVALANCHE_TOKENS.nUSDC, FANTOM_TOKENS.USDC, POLYGON_TOKENS.USDC];
|
||||
|
||||
if (
|
||||
const hasQuoteToken =
|
||||
quoteTokenAddresses.includes(woofiFillData.takerToken) ||
|
||||
quoteTokenAddresses.includes(woofiFillData.makerToken)
|
||||
) {
|
||||
return 500e3;
|
||||
quoteTokenAddresses.includes(woofiFillData.makerToken);
|
||||
if (woofiFillData.chainId === ChainId.BSC) {
|
||||
if (hasQuoteToken) {
|
||||
return 550e3;
|
||||
} else {
|
||||
return 100e4;
|
||||
}
|
||||
} else if (woofiFillData.chainId === ChainId.Avalanche) {
|
||||
if (hasQuoteToken) {
|
||||
return 300e3;
|
||||
} else {
|
||||
return 550e3;
|
||||
}
|
||||
} else if (woofiFillData.chainId === ChainId.Polygon) {
|
||||
if (hasQuoteToken) {
|
||||
return 500e3;
|
||||
} else {
|
||||
return 700e3;
|
||||
}
|
||||
} else {
|
||||
return 100e4;
|
||||
// Fantom
|
||||
if (hasQuoteToken) {
|
||||
return 400e3;
|
||||
} else {
|
||||
return 600e3;
|
||||
}
|
||||
}
|
||||
},
|
||||
//
|
||||
|
@ -1371,8 +1371,9 @@ export class SamplerOperations {
|
||||
makerToken: string,
|
||||
makerFillAmounts: BigNumber[],
|
||||
): SourceQuoteOperation<WOOFiFillData> {
|
||||
const chainId = this.chainId;
|
||||
return new SamplerContractOperation({
|
||||
fillData: { poolAddress, takerToken, makerToken },
|
||||
fillData: { poolAddress, takerToken, makerToken, chainId },
|
||||
source: ERC20BridgeSource.WOOFi,
|
||||
contract: this._samplerContract,
|
||||
function: this._samplerContract.sampleSellsFromWooPP,
|
||||
@ -1386,8 +1387,9 @@ export class SamplerOperations {
|
||||
makerToken: string,
|
||||
makerFillAmounts: BigNumber[],
|
||||
): SourceQuoteOperation<WOOFiFillData> {
|
||||
const chainId = this.chainId;
|
||||
return new SamplerContractOperation({
|
||||
fillData: { poolAddress, takerToken, makerToken },
|
||||
fillData: { poolAddress, takerToken, makerToken, chainId },
|
||||
source: ERC20BridgeSource.WOOFi,
|
||||
contract: this._samplerContract,
|
||||
function: this._samplerContract.sampleBuysFromWooPP,
|
||||
|
@ -377,6 +377,8 @@ export interface WOOFiFillData extends FillData {
|
||||
poolAddress: string;
|
||||
takerToken: string;
|
||||
makerToken: string;
|
||||
// Only needed for gas estimation
|
||||
chainId: ChainId;
|
||||
}
|
||||
|
||||
export interface VelodromeFillData extends FillData {
|
||||
|
Loading…
x
Reference in New Issue
Block a user