NAV

Frequently Asked Questions

1. Q: What is the easiest way to get started with the API SDK?

A: Refer to the Python SDK README.
It's the quickest way to learn how to install and use the Python SDK, including instructions on registering, creating orders, retrieving quote data, making withdrawals, and more.

Open-API SDKs - OpenApi-Python-SDK — Official OpenApi Python SDK - OpenApi-Java-SDK — Official OpenApi Java SDK - OpenApi-Node.JS-SDK — Official OpenApi Node.js SDK

A: Generally, CEX APIs have only one APIKey. However, ApeX Omni introduces Zklink.
Both the order creation API and withdrawal API require Zklink signatures. These signatures are verified on the L1 chain to ensure the security of users' assets.

3. Q: What is a Limit Fee? What is a Limit Fee Rate?

A: Limit Fee is the maximum fee that users can accept. This field is not present in CEX.
In order to prevent the platform from manipulating handling fees, DEX allows users to set this value and sign it for verification.
In the Python SDK's create-order API, users can use the taker fee rate to set the LimitFeeRate parameter, and the SDK will assist in calculating the Limit Fee.

4. Q: What is the expiration time?

A: An expiration time is set when creating an order and withdrawal. It determines the validity period for both actions.
The recommended expiration time is 28 days. - L2 expiration: (current timestamp in milliseconds + 28 days) / (3,600 * 1,000) - API expiration: L2 expiration * 3,600 * 1,000

5. Q: What is a clientId?

A: When creating an order or withdrawing funds, the client must generate a clientId.
This clientId enables the user to record the ID and perform local idempotent processing.
Additionally, when signing L2, the clientId is used as the nonce field of the signature for verification.
Please refer to the algorithm: Client ID and Nonce Generation

A: Yes. The Zklink Keys generated in the web, app, or SDK are consistent because they all use the same signature format.
However, if the user manually modifies the signature format, it may result in a different StarkKey.
Each Zklink Keys corresponds to a unique account ID in the system.

7. Q: Is APIKey generated consistently every time?

A: No. Each APIKey is unique.
Before calling the onboarding interface to generate an APIKey, the generate-nonce interface must be called to create a unique nonce.
Because each nonce is unique, the resulting APIKey returned by the server is also unique.
Each APIKey corresponds to the same account ID. All generated APIKeys remain valid as long as the web, app, and SDK are online simultaneously.

8. Q: Are there any rate limits on request frequency?

A: Yes. There are rate limits on request frequency.
The details for ordinary API users are documented here: Rate Limits.
Market makers can apply to customer service to be added to the IP whitelist and API interface whitelist, increasing their request limits.

9. Q: Why do I have to fill in the price when creating a market order?

A: Unlike CEX, which doesn't require users to input the price for market orders, ApeX requires users to specify the order price due to the Zklink signature mechanism.
Users can calculate the order price manually using the order quantity and market depth, or use the get_worst_price interface to obtain the backend-calculated price.
Important: The market order price must be worse than the index price; otherwise, the order will be canceled.

10. Q: How to calculate user's total assets, available balance, maintenance margin, etc.?

A: Refer to the SDK documentation: account_value.py - Total user assets: totalAccountValue - Available balance: availableValue - Maintenance margin: totalMaintenanceMarginRequirement

11. Q: In which region is the server located in AWS?

A: - RegionName: ap-southeast-1 - ZoneName: ap-southeast-1a - ZoneId: apse1-az1 - GroupName: ap-southeast-1 - NetworkBorderGroup: ap-southeast-1 - ZoneType: availability-zone

12. Q: How do I set LimitFee when creating orders using the Python SDK?

A: When creating an order with client.create_order_v3, refer to the demo and use the LimitFeeRate field.
Set the value to the user's takerFeeRate (not exceeding 6 decimal places). The SDK will assist in calculating the Limit Fee.
This value ensures that when pushed to L1 for verification, the backend cannot charge more than what the user specified, preventing backend manipulation.

13. Q: How many APIKeys can be created for one account?

A: A maximum of 30 APIKeys can be created per account.

14. Q: When creating an order using the Python SDK, what happens if you fill in numbers directly?

A: All numerical values in the Python SDK API client.create_order_v3 must be provided as strings.
This avoids numeric precision and length issues that could cause calculation errors.

15. Q: Which Python versions does the Python SDK support?

A: Python 3.6–3.9.

16. Q: Can I use a USDT account directly if I have used a USDC account before?

A: No. You need to register again using the v3 interface client.register_user_v3.

17. Q: Can token deposits and withdrawals be performed through the API?

A: Yes. Withdrawals can be initiated through the API, including fast and cross-chain withdrawals, but only on the ETH chain.
These require the user's zkLink pair. Withdrawals are limited to user-registered addresses.
Reference: demo_transfer_v3.py

18. Q: Is it necessary to obtain configuration information?

A: Yes. When using the Python SDK, you must call client.configs_v3() and client.get_account_v3() after initializing the client to retrieve configuration information.