Skip to content

Commit

Permalink
Standardize adapter constants
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdsellers committed Oct 12, 2024
1 parent db07872 commit 5b009d9
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 5 deletions.
1 change: 1 addition & 0 deletions nautilus_trader/adapters/betfair/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
BETFAIR: Final[str] = "BETFAIR"
BETFAIR_VENUE: Final[Venue] = Venue(BETFAIR)
BETFAIR_CLIENT_ID: Final[ClientId] = ClientId(BETFAIR)

BETFAIR_PRICE_PRECISION: Final[int] = 2
BETFAIR_QUANTITY_PRECISION: Final[int] = 2
BETFAIR_BOOK_TYPE: Final[BookType] = BookType.L2_MBP
Expand Down
3 changes: 2 additions & 1 deletion nautilus_trader/adapters/binance/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
from nautilus_trader.model.identifiers import Venue


BINANCE_VENUE: Final[Venue] = Venue("BINANCE")
BINANCE: Final[str] = "BINANCE"
BINANCE_VENUE: Final[Venue] = Venue(BINANCE)

BINANCE_MIN_CALLBACK_RATE: Final[Decimal] = Decimal("0.1")
BINANCE_MAX_CALLBACK_RATE: Final[Decimal] = Decimal("10.0")
Expand Down
3 changes: 2 additions & 1 deletion nautilus_trader/adapters/bybit/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
from nautilus_trader.model.identifiers import Venue


BYBIT_VENUE: Final[Venue] = Venue("BYBIT")
BYBIT: Final[str] = "BYBIT"
BYBIT_VENUE: Final[Venue] = Venue(BYBIT)

BYBIT_ALL_PRODUCTS: Final[list[BybitProductType]] = [
BybitProductType.SPOT,
Expand Down
4 changes: 3 additions & 1 deletion nautilus_trader/adapters/dydx/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
from nautilus_trader.model.identifiers import Venue


DYDX_VENUE: Final[Venue] = Venue("DYDX")
DYDX: Final[str] = "DYDX"
DYDX_VENUE: Final[Venue] = Venue(DYDX)

FEE_SCALING: Final[int] = 1_000_000
DEFAULT_CURRENCY: Final[str] = "USDC"

Expand Down
5 changes: 4 additions & 1 deletion nautilus_trader/adapters/interactive_brokers/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@
from ibapi.tag_value import TagValue

from nautilus_trader.config import NautilusConfig
from nautilus_trader.model.identifiers import ClientId
from nautilus_trader.model.identifiers import Venue


IB_VENUE: Final[Venue] = Venue("INTERACTIVE_BROKERS")
IB: Final[str] = "INTERACTIVE_BROKERS"
IB_VENUE: Final[Venue] = Venue(IB)
IB_CLIENT_ID: Final[ClientId] = ClientId(IB)


class ContractId(int):
Expand Down
3 changes: 2 additions & 1 deletion nautilus_trader/adapters/okx/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
from nautilus_trader.model.identifiers import Venue


OKX_VENUE: Final[Venue] = Venue("OKX")
OKX: Final[str] = "OKX"
OKX_VENUE: Final[Venue] = Venue(OKX)
22 changes: 22 additions & 0 deletions nautilus_trader/adapters/tardis/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -------------------------------------------------------------------------------------------------
# Copyright (C) 2015-2024 Nautech Systems Pty Ltd. All rights reserved.
# https://nautechsystems.io
#
# Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# -------------------------------------------------------------------------------------------------

from typing import Final

from nautilus_trader.model.identifiers import ClientId


TARDIS: Final[str] = "TARDIS"
TARDIS_CLIENT_ID: Final[ClientId] = ClientId(TARDIS)

0 comments on commit 5b009d9

Please sign in to comment.