@kasufinance/kasu-sdk 2.11.0 → 2.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -118,7 +118,7 @@ You can also pass a whole `ChainConfigEntry` instead of a chain key.
118
118
  | ----------------- | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
119
119
  | `kasu.strategies` | `getAll()`, `getVisible()`, `getById()`, `getPlatformStats()`, `getPerformanceFeePercent()`, `calculateDepositLimits()`, `getRiskPerformance(poolId)`, `getOriginator(poolId)` | Browse pools, APY, capacity, risk, originator |
120
120
  | `kasu.deposits` | `deposit()`, `withdraw()`, `withdrawMax()`, `buildKycParams()`, `isClearingPending()` | Submit transactions |
121
- | `kasu.portfolio` | `getPositions()`, `getTransactionHistory()`, `getRequestStates()` | Lender balances, yield, history |
121
+ | `kasu.portfolio` | `getPositions()`, `getYieldHistory()`, `getTransactionHistory()`, `getRequestStates()` | Lender balances, yield, per-cycle earnings (net, in the chain's own stable token), history |
122
122
  | `kasu.flows` | `deposit(ports)`, `withdraw(ports?)` | Headless transaction pipelines |
123
123
  | `kasu.calls` | `requestWithdrawal(params)`, `cancelDepositRequest(poolId, dNftId)`, `cancelWithdrawalRequest(poolId, wNftId)`, `withdrawAtExpiry(poolId, lockId)` | Encoded calls for a sponsored relay (read, then encode — never sends) |
124
124
 
@@ -132,6 +132,16 @@ return an empty list; pass it straight through. `SdkConfig` normalises an empty
132
132
  exclusion list to `['']`, because the subgraph reads `id_not_in: []` as "match
133
133
  nothing" and would otherwise hide every pool.
134
134
 
135
+ `kasu.portfolio.getYieldHistory(user, { fromEpoch?, count? })` returns one
136
+ `{ epochId, epochEnd, poolId, trancheId, netYield }` per settled cycle the
137
+ lender held shares in; `aggregateYieldHistory(entries, { poolId? })` turns it
138
+ into chart bars. `netYield` is NET of the performance fee and in the
139
+ deployment's own stable token (AUDD on XDC AUDD — convert before showing USD);
140
+ `epochEnd` is unix seconds. For a fixed-term lock holder the bars can sum to
141
+ slightly more than lifetime interest (up to about 0.2 %, top-ups are valued at
142
+ today's share price), so show "earned to date" from the lifetime figure, not
143
+ from the sum of the bars.
144
+
135
145
  ## Domain helpers
136
146
 
137
147
  Pure functions shared by every Kasu frontend. They return **numbers and codes,