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

NameTypeDescription

rpc

String

Remote procedural call URL.

lendBorrowId

String

Refer to the Lend and Borrow ID page for details.

asset*

String

Token's symbol to get the details of.

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

NameTypeDescription

lendborrowId

String

Refer to the lend borrow Id page for details.

assets*

String

Comma-separated values of token address.

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

/getuseraccountdata

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

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

Query Parameters

NameTypeDescription

rpc

String

Remote procedural call URL.

lendborrowId

String

Refer to the lend borrow Id page for details.

asset*

String

Token's symbol to get detail of.

address*

String

Public address of sender.

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

/entermarketstatus

Checks whether the user approved before depositing.

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

Query Parameters

NameTypeDescription

lendborrowId

String

Refer to the Lend and Borrow ID page for details.

rpc

String

Remote procedural call URL.

account*

String

Public address of the user.

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

NameTypeDescription

rpc

String

Remote procedural call URL.

lendBorrowId

String

Refer to the Lend and Borrow ID page for details.

asset*

String

Token's symbol to get the details of.

from*

String

Sender public address.

gas*

String

Maximum gas to be approved for the transaction.

{
    "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

NameTypeDescription

lendborrowId

String

Refer to the Lend and Borrow ID page for details.

asset*

String

Token's symbol to borrow.

amount*

String

Number of tokens to be borrowed.

from*

String

Sender public address.

gas*

String

Maximum gas to be approved for the transaction.

rpc

String

Remote procedural call URL.

gasPriority

String

low, medium, or high.

{
    "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

NameTypeDescription

lendborrowId

String

Refer to the Lend and Borrow ID page for details.

asset*

String

Token's symbol to deposit.

amount*

String

Number of tokens to be deposited.

from*

String

Sender public address.

gas*

String

Maximum gas to be approved for the transaction.

rpc

String

Remote procedural call URL.

gasPriority

String

low, medium, or high.

{
    "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"
}

/liquidate

Trigger the liquidate transaction from the given protocol

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

Request Body

NameTypeDescription

lendborrowId

String

Refer to the Lend and Borrow ID page for details.

collateralAsset*

String

Address of the collateral token.

debtAsset*

String

Address of the debt token.

user*

String

Public address of the user whose account need to be liquidated.

debtToCover*

String

Amount of debt to be covered.

from*

String

Sender public address.

gas*

String

Maximum gas to be approved for the transaction.

rpc

String

Remote procedural call URL.

/repay

Trigger the repay transaction from the given protocol.

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

Request Body

NameTypeDescription

lendborrowId

String

Refer to the Lend and Borrow ID page for details.

asset*

String

Token's symbol to be repaid.

amount*

String

Number of tokens to be repaid.

from*

String

Sender public address.

gas*

String

Maximum gas to be approved for the transaction.

rpc

String

Remote procedural call URL.

gasPriority

String

low, medium, or high.

{
    "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

NameTypeDescription

lendborrowId

String

Refer to the Lend and Borrow ID page for details.

asset*

String

Token's symbol to withdraw.

amount*

String

Number of tokens to withdraw.

from*

String

Sender public address.

gas*

String

Maximum gas to be approved for the transaction.

rpc

String

Remote procedural call URL.

gasPriority

String

low, medium, or high.

{
    "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

NameTypeDescription

rpc

String

Remote procedural call URL.

lendborrowId

String

Refer to the Lend and Borrow ID page for details.

asset*

String

Token's symbol.

gas*

String

Maximum gas to be approved for the transaction.

from*

String

Sender's public address.

gasPriority

String

low, medium, or high.

{
    "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

#553: ENC-2526-LIDO

Change request updated