Skip to content

Latest commit

 

History

History
238 lines (173 loc) · 16.7 KB

File metadata and controls

238 lines (173 loc) · 16.7 KB

Hyperliquid Composer Readme

This document is an checklist for anyone deploying to hyperevm (and hypercore).

Step 0 : Deploy your OFT

Action Performed by Actionable with Recommended for
Path 1 OFT Deployer LZ_ENABLE_EXPERIMENTAL_HYPERLIQUID_EXAMPLE=1 npx create-lz-oapp@latest HyperCore deployments
Path 2 OFT Deployer vanilla oft repo + npx @layerzerolabs/hyperliquid-composer Only HyperEVM deployments

Path 1 - With a new repo

  • Create a new hyperliquid example repo LZ_ENABLE_EXPERIMENTAL_HYPERLIQUID_EXAMPLE=1 npx create-lz-oapp@latest
    • This comes with the composer and composer deploy script.
    • Deploy scripts perform block switching operations.
    • Composer can be deployed after the core spot is deployed (Step 4). It will not work until the two are linked.
  • Composer has default error handling mentioned in the docs

Path 2 - Existing repo with OFT

Block switching is not present in the default oft deploy script.

  • Switch to big block before deploying the oft - npx @layerzerolabs/hyperliquid-composer set-block --size big --network <testnet/mainnet> --log-level verbose --private-key $PRIVATE_KEY
  • Deploy the oft
  • Switch to small block after deploying the oft - npx @layerzerolabs/hyperliquid-composer set-block --size small --network <testnet/mainnet> --log-level verbose --private-key $PRIVATE_KEY

⚠️ If you are only doing HyperEVM you are done. Following is only for HyperCore deployments.

Step 1 : (optional) Purchase your HyperCore Spot

Action Performed by Actionable with Required for
Purchase Spot CoreSpot Deployer https://app.hyperliquid.xyz/deploySpot HyperCore
Blocked by none none Step 2
  • Purchase your HyperCore Spot engaging in the auction

Step 2 : Deploy the CoreSpot

Action Performed by Actionable with Required for
Deploy CoreSpot CoreSpot Deployer npx @layerzerolabs/hyperliquid-composer HyperCore
Blocked by OFT Deployer Step 0 Step 3
Blocked by CoreSpot Deployer Step 1 Step 3
  • Deploy the CoreSpot following the guide

Step 2.1 : Create a hypercore deployment file

Action Performed by Actionable with Required for
Create HyperCore Deployment File CoreSpot Deployer npx @layerzerolabs/hyperliquid-composer HyperCore
Blocked by OFT Deployer Step 0 Step 3
Blocked by CoreSpot Deployer Step 1 Step 2.2
  • Follow the guide
  • Core spot deployer needs OFT address and deployed transaction hash

Step 2.2 : Enable freeze privilege (Optional)

Action Performed by Actionable with Required for
Enable Freeze Privilege CoreSpot Deployer npx @layerzerolabs/hyperliquid-composer HyperCore
Blocked by CoreSpot Deployer Step 2.1 Step 2.2
  • Follow the guide
  • MUST be done before genesis if you want freeze capability
  • Enables post-launch user freeze/unfreeze operations
  • Once set, can only be revoked (irreversible)

Step 2.3 : Set the user genesis

Action Performed by Actionable with Required for
Set User Genesis CoreSpot Deployer npx @layerzerolabs/hyperliquid-composer HyperCore
Blocked by CoreSpot Deployer Step 2.1 Step 2.3
  • Follow the guide
  • HyperCore balances are u64 - the max balance is 2.pow(64) - 1 = 18446744073709551615
  • Make sure the total balances in the json does not exceed this value.
  • Re-runnable until the next step is executed.
  • UserGenesis transactions stack : If you set the balance of address X to 18446744073709551615 and then set the balance of address Y to 18446744073709551615 after removing X from the json, the net effect is that both X and Y will have 18446744073709551615 tokens.
  • You can either mint the entire amount to the asset bridge address or the deployer address.
  • You can read more about the asset bridge address - in the docs

Step 2.4 - Confirm the user genesis

Action Performed by Actionable with Required for
Confirm User Genesis CoreSpot Deployer npx @layerzerolabs/hyperliquid-composer HyperCore
Blocked by CoreSpot Deployer Step 2.2 Step 2.4
  • Follow the guide
  • Locks in the user genesis step and is now immutable.

Step 2.5 : Create spot deployment

Action Performed by Actionable with Required for
Create Spot Deployment CoreSpot Deployer npx @layerzerolabs/hyperliquid-composer HyperCore
Blocked by CoreSpot Deployer Step 2.3 Step 2.5
  • Follow the guide
  • Step MUST be run even though we set noHyperliquidity=true in genesis
  • This can be run even after deployment and linking

Step 2.6 : Register the spot

Action Performed by Actionable with Required for
Register Spot CoreSpot Deployer npx @layerzerolabs/hyperliquid-composer HyperCore
Blocked by CoreSpot Deployer Step 2.4 Step 3
  • Follow the guide
  • Only USDC is supported on HyperCore at the moment - the sdk defaults to USDC.
  • Make sure the asset bridge address on HyperCore has all the tokens minted in Step 2.3. Partial funding is not supported.
  • The final step to be executed after which the token will be listed on the spot order book.

Step 2.7 : Set deployer fee share (Optional)

Action Performed by Actionable with Required for
Set Deployer Fee Share CoreSpot Deployer npx @layerzerolabs/hyperliquid-composer HyperCore
Blocked by OFT Deployer Step 0 none
Blocked by CoreSpot Deployer Step 2.1 none
  • Follow the guide
  • Trading fee share is usually 100% (default value) - this allocates the trading fees to the token deployer instead of burning it.
  • Do not lose or burn your deployer address as it collects tokens.
  • Step can be re-run as long as the new fee% is lower than the current one.
  • Important: If you plan to enable quote token capability (Step 2.8), read the Permissionless Spot Quote Assets documentation before setting this value as it requires a specific trading fee share
  • Even though the default value is 100%, it is recommended that you set it
  • This can be run even after deployment and linking

Step 2.8 : Enable quote token capability (Optional)

Action Performed by Actionable with Required for
Enable Quote Token CoreSpot Deployer npx @layerzerolabs/hyperliquid-composer HyperCore
Blocked by CoreSpot Deployer Step 2.7 none
  • Review requirements first: Read Permissionless Spot Quote Assets for all requirements
  • Requires specific trading fee share value (see Step 2.7 above)
  • Follow the guide
  • Enables the token to be used as a quote asset for trading pairs (e.g., OTHER_TOKEN/YOUR_TOKEN)
  • Can be executed after trading fee share is set
  • This can be run even after deployment and linking are complete

Step 2.8.5 : Enable aligned quote token capability (Optional)

Action Performed by Actionable with Required for
Enable Aligned Quote Token CoreSpot Deployer npx @layerzerolabs/hyperliquid-composer HyperCore
Blocked by CoreSpot Deployer Step 2.5 none
  • Review requirements at: Aligned Quote Assets
  • 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
  • Can be executed after trading fee share is set
  • This can be run even after deployment and linking are complete

Step 3.1 : Create a request to connect the HyperCoreSpot to HyperEVM OFT

Action Performed by Actionable with Required for
Create Request CoreSpot Deployer npx @layerzerolabs/hyperliquid-composer HyperCore
Blocked by CoreSpot Deployer Step 0, Step 2 Step 3.2
  • Make sure the core spot deployer has the oft address.

Step 3.2 : Accept the request to connect the HyperCoreSpot to HyperEVM OFT

Action Performed by Actionable with Required for
Accept Request OFT Deployer npx @layerzerolabs/hyperliquid-composer HyperCore
Blocked by CoreSpot Deployer Step 3.1 Step 4
  • Follow the guide
  • Create a deployment file for the core spot before linking.

Step 4 : Deploy the Composer

Action Performed by Actionable with Required for
Deploy Composer OFT Deployer npx @layerzerolabs/hyperliquid-composer HyperCore
Blocked by CoreSpot Deployer Step 3 none
  • Follow the guide
  • Deployer script in the oft repo will deploy the composer - it also handles block switching.
  • Make sure the Composer's address is activated on HyperCore - transferring any spot amount on app.hyperliquid.xyz to the address will prompt you that you are paying $1 as an activation fee. app.hyperliquid-testnet.xyz should be used for a testnet deployment.
  • Composer is re-deployable and independent of the oft and does not need to be linked with anything.

Step 5 : Listing on spot order books

Action Performed by Actionable with Required for
Spot Book Listing Automatic npx @layerzerolabs/hyperliquid-composer HyperCore
Blocked by CoreSpot Deployer Step 2 none

This is automatically completed when all steps in Step 2 are completed.

Step 6 : Listing on perp order books

Action Performed by Actionable with Required for
Perp Book Listing Automatic npx @layerzerolabs/hyperliquid-composer HyperCore
Blocked by CoreSpot Deployer Step 2 none

This is controlled by the hyperliquid community - source

Hyperliquid currently supports trading of 100+ assets. Assets are added according to community input.

Step 7 : Post-Launch Management (Optional)

Step 7.1 : Freeze/Unfreeze Users

Action Performed by Actionable with Required for
Freeze Users CoreSpot Deployer npx @layerzerolabs/hyperliquid-composer HyperCore
Blocked by CoreSpot Deployer Step 2.1.1 (Enable Freeze) none
  • Follow the guide
  • Only available if freeze privilege was enabled before genesis
  • Can freeze/unfreeze individual users
  • Updates deployment JSON with blacklist status

Step 7.2 : Revoke Freeze Privilege

Action Performed by Actionable with Required for
Revoke Freeze CoreSpot Deployer npx @layerzerolabs/hyperliquid-composer HyperCore
Blocked by CoreSpot Deployer Step 2.1.1 (Enable Freeze) none
  • Follow the guide
  • Permanently removes freeze capability (irreversible)
  • No longer able to freeze/unfreeze any users
  • Use with caution - cannot be undone