Skip to content

Commit b385dce

Browse files
committed
[Trading] Add ProfileCopyTradingMode
Signed-off-by: Herklos <[email protected]>
1 parent 7450daf commit b385dce

File tree

12 files changed

+3011
-6
lines changed

12 files changed

+3011
-6
lines changed

Trading/Exchange/polymarket/polymarket_exchange.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ class Polymarket(exchanges.RestExchange):
4141
DESCRIPTION = ""
4242
DEFAULT_CONNECTOR_CLASS = PolymarketConnector
4343

44+
SUPPORT_FETCHING_CANCELLED_ORDERS = False
45+
4446
@classmethod
4547
def get_name(cls):
4648
return 'polymarket'
@@ -49,7 +51,7 @@ def get_additional_connector_config(self):
4951
return {
5052
ccxt_constants.CCXT_OPTIONS: {
5153
"fetchMarkets": {
52-
"types": ["option"], # only hyperliquid option markets are supported
54+
"types": ["option"], # only polymarket option markets are supported
5355
}
5456
}
5557
}

Trading/Exchange/polymarket/download.py renamed to Trading/Exchange/polymarket/script/download.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,29 @@
1818
from pathlib import Path
1919
from typing import Dict, List, Tuple, Any
2020

21-
CCXT_PATH = '../../../../ccxt'
21+
CCXT_PATH = '../../../../../ccxt'
2222
FILE_MAPPINGS: Dict[str, Dict[str, Any]] = {
2323
f'{CCXT_PATH}/python/ccxt/polymarket.py': {
24-
'destination': './ccxt/polymarket_sync.py',
24+
'destination': '../ccxt/polymarket_sync.py',
2525
'patches': [
2626
('from ccxt.abstract.polymarket import ImplicitAPI', 'from .polymarket_abstract import ImplicitAPI'),
2727
],
2828
},
2929
f'{CCXT_PATH}/python/ccxt/async_support/polymarket.py': {
30-
'destination': './ccxt/polymarket_async.py',
30+
'destination': '../ccxt/polymarket_async.py',
3131
'patches': [
3232
('from ccxt.abstract.polymarket import ImplicitAPI', 'from .polymarket_abstract import ImplicitAPI'),
3333
],
3434
},
3535
f'{CCXT_PATH}/python/ccxt/pro/polymarket.py': {
36-
'destination': './ccxt/polymarket_pro.py',
36+
'destination': '../ccxt/polymarket_pro.py',
3737
'patches': [
3838
('import ccxt.async_support', 'from .polymarket_async import polymarket'),
3939
('class polymarket(ccxt.async_support.polymarket):', 'class polymarket(polymarket):'),
4040
],
4141
},
4242
f'{CCXT_PATH}/python/ccxt/abstract/polymarket.py': {
43-
'destination': './ccxt/polymarket_abstract.py',
43+
'destination': '../ccxt/polymarket_abstract.py',
4444
'patches': [],
4545
},
4646
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .index_trading import ProfileCopyTradingMode
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"required_strategies": [],
3+
"refresh_interval": 1,
4+
"rebalance_trigger_min_percent": 5,
5+
"index_content": []
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"version": "1.2.0",
3+
"origin_package": "OctoBot-Default-Tentacles",
4+
"tentacles": ["ProfileCopyTradingMode"],
5+
"tentacles-requirements": []
6+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Drakkar-Software OctoBot
2+
# Copyright (c) Drakkar-Software, All rights reserved.
3+
#
4+
# This library is free software; you can redistribute it and/or
5+
# modify it under the terms of the GNU Lesser General Public
6+
# License as published by the Free Software Foundation; either
7+
# version 3.0 of the License, or (at your option) any later version.
8+
#
9+
# This library is distributed in the hope that it will be useful,
10+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
# Lesser General Public License for more details.
13+
#
14+
# You should have received a copy of the GNU Lesser General Public
15+
# License along with this library.
16+
import tentacles.Trading.Mode.index_trading_mode.index_trading as index_trading_mode
17+
18+
19+
class ProfileCopyTradingModeConsumer(index_trading_mode.IndexTradingModeConsumer):
20+
def __init__(self, trading_mode):
21+
super().__init__(trading_mode)
22+
23+
class ProfileCopyTradingModeProducer(index_trading_mode.IndexTradingModeProducer):
24+
def __init__(self, channel, config, trading_mode, exchange_manager):
25+
super().__init__(channel, config, trading_mode, exchange_manager)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
WIP
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Drakkar-Software OctoBot-Tentacles
2+
# Copyright (c) Drakkar-Software, All rights reserved.
3+
#
4+
# This library is free software; you can redistribute it and/or
5+
# modify it under the terms of the GNU Lesser General Public
6+
# License as published by the Free Software Foundation; either
7+
# version 3.0 of the License, or (at your option) any later version.
8+
#
9+
# This library is distributed in the hope that it will be useful,
10+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
# Lesser General Public License for more details.
13+
#
14+
# You should have received a copy of the GNU Lesser General Public
15+
# License along with this library.

0 commit comments

Comments
 (0)