Skip to content

Commit

Permalink
Add more info for chanels and fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
223880 committed Aug 7, 2024
1 parent 4331fbd commit aaaa234
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ def recommend_channels(channels):
if channel.outbound_capacity > 1000000:
if channel.local_balance > channel.remote_balance:
if channel.outbound_capacity > channel.inbound_capacity:
recommended.append(channel)
if channel.local_balance / channel.remote_balance > 0.5:
if channel.local_balance / channel.remote_balance < 2:
recommended.append(channel)

return recommended
2 changes: 2 additions & 0 deletions lnd_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ def recommend_channels():
for channel in channels.channels:
if channel.remote_balance > 1000000:
if channel.local_balance > 1000000:
if channel.local_balance / channel.remote_balance > 0.5:
if channel.local_balance / channel.remote_balance < 2:
recommended.append(channel)
return recommended
6 changes: 4 additions & 2 deletions nostr_ln_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ def recommend_channels():
channels = lnd.list_channels()
recommended = []
for channel in channels.channels:
if channel.remote_balance > 1000000: # Example criterion
recommended.append(channel)
if channel.remote_balance > 1000000:
if channel.local_balance / channel.remote_balance > 0.5:
if channel.local_balance / channel.remote_balance < 2:
recommended.append(channel)
return recommended

def handle_nostr_event(event):
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name="nostr_ln_bot",
version="1.0.0-beta",
description="Nostr bot for Lightning Network channel recommendations",
author="22388o", "Rsync25",
author=["22388o", "Rsync25"],
url="https://github.com/AreaLayer/nostr-ln-bot-channel",
packages=find_packages(),
install_requires=[
Expand All @@ -22,4 +22,4 @@
"Operating System :: OS Independent",
],
python_requires='>=3.7',
)
)

0 comments on commit aaaa234

Please sign in to comment.