-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add LICENSE Remove requirements.txt Add dependencies and metadata to pyproject.toml Restructure to "src" layout per https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/
- Loading branch information
1 parent
c6cae87
commit 6b2656d
Showing
78 changed files
with
375 additions
and
385 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) [2022] [BowTiedDevil] | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,41 @@ | ||
[project] | ||
name = "degenbot" | ||
version = "0.0.1" | ||
authors = [ | ||
{ name="BowTiedDevil", email="[email protected]" }, | ||
] | ||
description = "Python classes to aid rapid development of Uniswap V2 & V3 arbitrage bots on EVM-compatible blockchains" | ||
#readme = "README.md" | ||
requires-python = ">=3.10" | ||
dependencies = [ | ||
'eth-abi>=4.2.0,<5', | ||
'eth-typing>=3.4.0,<4', | ||
'eth-utils>=2.2.1,<3', | ||
'hexbytes>=0.3.1,<1', | ||
'pytest>=7.0,<8', | ||
'scipy>=1.11.3,<1.12', | ||
'ujson>=5.8.0', | ||
'web3>=6.11.0,<7', | ||
'websockets>=11.0.3,<13.0', | ||
] | ||
license = {text = "MIT"} | ||
classifiers = [ | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
] | ||
|
||
[project.urls] | ||
"Homepage" = "https://github.com/bowtieddevil/degenbot" | ||
"Bug Tracker" = "https://github.com/BowTiedDevil/degenbot/issues" | ||
|
||
[build-system] | ||
requires = ["setuptools"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.mypy] | ||
check_untyped_defs = true | ||
|
||
[tool.ruff] | ||
line-length = 79 | ||
line-length = 100 | ||
indent-width = 4 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# ruff: noqa: F401 | ||
|
||
from . import exceptions | ||
from . import uniswap | ||
from .arbitrage import ( | ||
ArbitrageCalculationResult, | ||
FlashBorrowToLpSwap, | ||
FlashBorrowToLpSwapNew, | ||
FlashBorrowToLpSwapWithFuture, | ||
FlashBorrowToRouterSwap, | ||
UniswapLpCycle, | ||
) | ||
from .chainlink import ChainlinkPriceContract | ||
from .config import get_web3, set_web3 | ||
from .fork import AnvilFork | ||
from .functions import next_base_fee | ||
from .logging import logger | ||
from .manager import AllPools, AllTokens, Erc20TokenHelperManager | ||
from .erc20_token import Erc20Token | ||
from .transaction import UniswapTransaction | ||
from .uniswap.managers import ( | ||
UniswapV2LiquidityPoolManager, | ||
UniswapV3LiquidityPoolManager, | ||
) | ||
from .uniswap.v2_liquidity_pool import CamelotLiquidityPool, LiquidityPool | ||
from .uniswap.v2_multi_liquidity_pool import MultiLiquidityPool | ||
from .uniswap.v3_tick_lens import TickLens | ||
from .uniswap.v3_liquidity_pool import V3LiquidityPool | ||
from .uniswap.v3_dataclasses import ( | ||
UniswapV3BitmapAtWord, | ||
UniswapV3LiquidityAtTick, | ||
UniswapV3LiquidityEvent, | ||
UniswapV3PoolExternalUpdate, | ||
UniswapV3PoolSimulationResult, | ||
UniswapV3PoolState, | ||
) | ||
from .uniswap.v3_snapshot import UniswapV3LiquiditySnapshot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import dataclasses | ||
from typing import List, Tuple | ||
|
||
from ..erc20_token import Erc20Token | ||
|
||
|
||
@dataclasses.dataclass(slots=True, frozen=True) | ||
class ArbitrageCalculationResult: | ||
id: str | ||
input_token: Erc20Token | ||
profit_token: Erc20Token | ||
input_amount: int | ||
profit_amount: int | ||
swap_amounts: List | ||
|
||
|
||
@dataclasses.dataclass(slots=True, frozen=True) | ||
class UniswapPoolSwapVector: | ||
token_in: Erc20Token | ||
token_out: Erc20Token | ||
zero_for_one: bool | ||
|
||
|
||
@dataclasses.dataclass(slots=True, frozen=True) | ||
class UniswapV2PoolSwapAmounts: | ||
amounts: Tuple[int, int] | ||
|
||
|
||
@dataclasses.dataclass(slots=True, frozen=True) | ||
class UniswapV3PoolSwapAmounts: | ||
amount_specified: int | ||
zero_for_one: bool | ||
sqrt_price_limit_x96: int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...ge/flash_borrow_to_lp_swap_with_future.py → ...ge/flash_borrow_to_lp_swap_with_future.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
arbitrage/lp_swap_with_future.py → ...degenbot/arbitrage/lp_swap_with_future.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.