lndg/gui/templates/channel.html
cryptosharks131 c63c065c6c
v1.3.0 (#120)
2022-08-26 20:56:46 -04:00

369 lines
23 KiB
HTML

{% extends "base.html" %}
{% block title %} {{ block.super }} - Channel Card{% endblock %}
{% block content %}
{% load humanize %}
{% if channel %}
<div class="w3-container w3-padding-small">
<h2>Details For Channel: {{ chan_id }} | Peer: <a href="{{ graph_links }}/{{ network }}node/{{ channel.remote_pubkey }}" target="_blank">{% if channel.alias != "" %}{{ channel.alias }}</a> ({{ channel.remote_pubkey }}){% else %}{{ channel.remote_pubkey }}</a>{% endif %}</h2>
<h3>Capacity: {{ channel.capacity|intcomma }} | Is Open: {{ channel.is_open }} | Is Active: {{ channel.is_active }} | Is Private: {{ channel.private }} | Channel Updates: {{ channel.num_updates|intcomma }}</h3>
<h4>Channel Point: <a href="{{ network_links }}/{{ network }}tx/{{ channel.funding_txid }}" target="_blank">{{ channel.funding_txid }}:{{ channel.output_index }}</a> | Opened In: <a href="{{ network_links }}/{{ network }}block/{{ channel.open_block }}" target="_blank">{{ channel.open_block|intcomma }}</a> | Opener: {% if channel.initiator == True %}Local{% else %}Remote{% endif %}</h4>
<h4>Outbound Liquidity: {{ channel.local_balance|intcomma }} ({{ channel.out_percent }}%) | Inbound Liquidity: {{ channel.remote_balance|intcomma }} ({{ channel.in_percent }}%)</h4>
</div>
<div class="w3-container w3-padding-small">
<h2>Routing Events</h2>
<h4>1-Day Routed Out: {{ channel.amt_routed_out_1day|intcomma }} ({{ channel.routed_out_1day|intcomma }}) | Routed In: {{ channel.amt_routed_in_1day|intcomma }} ({{ channel.routed_in_1day|intcomma }}) | Average Out: {{ channel.average_out_1day|intcomma }} | Average In: {{ channel.average_in_1day|intcomma }}</h4>
<h4>7-Day Routed Out: {{ channel.amt_routed_out_7day|intcomma }} ({{ channel.routed_out_7day|intcomma }}) | Routed In: {{ channel.amt_routed_in_7day|intcomma }} ({{ channel.routed_in_7day|intcomma }}) | Average Out: {{ channel.average_out_7day|intcomma }} | Average In: {{ channel.average_in_7day|intcomma }}</h4>
<h4>30-Day Routed Out: {{ channel.amt_routed_out_30day|intcomma }} ({{ channel.routed_out_30day|intcomma }}) | Routed In: {{ channel.amt_routed_in_30day|intcomma }} ({{ channel.routed_in_30day|intcomma }}) | Average Out: {{ channel.average_out_30day|intcomma }} | Average In: {{ channel.average_in_30day|intcomma }}</h4>
<h4>Lifetime Routed Out: {{ channel.amt_routed_out|intcomma }} ({{ channel.routed_out|intcomma }}) | Routed In: {{ channel.amt_routed_in|intcomma }} ({{ channel.routed_in|intcomma }}) | Average Out: {{ channel.average_out|intcomma }} | Average In: {{ channel.average_in|intcomma }}</h4>
</div>
<div class="w3-container w3-padding-small">
<h2>Rebalancing Events</h2>
<h4>1-Day Rebalanced Out: {{ channel.amt_rebal_out_1day|intcomma }} ({{ channel.rebal_out_1day|intcomma }}) | Rebalanced In: {{ channel.amt_rebal_in_1day|intcomma }} ({{ channel.rebal_in_1day|intcomma }}) | Success Rate: {{ channel.success_rate_1day }}% ({{ channel.success_1day }}/{{ channel.attempts_1day }})</h4>
<h4>7-Day Rebalanced Out: {{ channel.amt_rebal_out_7day|intcomma }} ({{ channel.rebal_out_7day|intcomma }}) | Rebalanced In: {{ channel.amt_rebal_in_7day|intcomma }} ({{ channel.rebal_in_7day|intcomma }}) | Success Rate: {{ channel.success_rate_7day }}% ({{ channel.success_7day }}/{{ channel.attempts_7day }})</h4>
<h4>30-Day Rebalanced Out: {{ channel.amt_rebal_out_30day|intcomma }} ({{ channel.rebal_out_30day|intcomma }}) | Rebalanced In: {{ channel.amt_rebal_in_30day|intcomma }} ({{ channel.rebal_in_30day|intcomma }}) | Success Rate: {{ channel.success_rate_30day }}% ({{ channel.success_30day }}/{{ channel.attempts_30day }})</h4>
<h4>Lifetime Rebalanced Out: {{ channel.amt_rebal_out|intcomma }} ({{ channel.rebal_out|intcomma }}) | Rebalanced In: {{ channel.amt_rebal_in|intcomma }} ({{ channel.rebal_in|intcomma }}) | Success Rate: {{ channel.success_rate }}% ({{ channel.success }}/{{ channel.attempts }})</h4>
</div>
<div class="w3-container w3-padding-small">
<h2>Profitability</h2>
<h4>1-Day Revenue: {{ channel.revenue_1day|intcomma }} | Costs: {{ channel.costs_1day|intcomma }} | Profits: {{ channel.profits_1day|intcomma }} [{{ channel.profits_vol_1day }}] | Assisted Revenues: {{ channel.revenue_assist_1day|intcomma }} | APY: {{ channel.apy_1day }}% | iAPY: {{ channel.assisted_apy_1day }}% | CV: {{ channel.cv_1day }}%</h4>
<h4>7-Day Revenue: {{ channel.revenue_7day|intcomma }} | Costs: {{ channel.costs_7day|intcomma }} | Profits: {{ channel.profits_7day|intcomma }} [{{ channel.profits_vol_7day }}] | Assisted Revenues: {{ channel.revenue_assist_7day|intcomma }} | APY: {{ channel.apy_7day }}% | iAPY: {{ channel.assisted_apy_7day }}% | CV: {{ channel.cv_7day }}%</h4>
<h4>30-Day Revenue: {{ channel.revenue_30day|intcomma }} | Costs: {{ channel.costs_30day|intcomma }} | Profits: {{ channel.profits_30day|intcomma }} [{{ channel.profits_vol_30day }}] | Assisted Revenues: {{ channel.revenue_assist_30day|intcomma }} | APY: {{ channel.apy_30day }}% | iAPY: {{ channel.assisted_apy_30day }}% | CV: {{ channel.cv_30day }}%</h4>
<h4>Lifetime Revenue: {{ channel.revenue|intcomma }} | Costs: {{ channel.costs|intcomma }} | Profits: {{ channel.profits|intcomma }} [{{ channel.profits_vol }}] | Assisted Revenues: {{ channel.revenue_assist|intcomma }} | APY: {{ channel.apy }}% | iAPY: {{ channel.assisted_apy }}% | CV: {{ channel.cv }}%</h4>
</div>
<div class="w3-container w3-padding-small" style="overflow-x: scroll">
<h2>Channel Settings</h2>
<table class="w3-table-all w3-centered w3-hoverable">
<tr>
<th>AF</th>
<th>Updated</th>
<th title="The value represents net flow --> (routed out - routed in) / capacity">7Day Flow</th>
<th title="The average rate earned outgoing on this channel">Out Rate</th>
<th title="The average rate paid for rebalances to refill this channel">Rebal Rate</th>
<th title="When revenue > 0 --> assisted revenue / revenue">Assisted Ratio</th>
<th>Adjustment</th>
<th title="A suggested fee rate based on the flow pattern over the last 7 days">Suggested Rate</th>
<th>Channel State</th>
<th>oRate</th>
<th>oBase</th>
<th>iRate</th>
<th>iBase</th>
<th title="When AR is ENABLED for the channel, the size of the rebalance attempts that should be tried during attempts to refill the channel.">Target Amt</th>
<th title="When AR is ENABLED, the maximum percentage amount of the local fee rate that can be used for the max rebalancing cost.">Max Cost %</th>
<th title="When AR is NOT ENABLED for the channel, keep pushing OUT the channel until its outbound liquidity falls below the oTarget%.">oTarget%</th>
<th title="When AR is ENABLED for the channel, keep pulling IN to the channel until its inbound liquidity falls below the iTarget%.">iTarget%</th>
<th title="When AR is ENABLED it will refill the channel with outbound liquidity.">AR</th>
<th>Rebal In?</th>
<th>Active</th>
</tr>
<tr>
<td {% if channel.auto_fees == False %}style="background-color: #fadbd5"{% else %}style="background-color: #a6dce2"{% endif %}>
<form action="/update_channel/" method="post">
{% csrf_token %}
<input type="submit" value="{% if channel.auto_fees == True %}Disable{% else %}Enable{% endif %}">
<input type="hidden" name="chan_id" value="{{ channel.chan_id }}">
<input type="hidden" name="update_target" value="8">
<input type="hidden" name="target" value="0">
</form>
</td>
<td {% if channel.eligible == True %}style="background-color: #fadbd5"{% else %}style="background-color: #a6dce2"{% endif %}>{{ channel.fees_updated|naturaltime }}</td>
<td>{% if channel.net_routed_7day > 0 %}OUT{% elif channel.net_routed_7day < 0 %}IN{% else %}---{% endif %}{% if channel.net_routed_7day != 0 %} | {{ channel.net_routed_7day }}{% endif %}</td>
<td>{{ channel.out_rate }}</td>
<td>{{ channel.rebal_ppm }}</td>
<td>{{ channel.assisted_ratio }}</td>
<td>{{ channel.adjustment }}</td>
<td>{{ channel.new_rate|intcomma }}</td>
<td {% if channel.local_disabled == True %}style="background-color: #fadbd5"{% else %}style="background-color: #a6dce2"{% endif %}>
{% if channel.is_active == True %}
<form action="/update_channel/" method="post">
{% csrf_token %}
<input type="submit" value="{% if channel.local_disabled == False %}Disable{% else %}Enable{% endif %}">
<input type="hidden" name="chan_id" value="{{ channel.chan_id }}">
<input type="hidden" name="update_target" value="7">
<input type="hidden" name="target" value="{% if channel.local_disabled == False %}0{% else %}1{% endif %}">
</form>
{% else %}
---
{% endif %}
</td>
<td {% if channel.local_disabled == True %}style="background-color: #fadbd5"{% else %}style="background-color: #a6dce2"{% endif %}>
<form action="/update_channel/" method="post">
{% csrf_token %}
<input style="text-align:center" id="target" type="number" min="0" max="100000" name="target" value="{{ channel.local_fee_rate }}">
<input type="hidden" name="chan_id" value="{{ channel.chan_id }}">
<input type="hidden" name="update_target" value="1">
</form>
</td>
<td {% if channel.local_disabled == True %}style="background-color: #fadbd5"{% else %}style="background-color: #a6dce2"{% endif %}>
<form action="/update_channel/" method="post">
{% csrf_token %}
<input style="text-align:center" id="target" type="number" min="0" max="100000" name="target" value="{{ channel.local_base_fee }}">
<input type="hidden" name="chan_id" value="{{ channel.chan_id }}">
<input type="hidden" name="update_target" value="0">
</form>
</td>
<td title="Fee Ratio: {{ channel.fee_ratio }}%" {% if channel.remote_disabled == True %}style="background-color: #fadbd5"{% else %}style="background-color: #a6dce2"{% endif %}>{{ channel.remote_fee_rate|intcomma }}</td>
<td {% if channel.remote_disabled == True %}style="background-color: #fadbd5"{% else %}style="background-color: #a6dce2"{% endif %}>{{ channel.remote_base_fee|intcomma }}</td>
<td>
<form action="/update_channel/" method="post">
{% csrf_token %}
<input style="text-align:center" id="target" type="number" min="0" max="100000000" name="target" value="{{ channel.ar_amt_target }}">
<input type="hidden" name="chan_id" value="{{ channel.chan_id }}">
<input type="hidden" name="update_target" value="2">
</form>
</td>
<td>
<form action="/update_channel/" method="post">
{% csrf_token %}
<input style="text-align:center" id="target" type="number" min="0" max="100" name="target" value="{{ channel.ar_max_cost }}">
<input type="hidden" name="chan_id" value="{{ channel.chan_id }}">
<input type="hidden" name="update_target" value="6">
</form>
</td>
<td {% if channel.auto_rebalance == False %}style="background-color: #80ced6"{% else %}style="background-color: #f18973"{% endif %}>
<form action="/update_channel/" method="post">
{% csrf_token %}
<input style="text-align:center" id="target" type="number" min="0" max="100" name="target" value="{{ channel.ar_out_target }}">
<input type="hidden" name="chan_id" value="{{ channel.chan_id }}">
<input type="hidden" name="update_target" value="4">
</form>
</td>
<td {% if channel.auto_rebalance == True %}style="background-color: #80ced6"{% else %}style="background-color: #f18973"{% endif %}>
<form action="/update_channel/" method="post">
{% csrf_token %}
<input style="text-align:center" id="target" type="number" min="0" max="100" name="target" value="{{ channel.ar_in_target }}">
<input type="hidden" name="chan_id" value="{{ channel.chan_id }}">
<input type="hidden" name="update_target" value="3">
</form>
</td>
<td {% if channel.auto_rebalance == True %}style="background-color: #80ced6"{% else %}style="background-color: #f18973"{% endif %}>
<form action="/update_channel/" method="post">
{% csrf_token %}
<input type="submit" value="{% if channel.auto_rebalance == True %}Disable{% else %}Enable{% endif %}">
<input type="hidden" name="chan_id" value="{{ channel.chan_id }}">
<input type="hidden" name="update_target" value="5">
<input type="hidden" name="target" value="0">
</form>
</td>
<td {% if channel.inbound_can >= 1 and channel.fee_check < 100 and channel.auto_rebalance == True %}style="background-color: #a6dce2">True ({{ channel.steps }}){% else %}style="background-color: #fadbd5">False{% endif %}</td>
<td title="{% if channel.is_active == True %}Uptime: {{ channel.last_update|naturaltime|slice:":-4" }}{% else %}Downtime: {{ channel.last_update|naturaltime|slice:":-4" }}{% endif %}" {% if channel.is_active == True %}style="background-color: #a6dce2">True{% else %}style="background-color: #fadbd5">False{% endif %}</td>
</tr>
</table>
</div>
{% if outgoing_htlcs %}
<div class="w3-container w3-padding-small">
<h2>Outgoing HTLCs</h2>
<table class="w3-table-all w3-centered w3-hoverable">
<tr>
<th>Forwarding Channel</th>
<th>Forwarding Alias</th>
<th>Amount</th>
<th>Expiration Height</th>
<th width=35%>Hash Lock</th>
</tr>
{% for htlc in outgoing_htlcs %}
<tr>
<td>{{ htlc.forwarding_channel }}</td>
<td>{% if htlc.forwarding_alias == '' %}---{% else %}{{ htlc.forwarding_alias }}{% endif %}</td>
<td>{{ htlc.amount|intcomma }}</td>
<td>{{ htlc.expiration_height|intcomma }}</td>
<td>{{ htlc.hash_lock }}</td>
</tr>
{% endfor %}
</table>
</div>
{% endif %}
{% if incoming_htlcs %}
<div class="w3-container w3-padding-small">
<h2>Incoming HTLCs</h2>
<table class="w3-table-all w3-centered w3-hoverable">
<tr>
<th>Forwarding Channel</th>
<th>Forwarding Alias</th>
<th>Amount</th>
<th>Expiration Height</th>
<th width=35%>Hash Lock</th>
</tr>
{% for htlc in incoming_htlcs %}
<tr>
<td>{{ htlc.forwarding_channel }}</td>
<td>{% if htlc.forwarding_alias == '' %}---{% else %}{{ htlc.forwarding_alias }}{% endif %}</td>
<td>{{ htlc.amount|intcomma }}</td>
<td>{{ htlc.expiration_height|intcomma }}</td>
<td>{{ htlc.hash_lock }}</td>
</tr>
{% endfor %}
</table>
</div>
{% endif %}
{% if forwards %}
<div class="w3-container w3-padding-small">
<h2>Last 5 <a href="/forwards" target="_blank">Payments Routed</a></h2>
<table class="w3-table-all w3-centered w3-hoverable">
<tr>
<th>Timestamp</th>
<th>Amount In</th>
<th>Amount Out</th>
<th>Channel In Alias</th>
<th>Channel Out Alias</th>
<th>Channel In Id</th>
<th>Channel Out Id</th>
<th>Fees Earned</th>
<th>PPM Earned</th>
</tr>
{% for forward in forwards %}
<tr>
<td title="{{ forward.forward_date }}">{{ forward.forward_date|naturaltime }}</td>
<td>{{ forward.amt_in|intcomma }}</td>
<td>{{ forward.amt_out|intcomma }}</td>
<td>{% if forward.chan_in_alias == '' %}---{% else %}{{ forward.chan_in_alias }}{% endif %}</td>
<td>{% if forward.chan_out_alias == '' %}---{% else %}{{ forward.chan_out_alias }}{% endif %}</td>
<td><a href="/channel?={{ forward.chan_id_in }}" target="_blank">{{ forward.chan_id_in }}</a></td>
<td><a href="/channel?={{ forward.chan_id_out }}" target="_blank">{{ forward.chan_id_out }}</a></td>
<td>{{ forward.fee|intcomma }}</td>
<td>{{ forward.ppm|intcomma }}</td>
</tr>
{% endfor %}
</table>
</div>
{% endif %}
{% if rebalances %}
<div class="w3-container w3-padding-small">
<h2>Last 5 <a href="/rebalancing" target="_blank">Rebalance Requests</a></h2>
<table class="w3-table-all w3-centered w3-hoverable">
<tr>
<th>Requested</th>
<th>Start</th>
<th>Stop</th>
<th>Scheduled Duration</th>
<th>Actual Duration</th>
<th>Value</th>
<th>Fee Limit</th>
<th>Target PPM</th>
<th>Fees Paid</th>
<th>Last Hop Alias</th>
<th>Status</th>
</tr>
{% for rebalance in rebalances %}
<tr>
<td title="{{ rebalance.requested }}">{{ rebalance.requested|naturaltime }}</td>
<td {% if rebalance.status == 0 %}>---{% else %}title="{{ rebalance.start }}">{{ rebalance.start|naturaltime }}{% endif %}</td>
<td {% if rebalance.status > 1 %}title="{{ rebalance.stop }}">{{ rebalance.stop|naturaltime }}{% else %}>---{% endif %}</td>
<td>{{ rebalance.duration }} minutes</td>
<td>{% if rebalance.status == 2 %}{{ rebalance.stop|timeuntil:rebalance.start }}{% else %}---{% endif %}</td>
<td>{{ rebalance.value|intcomma }}</td>
<td>{{ rebalance.fee_limit|intcomma }}</td>
<td>{{ rebalance.ppm|intcomma }}</td>
<td>{% if rebalance.status == 2 %}{{ rebalance.fees_paid|intcomma }}{% else %}---{% endif %}</td>
<td>{% if rebalance.target_alias == '' %}None Specified{% else %}{{ rebalance.target_alias }}{% endif %}</td>
<td title="{{ rebalance.status }}">{% if rebalance.status == 0 %}Pending{% elif rebalance.status == 1 %}In-Flight{% elif rebalance.status == 2 %}<a href="/route?={{ rebalance.payment_hash }}" target="_blank">Successful</a>{% elif rebalance.status == 3 %}Timeout{% elif rebalance.status == 4 %}No Route{% elif rebalance.status == 5 %}Error{% elif rebalance.status == 6 %}Incorrect Payment Details{% elif rebalance.status == 7 %}Insufficient Balance{% elif rebalance.status == 400 %}Rebalancer Request Failed{% elif rebalance.status == 408 %}Rebalancer Request Timeout{% else %}{{ rebalance.status }}{% endif %}</td>
</tr>
{% endfor %}
</table>
</div>
{% endif %}
{% if payments %}
<div class="w3-container w3-padding-small">
<h2>Last 5 <a href="/payments" target="_blank">Payments Sent</a></h2>
<table class="w3-table-all w3-centered w3-hoverable">
<tr>
<th>Timestamp</th>
<th width=28%>Hash</th>
<th width=6%>Value</th>
<th width=6%>Fee Paid</th>
<th width=6%>PPM Paid</th>
<th width=6%>Status</th>
<th width=12%>Chan Out Alias</th>
<th width=12%>Chan Out ID</th>
<th width=4%>Route</th>
<th width=6%>Keysend</th>
</tr>
{% for payment in payments %}
<tr>
<td title="{{ payment.creation_date }}">{{ payment.creation_date|naturaltime }}</td>
<td>{{ payment.payment_hash }}</td>
<td>{{ payment.value|add:"0"|intcomma }}</td>
<td>{{ payment.fee|intcomma }}</td>
<td>{{ payment.ppm|intcomma }}</td>
<td>{% if payment.status == 1 %}In-Flight{% elif payment.status == 2 %}Succeeded{% elif payment.status == 3 %}Failed{% else %}{{ payment.status }}{% endif %}</td>
<td>{% if payment.status == 2 %}{% if payment.chan_out_alias == '' %}---{% else %}{{ payment.chan_out_alias }}{% endif %}{% else %}---{% endif %}</td>
<td>{% if payment.status == 2 %}{{ payment.chan_out }}{% else %}---{% endif %}</td>
<td>{% if payment.status == 2 %}<a href="/route?={{ payment.payment_hash }}" target="_blank">Open</a>{% else %}---{% endif %}</td>
<td title="{{ payment.message }}">{% if payment.keysend_preimage != None %}Yes{% else %}No{% endif %}</td>
</tr>
{% endfor %}
</table>
</div>
{% endif %}
{% if invoices %}
<div class="w3-container w3-padding-small">
<h2>Last 5 <a href="/invoices" target="_blank">Payments Received</a></h2>
<table class="w3-table-all w3-centered w3-hoverable">
<tr>
<th>Created</th>
<th>Settled</th>
<th width=25%>Payment Hash</th>
<th>Value</th>
<th>Amount Paid</th>
<th>State</th>
<th>Channel In Alias</th>
<th width=10%>Channel In</th>
<th><a href="/keysends" target="_blank">Keysend</a></th>
</tr>
{% for invoice in invoices %}
<tr>
<td title="{{ invoice.creation_date }}">{{ invoice.creation_date|naturaltime }}</td>
<td title="{{ invoice.settle_date }}">{% if invoice.state == 1 %}{{ invoice.settle_date|naturaltime }}{% else %}---{% endif %}</td>
<td>{{ invoice.r_hash }}</td>
<td>{{ invoice.value|add:"0"|intcomma }}</td>
<td>{% if invoice.state == 1 %}{{ invoice.amt_paid|intcomma }}{% else %}---{% endif %}</td>
<td>{% if invoice.state == 0 %}Open{% elif invoice.state == 1 %}Settled{% elif invoice.state == 2 %}Canceled{% else %}{{ invoice.state }}{% endif %}</td>
<td>{% if invoice.state == 1 %}{% if invoice.chan_in_alias == '' %}---{% else %}{{ invoice.chan_in_alias }}{% endif %}{% else %}---{% endif %}</td>
<td>{% if invoice.state == 1 and invoice.chan_in != None %}<a href="/channel?={{ invoice.chan_in }}" target="_blank">{{ invoice.chan_in }}</a>{% else %}---{% endif %}</td>
<td title="{{ invoice.message }}">{% if invoice.keysend_preimage != None %}Yes{% else %}No{% endif %}</td>
</tr>
{% endfor %}
</table>
</div>
{% endif %}
{% if failed_htlcs %}
<div class="w3-container w3-padding-small">
<h2>Last 5 <a href="/failed_htlcs" target="_blank">Failed HTLCs</a></h2>
<table class="w3-table-all w3-centered w3-hoverable">
<tr>
<th>Timestamp</th>
<th>Chan In ID</th>
<th>Chan Out ID</th>
<th>Chan In Alias</th>
<th>Chan Out Alias</th>
<th>Forward Amount</th>
<th>Actual Outbound</th>
<th>Potential Fee</th>
<th>HTLC Failure</th>
<th>Failure Detail</th>
</tr>
{% for failed_htlc in failed_htlcs %}
<tr>
<td title="{{ failed_htlc.timestamp }}">{{ failed_htlc.timestamp|naturaltime }}</td>
<td><a href="/channel?={{ failed_htlc.chan_id_in }}" target="_blank">{{ failed_htlc.chan_id_in }}</a></td>
<td><a href="/channel?={{ failed_htlc.chan_id_out }}" target="_blank">{{ failed_htlc.chan_id_out }}</a></td>
<td>{% if failed_htlc.chan_in_alias == '' %}---{% else %}{{ failed_htlc.chan_in_alias }}{% endif %}</td>
<td>{% if failed_htlc.chan_out_alias == '' %}---{% else %}{{ failed_htlc.chan_out_alias }}{% endif %}</td>
<td>{{ failed_htlc.amount|intcomma }}</td>
<td>{{ failed_htlc.chan_out_liq|intcomma }} ({{ failed_htlc.chan_out_pending|intcomma }})</td>
<td>{{ failed_htlc.missed_fee|intcomma }}</td>
<td>{% if failed_htlc.wire_failure == 15 %}Temporary Channel Failure{% elif failed_htlc.wire_failure == 18 %}Unknown Next Peer{% elif failed_htlc.wire_failure == 12 %}Fee Insufficient{% else %}{{ failed_htlc.wire_failure }}{% endif %}</td>
<td>{% if failed_htlc.failure_detail == 1 %}---{% elif failed_htlc.failure_detail == 5 %}HTLC Exceeds Max{% elif failed_htlc.failure_detail == 6 %}Insufficient Balance{% elif failed_htlc.failure_detail == 20 %}Invalid Keysend{% elif failed_htlc.failure_detail == 22 %}Circular Route{% else %}{{ failed_htlc.failure_detail }}{% endif %}</td>
</tr>
{% endfor %}
</table>
<h2>Failed Outgoing HTLC Events Due To Insufficient Balance</h2>
<h4>1-Day: {{ channel.failed_out_1day }} | 7-Day: {{ channel.failed_out_7day }} | 30-Day: {{ channel.failed_out_30day }} | Lifetime: {{ channel.failed_out }}</h4>
</div>
{% endif %}
{% endif %}
{% if not channel %}
<div class="w3-container w3-padding-small">
<center><h1>No data found for this channel!</h1></center>
</div>
{% endif %}
{% endblock %}