🦺Invest

Our Invest module allows you to integrate calling protocol contracts seamlessly without knowing the underlying domain model.

Prepare an investment / Enter a market

Preparing an investment will create prepared transactions. If the protocol and underlying farm/lending pool/liquidity pool support it, one or more transactions will be prepared. Often times, the first transaction is an approval transaction.

Prepare an investment. Returns a list of prepared transactions that need to be signed.

POST https://api.decentri.fi/{protocol}/{markettype}/markets/{marketId}/enter

Path Parameters

NameTypeDescription

markettype*

string

one of [farming, lending, pooling]

marketId*

string

id of the underlying market

protocol*

string

slug of a protocol

Request Body

NameTypeDescription

user*

string

address wanting to enter the market

amount*

BigInteger

amount to be entered the market into

{
  "transactions": [
    {
      "function": {
        "name": "approve",
        "inputParameters": [
          {
            "value": "0x8dff5e27ea6b7ac08ebfdf9eb090f32ee9a30fcf",
            "typeAsString": "address"
          },
          {
            "value": 18446744073709551615,
            "bitSize": 256,
            "typeAsString": "uint256"
          }
        ],
        "outputParameters": []
      },
      "to": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
      "data": "0x095ea7b30000000000000000000000008dff5e27ea6b7ac08ebfdf9eb090f32ee9a30fcf000000000000000000000000000000000000000000000000ffffffffffffffff"
    }
  ]
}

Last updated