fixed bancor sell quotes

This commit is contained in:
Noah Khamliche 2022-06-02 21:57:13 -04:00 committed by Noah Khamliche
parent fd69a0c273
commit 83da7caab4
6 changed files with 28 additions and 3 deletions

View File

@ -1,4 +1,13 @@
[ [
{
"version": "0.35.0",
"changes": [
{
"note": "Adds support for BancorV3 to EthereumBridgeAdapter",
"pr": 492
}
]
},
{ {
"version": "0.34.0", "version": "0.34.0",
"changes": [ "changes": [

View File

@ -13,6 +13,10 @@
{ {
"note": "Add MeshSwap on Polygon", "note": "Add MeshSwap on Polygon",
"pr": 491 "pr": 491
},
{
"note": "Added support for BancorV3 on ethereum mainnet",
"pr": 492
} }
] ]
}, },

View File

@ -26,11 +26,12 @@ import "./interfaces/IBancorV3.sol";
contract BancorV3Sampler contract BancorV3Sampler
{ {
/// @dev Gas limit for BancorV3 calls. /// @dev Gas limit for BancorV3 calls.
uint256 constant private BancorV3_CALL_GAS = 150e3; // 150k uint256 constant private BancorV3_CALL_GAS = 1500e3; // 150k
address constant public ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address constant public ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
/// @dev Sample sell quotes from BancorV3. /// @dev Sample sell quotes from BancorV3.
/// @param weth The WETH contract address
/// @param router Router to look up tokens and amounts /// @param router Router to look up tokens and amounts
/// @param path Token route. Should be takerToken -> makerToken /// @param path Token route. Should be takerToken -> makerToken
/// @param takerTokenAmounts Taker token sell amount for each sample. /// @param takerTokenAmounts Taker token sell amount for each sample.
@ -74,6 +75,7 @@ contract BancorV3Sampler
} }
/// @dev Sample buy quotes from BancorV3. /// @dev Sample buy quotes from BancorV3.
/// @param weth The WETH contract address
/// @param router Router to look up tokens and amounts /// @param router Router to look up tokens and amounts
/// @param path Token route. Should be takerToken -> makerToken. /// @param path Token route. Should be takerToken -> makerToken.
/// @param makerTokenAmounts Maker token buy amount for each sample. /// @param makerTokenAmounts Maker token buy amount for each sample.

View File

@ -209,7 +209,7 @@ export class MarketOperationUtils {
gasAfter, gasAfter,
], ],
] = await Promise.all([samplerPromise]); ] = await Promise.all([samplerPromise]);
console.log(dexQuotes);
// Log the gas metrics // Log the gas metrics
_opts.samplerMetrics?.logGasDetails({ gasBefore, gasAfter }); _opts.samplerMetrics?.logGasDetails({ gasBefore, gasAfter });
_opts.samplerMetrics?.logBlockNumber(blockNumber); _opts.samplerMetrics?.logBlockNumber(blockNumber);

View File

@ -722,7 +722,7 @@ export class SamplerOperations {
source: ERC20BridgeSource.BancorV3, source: ERC20BridgeSource.BancorV3,
fillData: { networkAddress, path}, fillData: { networkAddress, path},
contract: this._samplerContract, contract: this._samplerContract,
function: this._samplerContract.sampleBuysFromBancorV3, function: this._samplerContract.sampleSellsFromBancorV3,
params: [MAINNET_TOKENS.WETH, networkInfoAddress, path, takerFillAmounts], params: [MAINNET_TOKENS.WETH, networkInfoAddress, path, takerFillAmounts],
}); });
} }

View File

@ -1,4 +1,14 @@
[ [
{
"version": "11.14.0",
"changes": [
{
"note": "Adds Support for BancorV3 on Ethereum",
"pr": 492
}
],
},
{ {
"version": "11.13.0", "version": "11.13.0",
"changes": [ "changes": [