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",
|
"note": "Offboard Cream",
|
||||||
"pr": 546
|
"pr": 546
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"note": "Change WooFi gas estimates",
|
||||||
|
"pr": 551
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -2657,15 +2657,35 @@ export const DEFAULT_GAS_SCHEDULE: Required<GasSchedule> = {
|
|||||||
[ERC20BridgeSource.WOOFi]: (fillData?: FillData) => {
|
[ERC20BridgeSource.WOOFi]: (fillData?: FillData) => {
|
||||||
const woofiFillData = fillData as WOOFiFillData;
|
const woofiFillData = fillData as WOOFiFillData;
|
||||||
const quoteTokenAddresses = [BSC_TOKENS.USDT, AVALANCHE_TOKENS.nUSDC, FANTOM_TOKENS.USDC, POLYGON_TOKENS.USDC];
|
const quoteTokenAddresses = [BSC_TOKENS.USDT, AVALANCHE_TOKENS.nUSDC, FANTOM_TOKENS.USDC, POLYGON_TOKENS.USDC];
|
||||||
|
const hasQuoteToken =
|
||||||
if (
|
|
||||||
quoteTokenAddresses.includes(woofiFillData.takerToken) ||
|
quoteTokenAddresses.includes(woofiFillData.takerToken) ||
|
||||||
quoteTokenAddresses.includes(woofiFillData.makerToken)
|
quoteTokenAddresses.includes(woofiFillData.makerToken);
|
||||||
) {
|
if (woofiFillData.chainId === ChainId.BSC) {
|
||||||
return 500e3;
|
if (hasQuoteToken) {
|
||||||
|
return 550e3;
|
||||||
} else {
|
} else {
|
||||||
return 100e4;
|
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 {
|
||||||
|
// Fantom
|
||||||
|
if (hasQuoteToken) {
|
||||||
|
return 400e3;
|
||||||
|
} else {
|
||||||
|
return 600e3;
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
//
|
//
|
||||||
// Polygon
|
// Polygon
|
||||||
|
@ -1371,8 +1371,9 @@ export class SamplerOperations {
|
|||||||
makerToken: string,
|
makerToken: string,
|
||||||
makerFillAmounts: BigNumber[],
|
makerFillAmounts: BigNumber[],
|
||||||
): SourceQuoteOperation<WOOFiFillData> {
|
): SourceQuoteOperation<WOOFiFillData> {
|
||||||
|
const chainId = this.chainId;
|
||||||
return new SamplerContractOperation({
|
return new SamplerContractOperation({
|
||||||
fillData: { poolAddress, takerToken, makerToken },
|
fillData: { poolAddress, takerToken, makerToken, chainId },
|
||||||
source: ERC20BridgeSource.WOOFi,
|
source: ERC20BridgeSource.WOOFi,
|
||||||
contract: this._samplerContract,
|
contract: this._samplerContract,
|
||||||
function: this._samplerContract.sampleSellsFromWooPP,
|
function: this._samplerContract.sampleSellsFromWooPP,
|
||||||
@ -1386,8 +1387,9 @@ export class SamplerOperations {
|
|||||||
makerToken: string,
|
makerToken: string,
|
||||||
makerFillAmounts: BigNumber[],
|
makerFillAmounts: BigNumber[],
|
||||||
): SourceQuoteOperation<WOOFiFillData> {
|
): SourceQuoteOperation<WOOFiFillData> {
|
||||||
|
const chainId = this.chainId;
|
||||||
return new SamplerContractOperation({
|
return new SamplerContractOperation({
|
||||||
fillData: { poolAddress, takerToken, makerToken },
|
fillData: { poolAddress, takerToken, makerToken, chainId },
|
||||||
source: ERC20BridgeSource.WOOFi,
|
source: ERC20BridgeSource.WOOFi,
|
||||||
contract: this._samplerContract,
|
contract: this._samplerContract,
|
||||||
function: this._samplerContract.sampleBuysFromWooPP,
|
function: this._samplerContract.sampleBuysFromWooPP,
|
||||||
|
@ -377,6 +377,8 @@ export interface WOOFiFillData extends FillData {
|
|||||||
poolAddress: string;
|
poolAddress: string;
|
||||||
takerToken: string;
|
takerToken: string;
|
||||||
makerToken: string;
|
makerToken: string;
|
||||||
|
// Only needed for gas estimation
|
||||||
|
chainId: ChainId;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface VelodromeFillData extends FillData {
|
export interface VelodromeFillData extends FillData {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user