You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[ ] Purchase your HyperCore Spot engaging in the [auction](https://github.com/LayerZero-Labs/devtools/blob/main/examples/oft-hyperliquid/HYPERLIQUID.README.md#step-16-purchase-the-ticker)
37
+
-[ ] Purchase your HyperCore Spot engaging in the [auction](https://github.com/LayerZero-Labs/devtools/blob/main/examples/oft-hyperliquid/HYPERLIQUID.README.md#step-0-purchase-the-ticker-prerequisite)
38
38
39
39
## Step 2 : Deploy the CoreSpot
40
40
@@ -54,7 +54,7 @@ Block switching is not present in the default oft deploy script.
-[ ] Follow the [guide](https://github.com/LayerZero-Labs/devtools/blob/main/examples/oft-hyperliquid/HYPERLIQUID.README.md#step-0-purchase-the-ticker)
57
+
-[ ] Follow the [guide](https://github.com/LayerZero-Labs/devtools/blob/main/examples/oft-hyperliquid/HYPERLIQUID.README.md#step-0-purchase-the-ticker-prerequisite)
58
58
-[ ] Core spot deployer needs OFT address and deployed transaction hash
59
59
60
60
### Step 2.2 : Enable freeze privilege (Optional)
@@ -64,7 +64,7 @@ Block switching is not present in the default oft deploy script.
-[ ] Follow the [guide](https://github.com/LayerZero-Labs/devtools/blob/main/examples/oft-hyperliquid/HYPERLIQUID.README.md#step-16-enablefreezeprivilege-optional)
67
+
-[ ] Follow the [guide](https://github.com/LayerZero-Labs/devtools/blob/main/examples/oft-hyperliquid/HYPERLIQUID.README.md#step-18-enablefreezeprivilege-optional)
68
68
-[ ]**MUST be done before genesis** if you want freeze capability
69
69
-[ ] Enables post-launch user freeze/unfreeze operations
70
70
-[ ] Once set, can only be revoked (irreversible)
@@ -76,7 +76,7 @@ Block switching is not present in the default oft deploy script.
76
76
| Set User Genesis | CoreSpot Deployer |`npx @layerzerolabs/hyperliquid-composer`| HyperCore |
-[ ] Follow the [guide](https://github.com/LayerZero-Labs/devtools/blob/main/examples/oft-hyperliquid/HYPERLIQUID.README.md#step-46-createspotdeployment)
104
+
-[ ] Follow the [guide](https://github.com/LayerZero-Labs/devtools/blob/main/examples/oft-hyperliquid/HYPERLIQUID.README.md#step-58-createspotdeployment)
105
105
- Step MUST be run even though we set `noHyperliquidity=true` in genesis
106
106
- This can be run even after deployment and linking
107
107
@@ -112,7 +112,7 @@ Block switching is not present in the default oft deploy script.
-[ ] Follow the [guide](https://github.com/LayerZero-Labs/devtools/blob/main/examples/oft-hyperliquid/HYPERLIQUID.README.md#step-67-setdeployertradingfeeshare-optional)
128
+
-[ ] Follow the [guide](https://github.com/LayerZero-Labs/devtools/blob/main/examples/oft-hyperliquid/HYPERLIQUID.README.md#step-68-setdeployertradingfeeshare-optional)
129
129
-[ ] Trading fee share is usually 100% (default value) - this allocates the trading fees to the token deployer instead of burning it.
130
130
-[ ] Do not lose or burn your deployer address as it collects tokens.
131
131
-[ ] Step can be re-run as long as the new fee% is lower than the current one.
132
-
-[ ]**Important**: If you plan to enable quote token capability (Step 2.8), read the [Permissionless Spot Quote Assets](https://hyperliquid.gitbook.io/hyperliquid-docs/hypercore/permissionless-spot-quote-assets) documentation before setting this value as it requires a specific trading fee share.
132
+
-[ ]**Important**: If you plan to enable quote token capability (Step 2.8), read the [Permissionless Spot Quote Assets](https://hyperliquid.gitbook.io/hyperliquid-docs/hypercore/permissionless-spot-quote-assets) documentation before setting this value as it requires a specific trading fee share
133
133
- Even though the default value is 100%, it is recommended that you set it
134
134
- This can be run even after deployment and linking
135
135
@@ -142,7 +142,7 @@ Block switching is not present in the default oft deploy script.
142
142
143
143
-[ ]**Review requirements first**: Read [Permissionless Spot Quote Assets](https://hyperliquid.gitbook.io/hyperliquid-docs/hypercore/permissionless-spot-quote-assets) for all requirements
144
144
-[ ] Requires specific trading fee share value (see Step 2.7 above)
145
-
-[ ] Follow the [guide](https://github.com/LayerZero-Labs/devtools/blob/main/examples/oft-hyperliquid/HYPERLIQUID.README.md#step-657-enablequotetoken-optional)
145
+
-[ ] Follow the [guide](https://github.com/LayerZero-Labs/devtools/blob/main/examples/oft-hyperliquid/HYPERLIQUID.README.md#step-78-enablequotetoken-optional)
146
146
-[ ] Enables the token to be used as a quote asset for trading pairs (e.g., OTHER_TOKEN/YOUR_TOKEN)
147
147
-[ ] Can be executed after trading fee share is set
148
148
-[ ] This can be run even after deployment and linking are complete
Copy file name to clipboardExpand all lines: examples/oft-hyperliquid/HYPERLIQUID.README.md
+21-19Lines changed: 21 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -364,15 +364,17 @@ The current architecture has certain error handling AND checks (because hyperliq
364
364
365
365
#### Transfer exceeding u64.max
366
366
367
-
HyperCore's spot send only allows for a maximum of `u64` tokens to be transferred across. This means (in the unlikely event) that the user sends across greater than `u64`the difference would be returned the the `receiver` address on `HyperEVM`.
367
+
HyperCore's spot send only allows for a maximum of `u64` tokens to be transferred across. This means (in the unlikely event) that the user sends across greater than `u64`we revert since the bridge can not send that amount.
368
368
369
-
#### Transfer exceeding HyperCore Bridge Capactiy
369
+
#### Transfer exceeding HyperCore Bridge Capacity
370
370
371
-
HyperCore's core spots support a maximum of `u64` tokens on the core spot, and this is scaled by the decimal difference between the core spot and the evm spot. It is thus possible that the asset bridge on hypercore has been consumed to the point where the entire transfer can't be sent over. In this event we split the `amount` capping it by `amount * 10.pow(ERC20.decimals() - HyperCore.decimals())` which is the maximum possible core spot tokens that can be consumed at the bridge at any given instant and compute the difference between the computed max core amount converted to evm amount (unscaling) and removing that from the incoming evm amount. We now have `dust` which is the difference between the two and return this to the `receiver` address.
371
+
HyperCore's Core Spots support a maximum of `u64` tokens on the Core Spot, and this is scaled by the decimal difference between the Core Spot and the EVM Spot. It is thus possible that the asset bridge on HyperCore has been consumed to the point where the entire transfer can't be sent over. In this event the composer reverts with `TransferAmtExceedsAssetBridgeBalance` — this revert is caught by the try/catch in `lzCompose` and the full amount is refunded to the receiver on HyperEVM.
372
+
373
+
> Note: The composer does NOT refund dust to the receiver on HyperEVM because we do not expect any due to truncation of `sharedDecimals` in OFT transfers. If your implementation produces dust you would need to add dust refund logic to `_transferERC20ToHyperCore` and `_transferNativeToHyperCore`.
372
374
373
375
#### Malformed `composeMsg` - unable to abi.decode(composeMsg) into address
374
376
375
-
The above cases only occur in the stae when the compose payload is valid. In the event that developers write their own front end or try to interact with the composer with their own encoding and aren't careful it is possible that the message contains a `composeMsg` that can not be decoded to an `address`, as such we do not have the `receiver` address. In this event we try returning the tokens to the `sender` on HyperEVM where the sender is the `msg.sender` of the layerzero tx on the source chain.
377
+
The above cases only occur in the state when the compose payload is valid. In the event that developers write their own front end or try to interact with the composer with their own encoding and aren't careful it is possible that the message contains a `composeMsg` that can not be decoded to an `address`, as such we do not have the `receiver` address. In this event we try returning the tokens to the `sender` on HyperEVM where the sender is the `msg.sender` of the layerzero tx on the source chain.
376
378
377
379
#### Malformed `composeMsg` - unable to abi.decode(composeMsg) into address and non-evm sender
378
380
@@ -402,7 +404,7 @@ Wire the OFTs together with the standard layerzero wire command (or any other wa
Test the OFTs qith`quoteSend()` or by sending a test lzTransaction across the networks.
407
+
Test the OFTs with`quoteSend()` or by sending a test lzTransaction across the networks.
406
408
407
409
## Deploy the Core Spot
408
410
@@ -428,7 +430,7 @@ You will have to buy a ticker from the Hyperliquid UI - <https://app.hyperliquid
428
430
429
431
> ⚠️ note: Unless you buy the ticker you will not be able to deploy the Core Spot.
430
432
431
-
After this we can use the `core-spot create` command to create a new file under `./deployments/hypercore-{testnet | mainnet}` with the name of the Core Spot token index. This is not a Hyperliquid step but rather something to make the deployment process easier. It is crucial to the functioning of the token deployment after which it really is not needed.
433
+
After this we can use the `core-spot create` command to create a new file under `./deployments/hypercore-{testnet | mainnet}` with the name of the Core Spot token index. This is not a Hyperliquid step but rather something to make the deployment process easier. This file is important — the subsequent deployment steps read from it.
This is the part where you set the genesis balances for the deployer and the users. Since `HyperCore` tokens are of uint type `u64` the most tokens possible are `18446744073709551615`.
This is the step that registers the Core Spot on `HyperCore` and creates a base-quote pair. You can choose between USDC, USDT0, HYPE, or custom quote tokens.
513
515
@@ -540,7 +542,7 @@ NEXT STEP: Finalize the spot pair with:
540
542
541
543
**Note:** For additional spot pairs (beyond the first), this command participates in the spot pair deployment Dutch auction.
542
544
543
-
### Step 5/7`createSpotDeployment`
545
+
### Step 5/8`createSpotDeployment`
544
546
545
547
This step finalizes a spot deployment by setting hyperliquidity parameters. Required after `register-spot` to make the trading pair live on HyperCore.
546
548
@@ -589,15 +591,15 @@ curl -X POST "https://api.hyperliquid.xyz/info" \
This is the step where you set the trading fee share for the deployer. It can be in the range of `[0%,100%]`.
595
597
596
598
A deployer fee share <https://hyperliquid.gitbook.io/hyperliquid-docs/trading/fees> is claimed per transaction on HyperCore. Half of the base rate (50%) is allocated as the deployer fee share. The deployer can choose to forgo this fee share by setting the share to `0%`. This causes the deployer's fee share part to be burnt. If it were to be set to `100%`, the deployer would receive the full fee share part of the fee.
597
599
598
600
> ⚠️ Note: The trading fee can be reset as long as the new share is lower than the previous share.
599
601
> ⚠️ Note: This step can also be run after the core spot is deployed.
600
-
> ⚠️ **Important**: If you plan to enable quote token capability (Step 6.5/7), read the [Permissionless Spot Quote Assets](https://hyperliquid.gitbook.io/hyperliquid-docs/hypercore/permissionless-spot-quote-assets) documentation before setting this value as it requires a specific trading fee share.
602
+
> ⚠️ **Important**: If you plan to enable quote token capability (Step 7/8), read the [Permissionless Spot Quote Assets](https://hyperliquid.gitbook.io/hyperliquid-docs/hypercore/permissionless-spot-quote-assets) documentation before setting this value as it requires a specific trading fee share.
This step enables the token to be used as a quote asset for trading pairs. This allows other tokens to form trading pairs against your token (e.g., TOKEN/YOUR_TOKEN instead of only YOUR_TOKEN/USDC).
- Trading fee share must be set (see Step 6/7 above)
635
+
- Trading fee share must be set (see Step 6/8 above)
634
636
-**Testnet**: 50 HYPE staked + active BUY and SELL limit orders on your token's order book
635
637
-**Mainnet**: All requirements per [Hyperliquid's documentation](https://hyperliquid.gitbook.io/hyperliquid-docs/hypercore/permissionless-spot-quote-assets)
This step enables the token to be used as an aligned quote asset for trading pairs. Aligned quote tokens have special properties and requirements different from regular quote tokens.
646
648
@@ -708,13 +710,13 @@ This will output the calldata and a ready-to-use `cast send` command that you ca
708
710
709
711
## Deploy the Composer
710
712
711
-
While the composer could have been deployed at any point in time due to its statelessness, it is technically the final step of the deployment process. The following script automatically handles the block switching for you.
713
+
While the base composer could have been deployed at any point in time since its constructor only requires immutable values, it is technically the final step of the deployment process. Note that some extensions (e.g. `PreFundedFeeAbstraction`) have mutable state such as `maxUsersPerBlock` and `feeWithdrawalBlockNumber`. The following script automatically handles the block switching for you.
> ⚠️ Note: You would need to activate the composer's address on hypercore by transferring any amount of tokens from a wallet that has at least $1 in quote tokens. This $1 will be automatically debited from your accoutn to cover an activation fee.
719
+
> ⚠️ Note: You would need to activate the composer's address on hypercore by transferring any amount of tokens from a wallet that has at least $1 in quote tokens. This $1 will be automatically debited from your account to cover an activation fee.
0 commit comments