Parabol Notes

You can fetch Parabol’s on-chain treasury bill information using the fetchParabolData public method from the ParabolServer instance.

import { ParabolServer } from "@parabolfi/server";
 
const parabolServer = new ParabolServer({
  apiKey: process.env.PARABOL_API_KEY,
});
 
const data = await parabolServer.fetchParabolData();

Optional Parameters

The fetchParabolData method accepts two optional parameters:

  1. chain: Specifies the blockchain network to fetch data from.
  2. maturity: An array of maturity periods to filter the fetched data.
await parabolServer.fetchParabolData({
  chain: SupportedChainIds.ZKSYNC as ChainId,
  maturity: [7],
});

It is converted to the following URL:

https://api.parabol.fi/notes?chainid=324&maturity=7

You can specify more than one maturity period:

await parabolServer.fetchParabolData({
  chain: SupportedChainIds.ZKSYNC,
  maturity: [7, 14],
});

It is converted to the following URL:

https://api.parabol.fi/notes?chainid=324&maturity=7,14

ℹ️

If chain parameter is not provided, the API will return data for all supported chains. So, you have to filter the chain by yourself.

🚨

ChainId type is imported from @parabol/core SDK. See Parabol Core SDK page.

Response

The response is a JSON object with the following properties:

{
  data: [
    {
      maturity_timestamp: '1732856400',
      coupon: '369',
      note_started_at: '1732424399',
      signature_valid_after: '1732489199',
      signature_valid_before: '1732510799',
      signature: [Object],
      chainid: 324
    },
    {
      maturity_timestamp: '1735016400',
      coupon: '352',
      note_started_at: '1732424399',
      signature_valid_after: '1732489199',
      signature_valid_before: '1732510799',
      signature: [Object],
      chainid: 324
    },
    {
      maturity_timestamp: '1737608400',
      coupon: '346',
      note_started_at: '1732424399',
      signature_valid_after: '1732489199',
      signature_valid_before: '1732510799',
      signature: [Object],
      chainid: 324
    },
    {
      maturity_timestamp: '1742443200',
      coupon: '340',
      note_started_at: '1732424399',
      signature_valid_after: '1732489199',
      signature_valid_before: '1732510799',
      signature: [Object],
      chainid: 324
    },
    {
      maturity_timestamp: '1761796800',
      coupon: '323',
      note_started_at: '1732424399',
      signature_valid_after: '1732489199',
      signature_valid_before: '1732510799',
      signature: [Object],
      chainid: 324
    }
  ],
  availableMaturities: [ 5, 30, 60, 115, 339 ],
  marketRate: '16.34',
  floatingRate: '12.65'
}

In this example, the data array contains the treasury bill information for the specified maturity periods. The availableMaturities array lists the available maturity periods for the specified chain. The marketRate and floatingRate are the market rates of the Parabol protocol.

ℹ️

The availableMaturities can vary from day to day, but Parabol will offer at least 5-6 different loans, with a minimum of 3 days and a maximum of 365 days.

Example

If you’re only interested in the 5-day loans, you can fetch the data as follows:

await parabolServer.fetchParabolData({
  maturity: [5],
});

Response of 5-day loans

{
  data: [
    {
      maturity_timestamp: '1732856400',
      coupon: '369',
      note_started_at: '1732424399',
      signature_valid_after: '1732489199',
      signature_valid_before: '1732510799',
      signature: [Object],
      chainid: 324
    }
  ],
  availableMaturities: [ 5, 30, 60, 115, 339 ],
  marketRate: '16.34',
  floatingRate: '12.65'
}