Skip to content

Commit 75616e1

Browse files
committed
Update doc; fixed minor bugs; update bp
1 parent ca65558 commit 75616e1

8 files changed

Lines changed: 818 additions & 1126 deletions

File tree

README.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,33 @@
1212

1313
## 自动交易机器人
1414

15-
一个支持多个交易所(目前包括 EdgeX, Backpack, Paradex, Aster, Lighter, GRVT)的模块化交易机器人。该机器人实现了自动下单并在盈利时自动平仓的策略,主要目的是取得高交易量。
15+
一个支持多个交易所(目前包括 EdgeX, Backpack, Paradex, Aster, Lighter, grvt, Extended)的模块化交易机器人。该机器人实现了自动下单并在盈利时自动平仓的策略,主要目的是取得高交易量。
1616

1717
## 邀请链接 (获得返佣以及福利)
1818

19-
#### EdgeX 交易所: [https://pro.edgex.exchange/referral/QUANT](https://pro.edgex.exchange/referral/QUANT)
19+
#### EdgeX: [https://pro.edgex.exchange/referral/QUANT](https://pro.edgex.exchange/referral/QUANT)
2020

2121
永久享受 VIP 1 费率;额外 10% 手续费返佣;10% 额外奖励积分
2222

23-
#### Backpack 交易所: [https://backpack.exchange/join/quant](https://backpack.exchange/join/quant)
23+
#### Backpack: [https://backpack.exchange/join/quant](https://backpack.exchange/join/quant)
2424

2525
使用我的推荐链接获得 35% 手续费返佣
2626

27-
#### Paradex 交易所: [https://app.paradex.trade/r/quant](https://app.paradex.trade/r/quant)
27+
#### Paradex: [https://app.paradex.trade/r/quant](https://app.paradex.trade/r/quant)
2828

2929
使用我的推荐链接获得 10% 手续费返佣以及潜在未来福利
3030

31-
#### Aster 交易所: [https://www.asterdex.com/zh-CN/referral/5191B1](https://www.asterdex.com/zh-CN/referral/5191B1)
31+
#### Aster: [https://www.asterdex.com/zh-CN/referral/5191B1](https://www.asterdex.com/zh-CN/referral/5191B1)
3232

3333
使用我的推荐链接获得 30% 手续费返佣以及积分加成
3434

35-
#### GRVT 交易所: [https://grvt.io/exchange/sign-up?ref=QUANT](https://grvt.io/exchange/sign-up?ref=QUANT)
35+
#### grvt: [https://grvt.io/exchange/sign-up?ref=QUANT](https://grvt.io/exchange/sign-up?ref=QUANT)
3636

3737
获得 1.3x 全网最高的积分加成,未来的手续费返佣(官方预计 10 月中上线),以及即将开始的专属交易竞赛
3838

39+
#### Extended: [https://app.extended.exchange/join/QUANT](https://app.extended.exchange/join/QUANT)
40+
10%的即时手续费减免;积分加成(官方未公布具体加成公式,但文档里有明确说明,通过官方大使邀请能拿到比自己小号邀请自己更多的分数);参与社群的专属交易量大赛,奖池高达$70000,10月15日结束
41+
3942
## 安装
4043

4144
Python 版本要求(最佳选项是 Python 3.10 - 3.12):
@@ -259,6 +262,14 @@ BTC:
259262
python runbot.py --exchange grvt --ticker BTC --quantity 0.05 --take-profit 0.02 --max-orders 40 --wait-time 450
260263
```
261264

265+
### Extended 交易所:
266+
267+
ETH:
268+
269+
```bash
270+
python runbot.py --exchange extended --ticker ETH --quantity 0.1 --take-profit 0 --max-orders 40 --wait-time 450 --grid-step 0.1
271+
```
272+
262273
## 配置
263274

264275
### 环境变量
@@ -306,6 +317,13 @@ python runbot.py --exchange grvt --ticker BTC --quantity 0.05 --take-profit 0.02
306317
- `GRVT_PRIVATE_KEY`: 您的 GRVT 私钥
307318
- `GRVT_API_KEY`: 您的 GRVT API 密钥
308319

320+
#### Extended 配置
321+
322+
- `EXTENDED_API_KEY`: Extended API Key
323+
- `EXTENDED_STARK_KEY_PUBLIC`: 创建API后显示的 Stark 公钥
324+
- `EXTENDED_STARK_KEY_PRIVATE`: 创建API后显示的 Stark 私钥
325+
- `EXTENDED_VAULT`: 创建API后显示的 Extended Vault ID
326+
309327
**获取 LIGHTER_ACCOUNT_INDEX 的方法**
310328

311329
1. 在下面的网址最后加上你的钱包地址:
@@ -320,7 +338,7 @@ python runbot.py --exchange grvt --ticker BTC --quantity 0.05 --take-profit 0.02
320338

321339
### 命令行参数
322340

323-
- `--exchange`: 使用的交易所:'edgex'、'backpack'、'paradex'、'aster'、'lighter''grvt'(默认:edgex)
341+
- `--exchange`: 使用的交易所:'edgex'、'backpack'、'paradex'、'aster'、'lighter''grvt' 或 'extended'(默认:edgex)
324342
- `--ticker`: 标的资产符号(例如:ETH、BTC、SOL)。合约 ID 自动解析。
325343
- `--quantity`: 订单数量(默认:0.1)
326344
- `--take-profit`: 止盈百分比(例如 0.02 表示 0.02%)

README_EN.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,32 @@
88

99
## Multi-Exchange Trading Bot
1010

11-
A modular trading bot that supports multiple exchanges including EdgeX, Backpack, Paradex, Aster, Lighter, and GRVT. The bot implements an automated strategy that places orders and automatically closes them at a profit.
11+
A modular trading bot that supports multiple exchanges including EdgeX, Backpack, Paradex, Aster, Lighter, GRVT, and Extended. The bot implements an automated strategy that places orders and automatically closes them at a profit.
1212

1313
## Referral Links (Enjoy fee rebates and benefits)
1414

1515
#### EdgeX: [https://pro.edgex.exchange/referral/QUANT](https://pro.edgex.exchange/referral/QUANT)
1616

1717
Instant VIP 1 Trading Fees; 10% Fee Rebate; 10% Bonus Points
1818

19-
#### Backpack Exchange: [https://backpack.exchange/join/quant](https://backpack.exchange/join/quant)
19+
#### Backpack: [https://backpack.exchange/join/quant](https://backpack.exchange/join/quant)
2020

2121
You will get 35% fee rebates on all your trading fees
2222

23-
#### Paradex Exchange: [https://app.paradex.trade/r/quant](https://app.paradex.trade/r/quant)
23+
#### Paradex: [https://app.paradex.trade/r/quant](https://app.paradex.trade/r/quant)
2424

2525
You will get 10% taker fee discount rebates and potential future benefits
2626

27-
#### Aster Exchange: [https://www.asterdex.com/zh-CN/referral/5191B1](https://www.asterdex.com/zh-CN/referral/5191B1)
27+
#### Aster: [https://www.asterdex.com/zh-CN/referral/5191B1](https://www.asterdex.com/zh-CN/referral/5191B1)
2828

2929
You will get 30% fee rebates and points boost
3030

31-
#### GRVT Exchange: [https://grvt.io/exchange/sign-up?ref=QUANT](https://grvt.io/exchange/sign-up?ref=QUANT)
31+
#### grvt: [https://grvt.io/exchange/sign-up?ref=QUANT](https://grvt.io/exchange/sign-up?ref=QUANT)
32+
You will get 1.3x points boost; rebates (auto rebates system is expected to be launched in mid-Oct); access to private trading competition
33+
34+
#### Extended: [https://app.extended.exchange/join/QUANT](https://app.extended.exchange/join/QUANT)
35+
10% fee discount; points boost (black box, but "you will get more points from affiliate referral program than using another account to refer yourself" quoted from the official documentation from Extended); access to private trading competition
36+
3237

3338
## Installation
3439

@@ -235,6 +240,14 @@ BTC:
235240
python runbot.py --exchange grvt --ticker BTC --quantity 0.05 --take-profit 0.02 --max-orders 40 --wait-time 450
236241
```
237242

243+
### Extended Exchange:
244+
245+
ETH:
246+
247+
```bash
248+
python runbot.py --exchange extended --ticker ETH --quantity 0.1 --take-profit 0 --max-orders 40 --wait-time 450 --grid-step 0.01
249+
```
250+
238251
## Configuration
239252

240253
### Environment Variables
@@ -282,6 +295,13 @@ python runbot.py --exchange grvt --ticker BTC --quantity 0.05 --take-profit 0.02
282295
- `GRVT_PRIVATE_KEY`: Your GRVT private key
283296
- `GRVT_API_KEY`: Your GRVT API key
284297

298+
#### Extended Configuration
299+
300+
- `EXTENDED_API_KEY`: Your Extended API key
301+
- `EXTENDED_STARK_KEY_PUBLIC`: Your Stark public key
302+
- `EXTENDED_STARK_KEY_PRIVATE`: Your Stark private key
303+
- `EXTENDED_VAULT`: Your Extended Vault ID
304+
285305
**How to get LIGHTER_ACCOUNT_INDEX**:
286306

287307
1. Add your wallet address to the end of the following URL:
@@ -296,7 +316,7 @@ python runbot.py --exchange grvt --ticker BTC --quantity 0.05 --take-profit 0.02
296316

297317
### Command Line Arguments
298318

299-
- `--exchange`: Exchange to use: 'edgex', 'backpack', 'paradex', 'aster', 'lighter', or 'grvt' (default: edgex)
319+
- `--exchange`: Exchange to use: 'edgex', 'backpack', 'paradex', 'aster', 'lighter', 'grvt', or 'extended' (default: edgex)
300320
- `--ticker`: Base asset symbol (e.g., ETH, BTC, SOL). Contract ID is auto-resolved.
301321
- `--quantity`: Order quantity (default: 0.1)
302322
- `--take-profit`: Take profit percent (e.g., 0.02 means 0.02%)

env_example.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ API_KEY_PRIVATE_KEY=your_api_key_private_key_here
3434
LIGHTER_ACCOUNT_INDEX=0
3535
LIGHTER_API_KEY_INDEX=0
3636

37+
# Extended Configuration
38+
EXTENDED_API_KEY=your_extended_api_key
39+
EXTENDED_STARK_KEY_PUBLIC=your_stark_public_key
40+
EXTENDED_STARK_KEY_PRIVATE=your_stark_private_key
41+
EXTENDED_VAULT=extended_vault_id
42+
3743
# Notification (optional)
3844
# guide: https://www.feishu.cn/hc/zh-CN/articles/185289387886-%E6%B6%88%E6%81%AF%E5%8A%A9%E6%89%8B-%E6%9C%BA%E5%99%A8%E4%BA%BA
3945
LARK_TOKEN=

exchanges/backpack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from cryptography.hazmat.primitives.asymmetric import ed25519
1414
import websockets
1515
from bpx.public import Public
16-
from bpx.account import Account
16+
from .bp_client import Account
1717
from bpx.constants.enums import OrderTypeEnum, TimeInForceEnum
1818

1919
from .base import BaseExchangeClient, OrderResult, OrderInfo, query_retry

0 commit comments

Comments
 (0)