Aave V2 APIs
  • Introduction
  • aave v2
    • aToken Address
    • Aave Reserve Rates
    • Aave Reserve Configuration
    • User Health
    • Allowance
    • Deposit
    • Withdraw
    • Borrow
    • Repay
    • Switch Interest Type
    • Collateral Setting
Powered by GitBook
On this page

Was this helpful?

  1. aave v2

Collateral Setting

Sets the asset of address to be used as collateral or not.

/aave/setUserUseReserveAsCollateral

POST https://cryptotalk-public-gateway-byeii62k.de.gateway.dev/aave/setUserUseReserveAsCollateral

1) Request body must be JSON 2) Request structure sample { "params" : { "addr" : "0xabcd...efe", "from_tkn" : "DAI", "gas" : "80", "useAsCollateral" : false } } 3) from_tkn is case sensitive 4) Sample response contain rawTx object that needs to be signed and broadcast to main net. 5) useAsCollateral; send false if you don't want to use asset as collateral. Otherwise send true

Query Parameters

Name
Type
Description

key

string

API Key

Request Body

Name
Type
Description

params

object

{ addr : "0xabcd....efe", from_tkn: "ETH", gas: "80", useAsCollateral : false }

{
  "operation": "TOGGLECOLLATERAL",
  "token": "KNC",
  "to_addr": "0xA5576138F067EB83C6Ad4080F3164b757DEB2737",
  "rawTx": {
    "from": "0xa5576138f067eb83c6ad4080f3164b757deb2737",
    "value": "0x0",
    "to": "0x7d2768de32b0b80b7a3454c06bdac94a69ddc7a9",
    "data": "0x5a3b74b9000000000000000000000000dd974d5c2e2928dea5f71b9825b8b646686bd2000000000000000000000000000000000000000000000000000000000000000000",
    "nonce": "0x743",
    "gasLimit": "0x7a120",
    "gasPrice": "0x104c533c00"
  },
  "isError": false,
  "resendRequest": false,
  "text": ""
}

PreviousSwitch Interest Type

Last updated 4 years ago

Was this helpful?