❓FAQ & Resources

Ecosystem Tools FAQ

chevron-rightAre there any multi-sig and/or MPCs that support the dYdX chain?hashtag
chevron-rightPlease provide a transaction to exchange the USDC from the Noble chain to the USDC of the Ethereum chain for reference?hashtag

Front End FAQ

chevron-rightIs there a way to get user's BuyingPower from API? Or from SDK?hashtag

You can get equity and freeCollateral from the /v4/addresses/<address> endpoint

*arrow-up-righthttps://docs.dydx.trade/developers/indexer/indexer_api#getaddress*arrow-up-right

it won't make sense to get BuyingPower from API since each market has different maximum leverage

chevron-rightI cant find a GoodTilBlock param in the placeOrder functionhashtag
chevron-rightSometimes I get "FillOrKill order could not be fully filled" error after I place a market order in ETH-USD market on a testnet, but in fact I'm sending the timeInForce: "GTT" (and provide "goodTilTimeInSeconds"), not "FOK", do you have any hints what am I doing wrong? I'm using placeOrder function from your js sdkhashtag
chevron-rightDo you have an example on how to hexidecimal -> accAddress.hashtag

*arrow-up-righthttps://twitter.com/LawrenceChiu14/status/1716491077673275876*arrow-up-right

You still need to own the metamask address (have the private key) to run the derivation to determine dydxaddress

If you don't own the metamask address, it's not possible to derive

Essentially : metamask address β€”> sign a message β€”> dydx address

If you can't sign the message, then you can't get the dydx address

chevron-rightI want to create an alternative UI for dydx and user will sign a message with metamask to loginhashtag

The user can connect their metamask wallet to your alternative UI. Then you just ask the user to sign the message like in my example. The frontend code is open-source, it can be used for reference https://github.com/dydxprotocol/v4-webarrow-up-right

Websocket FAQ

chevron-rightIn the Indexer Websocket service, do we need to maintain a heartbeat stream to keep connected?hashtag
chevron-rightIs it possible to subscribe to a new block event via ws?hashtag
  • That's not available on websocket, however, it is available via REST https://v4- teacher.vercel.app/integration_docs/indexer_api#getheightor If you run a full node that can keep up with the chain, you would always know the block height (second way is recommended so you don't hit the rate limit on the REST endpoint)

chevron-rightHow can we know the block number of an orderbook snapshot we get on websocket or on indexer rest api request?hashtag
chevron-rightCan we assume one orderbook update will be published per block? Per Pairhashtag
  • No because the order book is off chain

chevron-rightIs it possible to subscribe to trade confirmation events via ws?hashtag
  • You can get fills via ws, v4_subaccount channel

chevron-rightWe want to inspect order info from GET /orders/{orderId}, How do I get this orderID without using GET /orders, because there may be too many orders in the queue. Could i get orderID through clientID or txs_hash?hashtag
  • If you run a websocket client, you could just monitor the v4_subaccounts feedthat'll have orders so you can see the orderId and match that up with the clientId

Last updated