@kasufinance/kasu-sdk 2.15.0 → 2.16.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 +16 -0
- package/dist/bundle.cjs.js +911 -205
- package/dist/bundle.esm.js +911 -205
- package/dist/domain/yield-history.d.ts +25 -1
- package/dist/domain/yield-history.js +41 -11
- package/dist/domain/yield-history.js.map +1 -1
- package/dist/services/Portfolio/portfolio.d.ts +54 -1
- package/dist/services/Portfolio/portfolio.js +357 -80
- package/dist/services/Portfolio/portfolio.js.map +1 -1
- package/dist/services/Portfolio/queries.d.ts +16 -0
- package/dist/services/Portfolio/queries.js +119 -2
- package/dist/services/Portfolio/queries.js.map +1 -1
- package/dist/services/Portfolio/types.d.ts +94 -6
- package/dist/services/Portfolio/yield-history.d.ts +148 -10
- package/dist/services/Portfolio/yield-history.js +241 -31
- package/dist/services/Portfolio/yield-history.js.map +1 -1
- package/dist/services/UserLending/user-lending.d.ts +16 -0
- package/dist/services/UserLending/user-lending.js +24 -0
- package/dist/services/UserLending/user-lending.js.map +1 -1
- package/dist/services/shared.d.ts +7 -0
- package/dist/services/shared.js +48 -0
- package/dist/services/shared.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/yield-history.ts +47 -11
- package/src/services/Portfolio/portfolio.ts +559 -126
- package/src/services/Portfolio/queries.ts +119 -2
- package/src/services/Portfolio/types.ts +91 -6
- package/src/services/Portfolio/yield-history.ts +405 -56
- package/src/services/UserLending/user-lending.ts +46 -0
- package/src/services/shared.ts +48 -0
package/README.md
CHANGED
|
@@ -142,6 +142,22 @@ slightly more than lifetime interest (up to about 0.2 %, top-ups are valued at
|
|
|
142
142
|
today's share price), so show "earned to date" from the lifetime figure, not
|
|
143
143
|
from the sum of the bars.
|
|
144
144
|
|
|
145
|
+
Each cycle's interest is paired with the shares in force when that cycle's
|
|
146
|
+
clearing applied it — before the clearing accepted any request — so a
|
|
147
|
+
withdrawal the pool manager accepted between clearings is out of the next
|
|
148
|
+
cycle's figures, and the newest bar equals `getPositions`' last-epoch figure.
|
|
149
|
+
|
|
150
|
+
The subgraph counts a lender's shares as a ledger of accepted deposits and
|
|
151
|
+
withdrawals. Shares moved to or from a wallet any other way are not on it.
|
|
152
|
+
`getPositions` compares the ledger with the chain AT THE BLOCK THE SUBGRAPH
|
|
153
|
+
ANSWERED AT (so indexing lag is never a fault). Where they disagree it reads
|
|
154
|
+
the tranche balances from the chain, so a balance is never negative, and
|
|
155
|
+
sets `ledgerMismatch` on the pool. `ledger-exceeds-chain` (the wallet sent
|
|
156
|
+
shares away) withholds the pool's last-cycle figures and leaves the pool out
|
|
157
|
+
of `getYieldHistory`. An `investedAmount` raised to 0 carries
|
|
158
|
+
`investedAmountFloored`. Lifetime figures stay ledger figures, which include
|
|
159
|
+
the moved principal.
|
|
160
|
+
|
|
145
161
|
`kasu.strategies.getPoolTvlHistory(poolId, { fromEpoch?, count?, timeoutMs?,
|
|
146
162
|
signal? })` returns the strategy's TVL (total lent by everyone) as
|
|
147
163
|
`{ epochId, timestamp, tvl, kind }[]`, ascending in time: one
|