add flow index. (#576)

This commit is contained in:
Yevhen Baidiuk 2023-11-05 15:37:58 +01:00 committed by GitHub
parent 365a21b203
commit 5d8386db86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -202,6 +202,12 @@ export const ChannelTable = () => {
percentOnlineText: `${getPercent(timeOnline, timeOffline)}%`,
activityPercent: getPercent(c.sent, c.received),
activityPercentText: `${getPercent(c.sent, c.received)}%`,
// sats flow per 1 sats capacity in 1 month
activityFlowIndex: (
((c.sent + c.received) / c.capacity / c.channel_age) *
144 *
30
).toFixed(2),
balancePercent: getPercent(c.local_balance, c.remote_balance),
balancePercentText: `${getPercent(c.local_balance, c.remote_balance)}%`,
proportionalBars: (
@ -465,6 +471,11 @@ export const ChannelTable = () => {
accessorKey: 'activityPercentText',
sortingFn: numberStringSorting('activityPercent'),
},
{
header: 'Flow index',
accessorKey: 'activityFlowIndex',
sortingFn: numberStringSorting('activityFlowIndex'),
},
],
},
{