Compound V2

/getpool

Get the lend and borrow APY for the given pool from the given protocol.

GET https://api.expand.network/lendborrow/getpool

Query Parameters

https://api.expand.network/lendborrow/getpool?lendborrowId=1100&asset=usdc

/getpools

Get the list of supply and borrow APYs of the mentioned assets.

GET https://api.expand.network/lendborrow/getpools

Query Parameters

https://api.expand.network/lendborrow/getpools?lendborrowId=1100&assets=USDT,usDC,rep

/getuseraccountdata

Get the repay, borrow, withdraw amount and health factor details for the given user.

GET https://api.expand.network/lendborrow/getuseraccountdata

Query Parameters

https://api.expand.network/lendborrow/getuseraccountdata?address=0x6Fb447Ae94F5180254D436A693907a1f57696900&lendborrowId=1100&asset=DAI

/getuserpositions

Retrieves the lending and borrowing positions of a user, including details such as token balances and collateral usage status.

GET https://api.expand.network/lendborrow/getuserpositions

Query Parameters

https://api.expand.network/lendborrow/getuserpositions?address=0x6Fb447Ae94F5180254D436A693907a1f57696900&lendborrowId=1100

/entermarketstatus

Checks whether the user approved before depositing.

GET https://api.expand.network/lendborrow/entermarketstatus

Query Parameters

https://api.expand.network/lendborrow/entermarketstatus?account=0x6Fb447Ae94F5180254D436A693907a1f57696900&lendborrowId=1100

/entermarket

Compound needs the user to approve before they can start deposit.

POST https://api.expand.network/lendborrow/entermarket

Query Parameters

{
    "lendborrowId": "1100",
    "asset": "DAI",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "298800"
}

With gasPriority:

{
    "lendborrowId": "1100",
    "asset": "DAI",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "298800",
    "gasPriority": "medium"
}

/borrow

Trigger the withdraw transaction from the given protocol.

POST https://api.expand.network/lendborrow/borrow

Request Body

{
    "lendborrowId": "1100",
    "asset": "DAI",
    "amount": "100000",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "442020"
}

With gasPriority (medium):

{
    "lendborrowId": "1100",
    "asset": "DAI",
    "amount": "100000000000000",
    "from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
    "gas": "192020",
    "gasPriority":"medium"
}

/deposit

Trigger the deposit transaction from the given protocol.

POST https://api.expand.network/lendborrow/deposit

Request Body

{
    "lendborrowId": "1100",
    "asset": "DAI",
    "amount": "1000000000000000000",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "192020"
}

With gasPriority (medium):

{
    "lendborrowId": "1100",
    "asset": "DAI",
    "amount": "100000000000000",
    "from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
    "gas": "192020",
    "gasPriority":"medium"
}

/repay

Trigger the repay transaction from the given protocol.

POST https://api.expand.network/lendborrow/repay

Request Body

{
    "lendborrowId": "1100",
    "asset": "DAI",
    "amount": "100000",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "152020"
}

With gasPriority (medium):

{
    "lendborrowId": "1100",
    "asset": "USDC",
    "amount": "100000000000000",
    "from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
    "gas": "192020",
    "gasPriority":"medium"
}

/withdraw

Trigger the withdraw transaction from the given protocol.

POST https://api.expand.network/lendborrow/withdraw

Request Body

{
    "lendborrowId": "1100",
    "asset": "DAI",
    "amount": "1000000000000000000",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "312020"
}

With gasPriority (medium):

{
    "lendborrowId": "1100",
    "asset": "DAI",
    "amount": "100000000000",
    "from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
    "gas": "192020",
    "gasPriority":"medium"
}

/exitmarket

Trigger the exit market transaction for the given protocol

POST https://api.expand.network/lendborrow/exitmarket

Request Body

{
    "lendborrowId": "1100",
    "asset": "dai",
    "from": "0x6Fb447Ae94F5180254D436A693907a1f57696900",
    "gas": "40000"
}

With gasPriority (medium):

{
    "lendborrowId": "1100",
    "asset": "DAI",
    "from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
    "gas": "40000",
    "gasPriority":"medium"
}

Following is the list of supported tokens :

Token List - Mainnet
  • AAVE

  • BAT

  • COMP

  • DAI

  • ETH

  • FEI

  • LINK

  • MKR

  • REP

  • SAI

  • SUSHI

  • TUSD

  • UNI

  • USDC

  • USDP

  • USDT

  • WBTC

  • WBTC2

  • YFI

  • ZRX

Token List - Testnet
  • DAI

  • USDC

Last updated