Skip to content

Commit

Permalink
Merge pull request #284 from bancorprotocol/283-incorrect-fee-for-sus…
Browse files Browse the repository at this point in the history
…hiswap-v2-ethereum-in-multichain_addressescsv

283 incorrect fee for sushiswap v2 ethereum in multichain addressescsv
  • Loading branch information
NIXBNT authored Jan 5, 2024
2 parents 127f3ba + f5f1e9e commit ca20646
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 7 deletions.
4 changes: 2 additions & 2 deletions fastlane_bot/data/multichain_addresses.csv
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ uniswap_v3,binance_smart_chain,uniswap_v3,FACTORY_ADDRESS,0xdB1d10011AD0Ff90774D
uniswap_v3,binance_smart_chain,uniswap_v3,ROUTER_ADDRESS,0xB971eF87ede563556b2ED4b1C0b0019111Dd85d2,NA,
uniswap_v3,coinbase_base,uniswap_v3,FACTORY_ADDRESS,0x33128a8fC17869897dcE68Ed026d694621f6FDfD,NA,1371680
uniswap_v3,coinbase_base,uniswap_v3,ROUTER_ADDRESS,0x2626664c2603336E57B271c5C0b26F421741e481,NA,
sushiswap_v2,ethereum,uniswap_v2,FACTORY_ADDRESS,0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac,0.0025,10794229
sushiswap_v2,ethereum,uniswap_v2,ROUTER_ADDRESS,0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F,0.0025,
sushiswap_v2,ethereum,uniswap_v2,FACTORY_ADDRESS,0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac,0.003,10794229
sushiswap_v2,ethereum,uniswap_v2,ROUTER_ADDRESS,0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F,0.003,
sushiswap_v2,coinbase_base,uniswap_v2,FACTORY_ADDRESS,0x71524B4f93c58fcbF659783284E38825f0622859,0.003,2631214
sushiswap_v2,coinbase_base,uniswap_v2,ROUTER_ADDRESS,0x6BDED42c6DA8FBf0d2bA55B2fa120C5e0c8D7891,0.003,
sushiswap_v2,arbitrum_one,uniswap_v2,FACTORY_ADDRESS,0xc35DADB65012eC5796536bD9864eD8773aBc74C4,0.003,70
Expand Down
48 changes: 43 additions & 5 deletions resources/NBTest/NBTest_059_TestNetworkInfoMultichain.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@
"name": "stderr",
"output_type": "stream",
"text": [
"2023-12-18 12:00:34,144 [fastlane:INFO] - \n",
"2023-12-18 12:00:34,145 [fastlane:INFO] - **********************************************\n",
"2023-12-18 12:00:34,145 [fastlane:INFO] - The logging path is set to: logs/20231218-120034\\bot.log\n",
"2023-12-18 12:00:34,146 [fastlane:INFO] - **********************************************\n",
"2023-12-18 12:00:34,146 [fastlane:INFO] - \n"
"2024-01-05 09:16:40,349 [fastlane:INFO] - \n",
"2024-01-05 09:16:40,349 [fastlane:INFO] - **********************************************\n",
"2024-01-05 09:16:40,350 [fastlane:INFO] - The logging path is set to: logs/20240105-091640\\bot.log\n",
"2024-01-05 09:16:40,351 [fastlane:INFO] - **********************************************\n",
"2024-01-05 09:16:40,351 [fastlane:INFO] - \n"
]
}
],
Expand Down Expand Up @@ -161,6 +161,44 @@
"get_router_for_ex_test = get_router_address_for_exchange(exchange_name=\"aerodrome_v2\", fork=\"solidly_v2\", df=exchange_df)\n",
"assert type(get_router_for_ex_test) == str"
]
},
{
"cell_type": "markdown",
"id": "a99b3597",
"metadata": {},
"source": [
"## Test_default_fees_uni_v2_forks"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "37bb2ea4",
"metadata": {},
"outputs": [],
"source": [
"multichain_address_path = os.path.normpath(\n",
" \"fastlane_bot/data/multichain_addresses.csv\"\n",
" )\n",
"chain_addresses_df = pd.read_csv(multichain_address_path)\n",
"\n",
"for idx, row in chain_addresses_df.iterrows():\n",
" exchange_name = row[\"exchange_name\"]\n",
" fork = row[\"fork\"]\n",
" fee = row[\"fee\"]\n",
" if exchange_name in [\"uniswap_v2\", \"sushiswap_v2\"]:\n",
" assert float(fee) == 0.003, f\"[NBTest_059_TestNetworkInfoMultichain] Wrong default set for {exchange_name}. Expected 0.003, found {fee}\"\n",
" elif exchange_name in [\"pancakeswap_v2\"]:\n",
" assert float(fee) == 0.0025, f\"[NBTest_059_TestNetworkInfoMultichain] Wrong default set for {exchange_name}. Expected 0.0025, found {fee}\" "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3901e286",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
23 changes: 23 additions & 0 deletions resources/NBTest/NBTest_059_TestNetworkInfoMultichain.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# name: python3
# ---

# +
# coding=utf-8
"""
This module contains the tests for the exchanges classes
Expand Down Expand Up @@ -47,6 +48,7 @@
plt.rcParams['figure.figsize'] = [12,6]
from fastlane_bot import __VERSION__
require("3.0", __VERSION__)
# -

# # Multichain Network Configuration Test [NBTest059]

Expand Down Expand Up @@ -91,3 +93,24 @@

get_router_for_ex_test = get_router_address_for_exchange(exchange_name="aerodrome_v2", fork="solidly_v2", df=exchange_df)
assert type(get_router_for_ex_test) == str
# -

# ## Test_default_fees_uni_v2_forks

# +
multichain_address_path = os.path.normpath(
"fastlane_bot/data/multichain_addresses.csv"
)
chain_addresses_df = pd.read_csv(multichain_address_path)

for idx, row in chain_addresses_df.iterrows():
exchange_name = row["exchange_name"]
fork = row["fork"]
fee = row["fee"]
if exchange_name in ["uniswap_v2", "sushiswap_v2"]:
assert float(fee) == 0.003, f"[NBTest_059_TestNetworkInfoMultichain] Wrong default set for {exchange_name}. Expected 0.003, found {fee}"
elif exchange_name in ["pancakeswap_v2"]:
assert float(fee) == 0.0025, f"[NBTest_059_TestNetworkInfoMultichain] Wrong default set for {exchange_name}. Expected 0.0025, found {fee}"
# -


0 comments on commit ca20646

Please sign in to comment.