[OLD] Instadapp Docs
  • Introduction
  • DeFi Smart Account (DSA)
  • DSA SDK
    • Running Instadapp SDK
  • 💻Instadapp GUI
    • Integrated Protocols
      • Aave
      • Compound Finance
      • MakerDAO
    • Strategies
    • Multi-Protocol Refinancing
    • Authorities
    • Debt Collateral Ratio
  • 👩‍💻 DSA SDK
    • Casting Spells
    • Build a Connector
    • Connectors
      • Basic
      • Authority
      • Instapool
      • MakerDAO
      • Compound
      • Comp
      • Aave
      • dYdX
      • 1Inch
      • Uniswap
      • OasisDEX
      • Kyber
      • Curve sBTC
      • Curve sUSD
      • Curve yUSD
    • Resolvers
      • Accounts
      • Balances
      • Instapool
      • MakerDAO
      • Compound
      • Aave
      • dYdX
      • 1inch
      • Uniswap
      • OasisDex
      • Kyber
      • Curve sBTC
      • Curve sUSD
      • Curve yUSD
    • getId/setId
    • Example Use Cases
      • Long ETH
      • Short DAI
      • Debt Swap
      • Lending Bridge
      • Lending Swap
      • Debt Bridge
  • 👩‍🏫 Tutorials
    • Getting Started
    • Moving Assets into DSA
    • In-App Swaps
  • Additional Info
    • Contract Infomation
    • FAQs
    • Security Audits
    • Release History
  • 🌏Links
    • Homepage
    • DApp
    • Discord
    • Contact Us
Powered by GitBook
On this page
  1. 👩‍💻 DSA SDK
  2. Resolvers

dYdX

dYdX Resolver fetch Position of user. You can view details like source code, ABIs on Etherscan.

Get Position

Fetch compound position of a user with just a single call.Copy

dsa.dydx.getPosition(address, key);

Parameter

Type

Description

address

address

The user address.

key

number

(Optional) The key indicates the token. - `token` (default) eth, dai, usdc, etc. - `address` "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", "0x6B175474E89094C44Da98b954EedeAC495271d0F", etc. - `market` 0, 1, 3, etc.

Returns: Object with all the dYdX details.Copy

{
  "eth": {
    "price": 210,
    "supply": 0.020001941382760555,
    "borrow": 0,
    "supplyRate": 0.01053365240736,
    "supplyYield": 0.010534205695367227,
    "borrowRate": 2.05689983754528,
    "borrowYield": 2.078140652407834,
  },
  "dai": {},
  "usdc": {},
  ....
  "totalSupplyInEth": 0.043728986801881906,
  "totalBorrowInEth": 0.0023955855814168704,
  "maxBorrowLimitInEth": 0.032796740101411426,
  "status": 0.05478255401320606,
  "liquidation": 0.7499999999999999
}

Return Parameter

Type

Description

price

number

Price of the token.

supply

number

Supply balance of token.

borrow

number

Borrow balance of token.

supplyRate

number

Supply APR of token.

supplyYield

number

Supply APY of token.

borrowRate

number

Borrow APR of token.

borrowRate

number

Borrow APY of token.

totalSupplyInEth

number

Total supply w.r.t Ethereum.

totalBorrowInEth

number

Total borrow w.r.t Ethereum.

maxBorrowLimitInEth

number

Max borrow limit w.r.t Ethereum.

status

number

Current status.

status

number

Current status. Mulitply by 100 to convert into %.

liquidation

number

Position breakage limit. Mulitply by 100 to convert into %.

PreviousAaveNext1inch

Last updated 4 years ago