Skip to content

Commit f1d5dcc

Browse files
committed
template: updated copy trader to include another secret bool for withdrawing
1 parent 0e10c49 commit f1d5dcc

File tree

2 files changed

+48
-35
lines changed

2 files changed

+48
-35
lines changed

templates/hl-copy-trader/README.md

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,55 +24,61 @@ Before setting up your copy trader, ensure you have:
2424

2525
### Step 2: Configure Your Copy Trader
2626

27-
1. **Trader Address to Copy** (Required)
27+
1. **Trader Address to Copy (`COPY_TRADE_ADDRESS`)** (Required)
2828

29-
- Enter the wallet address of the trader you want to copy
29+
- Enter the wallet address of the trader you want to copy.
3030
- Example: `0x1234567890abcdef...`
31-
- This address determines which trades your bot will replicate
31+
- This address determines which trades your bot will replicate.
3232

33-
2. **Withdrawal Address** (Set at later date to stop operations)
33+
2. **Withdrawal Configuration** (Use to stop operations and withdraw funds)
3434

35-
- Leave empty for normal operation
36-
- Only set this if you want to emergency withdraw all funds or are happy
37-
with the results and want to stop the copy trades
38-
- When set, the bot will:
35+
- For normal operation, leave these settings at their default values.
36+
- To initiate a withdrawal, you must configure two settings. This is useful when you want to emergency withdraw all funds or are happy with the results and want to stop copy trading.
37+
38+
**a. Withdrawal Address (`WITHDRAW_FUNDS_TO`)** (Required)
39+
- This is the destination address where your funds will be sent in an emergency or when you decide to stop trading.
40+
- You must provide a valid address here for the bot to operate.
41+
42+
**b. Enable Withdrawal (`WITHDRAW`)**
43+
- Set this to `true` to activate the withdrawal process.
44+
- When enabled, the bot will not copy any trades. Instead, upon starting, it will immediately:
3945
- Cancel all open orders
40-
- Close all positions
41-
- Transfer all USDC to this address
46+
- Close all open positions
47+
- Transfer all USDC to your specified withdrawal address
4248

4349
### Step 3: Fund Your Trading Account
4450

4551
1. After deploying your ROFL app, check the logs to find your bot's trading
46-
address
47-
2. Send USDC (Perps) to this address on Hyperliquid
48-
3. The bot will automatically detect the funds and start listening for trades
52+
address.
53+
2. Send USDC (Perps) to this address on Hyperliquid.
54+
3. The bot will automatically detect the funds and start listening for trades.
4955

5056
⚠️ **IMPORTANT: Only send USDC (Perps) on Hyperliquid!**
5157
⚠️ **Sending funds on any other chain or to the wrong account type**
5258
⚠️ **may result in PERMANENT LOSS OF FUNDS!**
5359

5460
**Important Funding Considerations:**
5561

56-
- Fund your account proportionally to the trader you're copying
62+
- Fund your account proportionally to the trader you're copying.
5763
- If your account is too small relative to the copied trader, some trades may
58-
not execute
59-
- Minimum trade size on Hyperliquid is $10
64+
not execute.
65+
- The minimum trade size on Hyperliquid is $10.
6066
- Example: If the copied trader has $100,000 and opens a $100 position (0.1%),
61-
you need at least $10,000 to copy this trade or it will be skipped
67+
you need at least $10,000 to copy this trade, otherwise it will be skipped.
6268

6369
## Risk Warning
6470

6571
**Copy trading involves substantial risk:**
6672

67-
- You can lose all deposited funds
68-
- Past performance does not guarantee future results
69-
- The copied trader's strategy may not suit your risk tolerance
70-
- Technical issues or network delays may affect trade execution
71-
- Trade at your own discretion and only risk what you can afford to lose
73+
- You can lose all deposited funds.
74+
- Past performance does not guarantee future results.
75+
- The copied trader's strategy may not suit your risk tolerance.
76+
- Technical issues or network delays may affect trade execution.
77+
- Trade at your own discretion and only risk what you can afford to lose.
7278

7379
## Troubleshooting
7480

7581
- **Bot not copying trades**: Ensure your account has sufficient funds for the
76-
minimum trade size
77-
- **Finding your bot's address**: Check the ROFL app logs after deployment
78-
- **How to withdraw**: Set the WITHDRAW_FUNDS_TO address and restart the app
82+
minimum trade size.
83+
- **Finding your bot's address**: Check the ROFL app logs after deployment.
84+
- **How to withdraw**: Set the `WITHDRAW` variable to `true`, provide your destination address in `WITHDRAW_FUNDS_TO`, and restart the app.

templates/hl-copy-trader/rofl.yaml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Hyperliquid Copy Trader
22
description: Confidential copy trading agent built for Hyperliquid. Automatically mirrors trades from a specified trader.
33
image: https://rofl.app/templates/hl-rofl-trader.png
4-
version: 1.2.6
4+
version: 1.4.2
55
repository: https://github.com/oasisprotocol/template-rofl-hl-copy-trader
66
author: Oasis Protocol Foundation <info@oasisprotocol.org>
77
license: Apache-2.0
@@ -14,17 +14,17 @@ tags:
1414
tee: tdx
1515
kind: container
1616
resources:
17-
memory: 4096
18-
cpus: 2
17+
memory: 2048
18+
cpus: 1
1919
storage:
2020
kind: disk-persistent
21-
size: 10000
21+
size: 1000
2222
artifacts:
23-
firmware: https://github.com/oasisprotocol/oasis-boot/releases/download/v0.5.0/ovmf.tdx.fd#db47100a7d6a0c1f6983be224137c3f8d7cb09b63bb1c7a5ee7829d8e994a42f
24-
kernel: https://github.com/oasisprotocol/oasis-boot/releases/download/v0.5.0/stage1.bin#23877530413a661e9187aad2eccfc9660fc4f1a864a1fbad2f6c7d43512071ca
25-
stage2: https://github.com/oasisprotocol/oasis-boot/releases/download/v0.5.0/stage2-podman.tar.bz2#631349bef06990dd6ae882812a0420f4b35f87f9fe945b274bcfb10fc08c4ea3
23+
firmware: https://github.com/oasisprotocol/oasis-boot/releases/download/v0.4.1/ovmf.tdx.fd#db47100a7d6a0c1f6983be224137c3f8d7cb09b63bb1c7a5ee7829d8e994a42f
24+
kernel: https://github.com/oasisprotocol/oasis-boot/releases/download/v0.4.1/stage1.bin#06e12cba9b2423b4dd5916f4d84bf9c043f30041ab03aa74006f46ef9c129d22
25+
stage2: https://github.com/oasisprotocol/oasis-boot/releases/download/v0.4.1/stage2-podman.tar.bz2#6f2487aa064460384309a58c858ffea9316e739331b5c36789bb2f61117869d6
2626
container:
27-
runtime: https://github.com/oasisprotocol/oasis-sdk/releases/download/rofl-containers%2Fv0.5.2/rofl-containers#3abac3e7519588c1a4e250f1bf5cbbbd58c4e4c8ee817070031b9e0e3d4e0095
27+
runtime: https://github.com/oasisprotocol/oasis-sdk/releases/download/rofl-containers%2Fv0.4.2/rofl-containers#0cbaa4c0c1b35c5ed41156868bee9f3726f52eeedc01b3060d3b2eb67d76f546
2828
compose: compose.yaml
2929
secrets:
3030
- name: COPY_TRADE_ADDRESS
@@ -37,13 +37,19 @@ secrets:
3737
title: "Withdrawal Address (Optional)"
3838
description: "If set, all funds will be withdrawn to this address upon startup."
3939
type: text
40-
required: false
40+
required: true
4141
placeholder: "0x..."
42+
- name: WITHDRAW
43+
title: "Withdraw Funds"
44+
description: "If set to true, all funds will be withdrawn to the WITHDRAW_FUNDS_TO address upon startup."
45+
type: boolean
46+
required: false
47+
placeholder: "false"
4248

4349
compose: |
4450
services:
4551
hl-copy-trader:
46-
image: docker.io/ahmedatoasis/hl-copy-trader@sha256:bab5c3602da987bcde1372438b2dd7f1692badbf0e6969dc553bc28119498588
52+
image: docker.io/ahmedatoasis/hl-copy-trader@sha256:d7cf88736cbe56193ac81ff1f9dca3d63b2eed613ec5e524ccb635782638b70a
4753
build:
4854
context: .
4955
dockerfile: Dockerfile
@@ -53,4 +59,5 @@ compose: |
5359
environment:
5460
- COPY_TRADE_ADDRESS=${COPY_TRADE_ADDRESS}
5561
- WITHDRAW_FUNDS_TO=${WITHDRAW_FUNDS_TO}
62+
- WITHDRAW=${WITHDRAW}
5663
restart: always

0 commit comments

Comments
 (0)