Positions (fetchAllPositions)

This method fetches all non-fungible note positions for a given wallet address.

import { SupportedChainIds } from "@parabolfi/core";
import { ParabolServer } from "@parabolfi/server";
 
const parabolServer = new ParabolServer({
  apiKey: process.env.PARABOL_API_KEY,
});
 
const chain = SupportedChainIds.ZKSYNC;
const walletAddress = "0x...";
const positions = await parabolServer.fetchAllPositions(walletAddress, [chain]);
ℹ️

If more than one chain is provided, the API will return all positions for all specified chains.

Response

{
  '324': {
    positions: [
        {
            tokenId: '16',
            owner: '0x4ea830109b8df82d4e05f1fa7780b27f8f6dc7d7',
            initalOwner: '0x4ea830109b8df82d4e05f1fa7780b27f8f6dc7d7',
            initiator: '0x4ea830109b8df82d4e05f1fa7780b27f8f6dc7d7',
            coupon: '446',
            principal: '5000000000000000000000',
            lendTimestamp: '1731918321',
            maturityTimestamp: '1732597200',
            partnerFeeBPS: '0',
            partnerId: '0x0000000000000000000000000000000000000000000000000000000000000000',
            status: 'Active',
            lendTransactionHash: '0x9296573b388d21dd6eaba89b6d7eb94ab10c49bd2ddaaa12af0837e0d1b3bbed',
            maturityDate: '26 November, 2024',
            lendingDate: '18 November, 2024',
            duration: { staticDuration: [Object], dynamicDuration: [Object] },
            progress: 86,
            earning: {
            fixedCurrentIncome: '4184361561213991769',
            fixedApproximateIncome: '4867220196759259259',
            floatingCurrentIncome: '10998006209542851035',
            floatingApproximateIncome: '17551236173557347792',
            totalCurrentIncome: '15182367770756842804',
            approximateIncome: '22418456370316607051'
            }
        }
    ],
    active: [
        {
            tokenId: '16',
            owner: '0x4ea830109b8df82d4e05f1fa7780b27f8f6dc7d7',
            initalOwner: '0x4ea830109b8df82d4e05f1fa7780b27f8f6dc7d7',
            initiator: '0x4ea830109b8df82d4e05f1fa7780b27f8f6dc7d7',
            coupon: '446',
            principal: '5000000000000000000000',
            lendTimestamp: '1731918321',
            maturityTimestamp: '1732597200',
            partnerFeeBPS: '0',
            partnerId: '0x0000000000000000000000000000000000000000000000000000000000000000',
            status: 'Active',
            lendTransactionHash: '0x9296573b388d21dd6eaba89b6d7eb94ab10c49bd2ddaaa12af0837e0d1b3bbed',
            maturityDate: '26 November, 2024',
            lendingDate: '18 November, 2024',
            duration: { staticDuration: [Object], dynamicDuration: [Object] },
            progress: 86,
            earning: {
            fixedCurrentIncome: '4184361561213991769',
            fixedApproximateIncome: '4867220196759259259',
            floatingCurrentIncome: '10998006209542851035',
            floatingApproximateIncome: '17551236173557347792',
            totalCurrentIncome: '15182367770756842804',
            approximateIncome: '22418456370316607051'
            }
        }
    ],
    claimed: [],
    totalLoaned: '68513000000000000000000',
    totalEarned_fixed: '37990366974909979411',
    totalEarned_bonus: '99001679425934920726'
  }
}
  • positions is an array of all positions.
  • active is an array of active positions.
  • claimed is an array of claimed positions.
  • totalLoaned is the total amount of principal loaned.
  • totalEarned_fixed is the total fixed income earned.
  • totalEarned_bonus is the total bonus income earned.

An Example from Parabol


Positions