Reporting data

Reach out to Kiln to get access on the data endpoints.

There are 2 ways to query reporting data for Kiln DeFi:

  1. Using Kiln Connect API (recommended): a simple REST API doing all aggregation for you

  2. Using Kiln public TheGraph instances directly

Get a user position(s) and total rewards inside of Vault(s)

Route: GET /v1/defi/v1/stakes

Goals

  • Get a list of positions inside a list of vaults

  • Positions include current deposited balance and total rewards and withdrawn amounts

  • This data can be used to showcase current holdings of a user in Kiln DeFi vaults

Query parameters

  • wallets: comma-separated list of wallet address to fetch position data for

  • vaults: comma-separated list of vaults, where each value has the protocol_address format

These are not exclusive and can be used together. Some use-cases could be:

  • query all current positions of a vault or a list of vaults

  • query all current positions of a user or a list of users

  • query all current positions of a user or a list of users within a vault or a list of vaults

Example

curl -sL https://api.kiln.fi/v1/defi/v1/stakes?wallets=0x356c33675674691ad6b8ac92ecfb91960c5d2c30&vaults=ethereum_0x9ab5f9101a3c1b868e2c422e294cc2ee685551d5,ethereum_0x9ab5f9101a3c1b868e2c422e294cc2ee685551d5 \
  -H "Authorization: Bearer $KILN_API_TOKEN"

{
  "stakes": [
    {
      "current_balance": 1880000,
      "asset": "0x94a9d9ac8a22534e3faca9f4e7f2e2cf85d5e4c8",
      "asset_symbol": "skUSDC",
      "total_rewards": 4200,
      "total_deposited_amount": 1980000,
      "total_withdrawn_amount": 100000,
      "vault": "0x9aB5F9101a3C1B868e2c422E294cc2ee685551D5",
      "chain": "ethereum"
    },
    {
      "current_balance": 1880000,
      "asset": "0x94a9d9ac8a22534e3faca9f4e7f2e2cf85d5e4c8",
      "asset_symbol": "skUSDC",
      "total_rewards": 42120,
      "total_deposited_amount": 1980000,
      "total_withdrawn_amount": 100000,
      "vault": "0x9aB5F9101a3C1B868e2c422E294cc2ee685551D5",
      "chain": "ethereum"
    }
  ]
}

Get Operations on a position

Route: GET /v1/defi/v1/operations

Goals

  • Get all operations performed on a list of positions inside a list of vaults

  • Operations include deposit and withdrawal operations

  • This data can be used for accounting reconciliation

Query parameters

  • wallets: comma-separated list of wallet address to fetch position data for

  • vaults: comma-separated list of vaults, where each value has the protocol_address format

These are not exclusive and can be used together. Some use-cases could be:

  • query all operations of positions on a vault or a list of vaults

  • query all operations of positions of a user or a list of users

  • query operations of positions of a user or a list of users within a vault or a list of vaults

Example

curl -sL https://api.kiln.fi/v1/defi/v1/operations?wallets=0x356c33675674691ad6b8ac92ecfb91960c5d2c30&vaults=ethereum_0x9ab5f9101a3c1b868e2c422e294cc2ee685551d5 \
  -H "Authorization: Bearer $KILN_API_TOKEN"
{
  "operations": [
    {
      "type": "deposit",
      "assets": "1000000",
      "shares": "990000",
      "sender": "0x356c33675674691ad6b8ac92ecfb91960c5d2c30",
      "timestamp": "1710423432",
      "tx_hash": "0x7feaab9c3523e35072af5f9a724d9869314d2711414244b133da0372e8874e1a",
      "vault": "0x9aB5F9101a3C1B868e2c422E294cc2ee685551D5",
      "chain": "ethereum"
    },
    {
      "type": "deposit",
      "assets": "1000000",
      "shares": "990000",
      "sender": "0x356c33675674691ad6b8ac92ecfb91960c5d2c30",
      "timestamp": "1710423660",
      "tx_hash": "0x6faf7f0c2589c035fddfbaf91d044d84a51b16ef919faf2948439981a696952b",
      "vault": "0x9aB5F9101a3C1B868e2c422E294cc2ee685551D5",
      "chain": "ethereum"
    },
    {
      "type": "withdrawal",
      "assets": "100000",
      "shares": "100000",
      "sender": "0x356c33675674691ad6b8ac92ecfb91960c5d2c30",
      "timestamp": "1710434028",
      "tx_hash": "0xca1e9f9a9ed7b632dbb71e9d22730d1541df010e915d65af91d1ca102600c965",
      "vault": "0x9aB5F9101a3C1B868e2c422E294cc2ee685551D5",
      "chain": "ethereum"
    }
  ]
}

Get Statistics of a vault

Route: GET /v1/defi/v1/network-stats

Query parameters

  • vaults: comma-separated list of vaults, where each value has the protocol_address format

Example

curl -sL https://api.kiln.fi/v1/defi/v1/network-stats?vaults=ethereum_0x9ab5f9101a3c1b868e2c422e294cc2ee685551d5
 -H "Authorization: Bearer $KILN_API_TOKEN"
{
  "stats": [
    {
      "asset": "0x94a9d9ac8a22534e3faca9f4e7f2e2cf85d5e4c8",
      "asset_symbol": "skUSDC",
      "protocol_grr": 0.025025338505491934,
      "protocol_nrr": 0.024775085120437013,
      "vault": "0x9aB5F9101a3C1B868e2c422E294cc2ee685551D5",
      "chain": "ethereum"
    }
  ]
}

Last updated