[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
  • Get Position
  • Get Buy Amount
  • Get Deposit Amount
  • Get Withdraw Amount
  1. 👩‍💻 DSA SDK
  2. Resolvers

Curve sBTC

Curve Resolver fetch Position of user, Buy, Deposit and Withdraw details. You can view details like source code, ABIs on Etherscan.

Get Position

Fetch the Curve position details of an address

dsa.curve_sbtc.getPosition(address);

Parameter

Type

Description

address

address/string

The owner address.

Returns: Object with all the Position details

{
  "curveBalance": 0,
  "userShare": 0,
  "virtualPrice": 1.0020898812279617,
  "totalSupply": 1734.150556270193,
  "renBtcPoolBalance": 790.60846199,
  "wBtcPoolBalance": 545.62278272
  "sBtcPoolBalance": 402.2394863091501,
  }

Return Parameter

Type

Description

curveBalance

number

User's curve token balance.

totalSupply

number

Total supply of the curve token

virtualPrice

number/string

Virtual price of the curve token on sBTC pool.

userShare

number

The users share in % eg - 1 = 1% share

renBtcPoolBalance

number

Balance of renBTC in the pool.

wBtcPoolBalance

number

Balance of wBTC in the pool.

sBtcPoolBalance

number

Balance of sBTC in the pool.

Get Buy Amount

Fetch amount of tokens to buy of a user with just a single call

dsa.curve_sbtc.getBuyAmount(buyToken, sellToken, sellAmt, slippage)

Parameter

Type

Description

buyToken

string

The buy token symbol.

sellToken

string

The sell token symbol.

sellAmt

number

The amount of tokens to sell. Amount to be written in normal form eg - 1.1 wBTC, 0.3 renBTC.

slippage

number

The slippage in percent eg - 1 means 1%, 10 means 10%, etc.

Returns: Object of buy token details

{
  buyAmt: "2208.0499999999997",
  buyAmtRaw: "2208050000000000000000",
  unitAmt: "216388900000000000000",
  virtualPrice: "1.0020898812279617"
}

Return Parameter

Type

Description

buyAmt

number/string

Expected buy token amount.

buyAmtRaw

number/string

Expected buy token amount in decimal form.

unitAmt

number/string

The unit amount is the minimum amount of curve token amount expected per token amount. It is calculated with the help of slippage. The parameter is passed directly in the curve connector.

virtualPrice

number/string

Virtual price of the curve token on sBTC pool.

Get Deposit Amount

Fetch amount of tokens to deposit of a user with just a single call

dsa.curve_sbtc.getDepositAmount(token, amount, slippage)

Parameter

Type

Description

token

string

The deposit token symbol.

amount

number

The amount of tokens to deposit. This should be a decimal value.

slippage

number

The slippage to deposit in percent eg - 1 means 1%, 10 means 10%, etc.

Returns: Object of buy token details

{
  curveAmt: "2208.0499999999997",
  curveAmtRaw: "2208050000000000000000",
  unitAmt: "216388900000000000000",
  virtualPrice: "1.0020898812279617"
}

Return Parameter

Type

Description

curveAmt

number/string

Expected deposit token amount.

curveAmtRaw

number/string

Expected deposit token amount in decimal form.

unitAmt

number/string

The unit amount is the minimum amount of curve token expected per token. It is calculated with the help of slippage. The parameter is passed directly in the curve_sbtc connector.

virtualPrice

number/string

Virtual price of the curve token on sBTC pool.

Get Withdraw Amount

Fetch amount of tokens to withdraw of a user with just a single call

dsa.curve_sbtc.getWithdrawAmount(token, amount, slippage)

Parameter

Type

Description

token

string

The withdraw token symbol.

amount

number

The amount of tokens to withdraw. This should be a decimal value.

slippage

number

The slippage to withdraw in percent eg - 1 means 1%, 10 means 10%, etc.

Returns: Object of withdraw token details

{
  curveAmt: "2208.0499999999997",
  curveAmtRaw: "2208050000000000000000",
  unitAmt: "216388900000000000000",
  virtualPrice: "1.0020898812279617"
}

Return Parameter

Type

Description

curveAmt

number/string

Expected withdraw token amount.

curveAmtRaw

number/string

Expected withdraw token amount in decimal form.

unitAmt

number/string

The unit amount is the minimum amount of curve token expected per token. It is calculated with the help of slippage. The parameter is passed directly in the curve_sbtc connector.

virtualPrice

number/string

Virtual price of the curve token on sBTC pool.

PreviousKyberNextCurve sUSD

Last updated 4 years ago