Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs to exchange API functions #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

perplover
Copy link
Contributor

A few changes:

  1. API Docs
  2. Update variable naming from usdc -> usdc_rounded_micros


Note:
- The scheduled time must be at least 5 seconds after the current time.
- Once the scheduled time arrives, all open orders will be canceled.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found having a separate bullet is confusing. The trigger count is incremented when the scheduled time arrives, not when this action is sent.

Suggested change
- Once the scheduled time arrives, all open orders will be canceled.
- Once the scheduled time arrives, all open orders will be canceled and a trigger count is incremented.

@@ -421,12 +519,12 @@ def usd_class_transfer(self, amount: float, to_perp: bool) -> Any:

# Deprecated in favor of usd_class_transfer
def user_spot_transfer(self, usdc: float, to_perp: bool) -> Any:
usdc = int(round(usdc, 2) * 1e6)
usdc_rounded_micros = int(round(usdc, 2) * 1e6)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer not making this rename. usdc has 6 decimals so this is the actual amount of usdc and is not rounded. Perhaps the input should have been usd instead of usdc, but renaming it now would be a breaking change

Args:
amount (float): The amount of the token to transfer.
destination (str): The destination address (EVM compatible) for the transfer.
token (str): The identifier of the token to be transferred (e.g., "BTC", "ETH").
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These example tokens are not spot tokens. Also the token identifier is a different format

Suggested change
token (str): The identifier of the token to be transferred (e.g., "BTC", "ETH").
token (str): The identifier of the token to be transferred (e.g., "PURR:0xc1fb593aeffbeb02f85e0308e9956a90").

Initiate a withdrawal from the Hyperliquid bridge to a specified destination.

Args:
amount (float): The amount to withdraw. This should be in the base unit of the asset
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this confusing. All withdrawals are in USDC

Suggested change
amount (float): The amount to withdraw. This should be in the base unit of the asset
amount (float): The amount of USD to withdraw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants