dYdX Setup

dYdX API Setup for the Kingfisher OEMS

Connecting the Kingfisher OEMS to dYdX is a unique process compared to other exchanges due to its decentralized nature. This guide will walk you through the steps to set up your dYdX API for use with the Kingfisher OEMS.

Understanding the dYdX Connection​

Unlike centralized exchanges, dYdX generates API credentials automatically when you connect your MetaMask wallet. These credentials are stored in your browser. It's important to use a MetaMask wallet that is not connected to a hardware wallet, as the private key of a hardware wallet cannot be used for signing messages due to security protocols.


Wallet Choice: You don't need to use the same wallet as your Gunthy Wallet Address for dYdX. You can create a new Metamask wallet separate from your the Kingfisher OEMS License Wallet.


Info about market orders: dYdX enforces 'fill or kill' on market orders, meaning the order gets cancelled when it cannot fill immediately. This is fine in most trading strategies as they would just replace the order at next opportunity. When you're using an alert based sell trigger, please be aware that market orders might get cancelled.

Step-by-Step dYdX API Setup​

Step 1: Connect Wallet​

  • Go to dYdX.

  • Select 'Connect wallet' to start the process.

Step 2: Choose MetaMask​

  • Select 'MetaMask' to continue.

Step 3: Choose Connect​

  • Click on 'Connect'.

Step 4: Enter MetaMask Password​

  • Enter your MetaMask password to log in.

Step 5: Remember Me and Permissions​

  • Select 'Remember me' and click 'Send requests'.

  • Approve the connection prompts in MetaMask.

  • Log out and back in to ensure the account is remembered.

Step 6: Export Private Key​

  • This step is optional, it allows the Kingfisher OEMS to ensure position data on L2 gets updated at the time orders get placed. You can leave the field blank or enter a placeholder when you do not want to enter the real key.

  • Open MetaMask and select the three dots icon.

  • Go to 'Account details'.

  • Select 'Export private key' and save it.

Step 7: Open Local Storage Manager​

  • Open browser developer tools (F12 or Ctrl-Shift-i).

  • Navigate to the local storage section.

Step 8: Stark Private Key​

  • Save the 'privateKey' in 'STARK_KEY_PAIRS'.

Step 9: Wallet Address​

  • Save the 'walletAddress' in 'STARK_KEY_PAIRS'.

Step 10: API Key​

  • Save the 'key' in 'API_KEY_PAIRS'.

Step 11: API Secret​

  • Save the 'secret' in 'API_KEY_PAIRS'.

Step 12: Passphrase​

  • Save the 'passphrase' in 'API_KEY_PAIRS'.

Step 13: Add dYdX to the Kingfisher OEMS​

Ensuring Security​

After configuring the Kingfisher OEMS, ensure to delete the plain text credentials collected during the setup. the Kingfisher encrypts and stores these credentials for security.

Follow these steps carefully to ensure a secure and successful setup of dYdX with the Kingfisher OEMS.

Last updated