[ENG/ITA] Expanding My Personal Discord Notification System

@arc7icwolf · 2025-09-08 19:05 · Olio di Balena


La versione italiana si trova sotto quella inglese

The italian version is under the english one


Expanding My Personal Discord Notification System

It’s time to get back to coding with Python! After a long break, partly due to the summer holidays that, for various reasons, kept me away from my desktop PC, now that I’m back to being 100% operational (😭) I have no more excuses not to start working on some new project. And since my interest in arbitrage is currently at an [all-time high](https://peakd.com/hive-146620/@arc7icwolf/engita-target-achieved-5000-leo-plus-over-150-earned-in-arbitrage-3ra), I decided to **expand my personal Discord notification system**. Currently, I only receive Discord notifications related to completed swaps by my script dedicated to arbitraging some [bridges connecting Hive and Hive-Engine](https://peakd.com/hive-146620/@arc7icwolf/engita-earning-hive-thanks-to-my-scripts-bridges-arbitrage-and-grid-trading-5sz): when my script executes a swap, I get a Discord notification telling me both that the operation was completed and the amount sent. ![](https://files.peakd.com/file/peakd-hive/arc7icwolf/23u5XNHnpNSfJ8jHTphLMoEvQfhnLWcEcuXukGbgcGGA3FsaxfQg5GwKkmTv6w1CLNZsx.jpg) This way, I know when my funds are moved and I can check, as soon as I have time, that the operation was successfully completed. My current goal is to expand this system and use it for other types of arbitrage operations as well. Specifically, I want to set up notifications to alert me of arbitrage opportunities involving the LEO token so that I no longer have to manually monitor the involved platforms and can take action only when there’s a real opportunity. Here’s the function that handles sending notifications, which I reused from one of my previous scripts:
def notification(content, user_id):
    webhook_url = "https://discord.com/api/webhooks/1359216089023906063/9PLtNmPUoSwm8UUStyxZzpxVjALWFdKcULtRF3kBJVBzBsVywnXZ4OmvInk8Tt5IhQdW"
    message = {
        "content": f"{content}! <@{user_id}>",
        "allowed_mentions": {"users": [user_id]},
    }
    response = get_response("POST", webhook_url, json=message)
    if response.status_code == 204:
        print("Notification sent successfully!")
    else:
        print("Error sending notification:", response.status_code)
And here’s the main function that compares LEO prices on Hive-Engine and Arbitrum to check whether there’s an opportunity to act on:
def compare_prices():
    tokens = ["hive", "ethereum"]
    prices = get_prices(tokens)
    one_hundred_dollars = {token: 100 / float(price) for token, price in prices.items()}

    leo_price = get_he_price("SWAP.HIVE:LEO")
    he_leo_amount = one_hundred_dollars['hive'] * float(leo_price) * 0.99

    maya_price = get_maya_price(one_hundred_dollars['ethereum'])
    arb_leo_amount = int(maya_price["expected_amount_out"]) / (10**8)

    threshold = 1.10

    if he_leo_amount > arb_leo_amount * threshold:
        print("HIVE --> LEO --> ARB.LEO --> ETH")
        notification(f"Buy LEO on H-E, Sell LEO on ARB", user_id)
    elif arb_leo_amount > he_leo_amount * threshold:
        print("ETH --> ARB.LEO --> LEO --> HIVE")
        notification(f"Buy LEO on ARB, Sell LEO on H-E", user_id)
    else:
        print("Nothing to see here")
It’s still a work in progress, though it already does the basics of what I need, so now I just want to: 1. refine it to make it cleaner and easier to use for other purposes too; 2. activate it, because I haven’t yet set up a proper workflow on GitHub Actions.
## Modularity As for the first point, it’s especially important because, once I’m done with LEO, I’d like to expand this notification system to other tokens to increase the number of opportunities I can catch and take advantage of. The biggest problem I’ll need to solve, however, is finding other tokens that, like LEO, can give me arbitrage opportunities. On Hive, I’ve had success in the past with GIFU… but currently, the volumes generated by that token are practically non-existent. Still on Hive, there are also SPS and DEC, which, in addition to existing on Hive-Engine, are also on BSC, Ethereum, and Base (only SPS on Base). However, SPS is probably a token that’s already actively arbitraged by many people, so I don’t think there’s anything interesting there for me. I’ll need to turn my attention to other chains and see if I can find tokens with cross-chain versions whose price differences I can try to arbitrage: if I find them, I’ll also have found the next token to add to my customized Discord notification system :)
>cover made with Bing AI and edited with GIMP >to support the #OliodiBalena community, @balaenoptera is 3% beneficiary of this post ![](https://images.ecency.com/DQmR3FkFbRrZAA3jYtS2bcrk6ZfoZzCM8W3HFbRBpXBwio3/divisorio_2.0_finale.png) *** If you've read this far, thank you! If you want to leave an upvote, a reblog, a follow, a comment... well, any sign of life is really much appreciated!


Versione italiana

Italian version


Espansione del Mio Sistema Personale di Notifiche Discord

E' tempo di tornare a maneggiare un po' di Python! Dopo un periodo di prolungata pausa, in parte dovute alle ferie estive che mi hanno tenuto per varie ragioni lontano dal mio pc desktop, ora che sono di nuovo tornato operativo al 100% (😭) non ho più scuse per non mettermi a lavorare a qualche nuovo progetto. E , dato che in questo momento il mio interesse per l'arbitraggio è ai [massimi storici](https://peakd.com/hive-146620/@arc7icwolf/engita-target-achieved-5000-leo-plus-over-150-earned-in-arbitrage-3ra), ho pensato di **espandere il mio personale sistema di notifiche Discord**. In realtà attualmente su Discord ricevo solo notifiche relative ad eventuali swaps completati dal mio script dedicato all'arbitraggio di alcuni [bridges che collegano tra loro Hive ed Hive-Engine](https://peakd.com/hive-146620/@arc7icwolf/engita-earning-hive-thanks-to-my-scripts-bridges-arbitrage-and-grid-trading-5sz): quando il mio script esegue uno swap, ricevo una notifica su Discord che mi avvisa sia del completamento dell'operazione, che dell'importo inviato. ![](https://files.peakd.com/file/peakd-hive/arc7icwolf/23u5XNHnpNSfJ8jHTphLMoEvQfhnLWcEcuXukGbgcGGA3FsaxfQg5GwKkmTv6w1CLNZsx.jpg) In questo modo so quando i miei fondi vengono spostati e posso controllare, appena ho tempo, che l'operazione sia andata correttamente a buon fine. Il mio obiettivo, adesso, è di espandere questo sistema e di utilizzarlo anche per operazioni di arbitraggio diverso. In particolare, vorrei intanto prevedere l'invio di notifiche che mi avvisino di possibilità di arbitraggio che riguardino il token LEO, così da non dover più tenere d'occhio manualmente le piattaforme coinvolte e potermi muovere solo quando effettivamente c'è una reale opportunità. La funzione che si occupa di inviare notifiche, e che ho ripreso da un mio precedente script, è questa:
def notification(content, user_id):
    webhook_url = "https://discord.com/api/webhooks/1359216089023906063/9PLtNmPUoSwm8UUStyxZzpxVjALWFdKcULtRF3kBJVBzBsVywnXZ4OmvInk8Tt5IhQdW"
    message = {
        "content": f"{content}! <@{user_id}>",
        "allowed_mentions": {"users": [user_id]},
    }
    response = get_response("POST", webhook_url, json=message)
    if response.status_code == 204:
        print("Notifica inviata con successo!")
    else:
        print("Errore nell'invio della notifica:", response.status_code)
Mentre questa è la funzione principale che si occupa di confrontare i prezzi di LEO su Hive-Engine ed Arbitrum e verificare se c'è o meno un'opportunità da cogliere:
def compare_prices():
    tokens = ["hive", "ethereum"]
    prices = get_prices(tokens)
    one_hundred_dollars = {token: 100 / float(price) for token, price in prices.items()}

    leo_price = get_he_price("SWAP.HIVE:LEO")
    he_leo_amount = one_hundred_dollars['hive'] * float(leo_price) * 0.99

    maya_price = get_maya_price(one_hundred_dollars['ethereum'])
    arb_leo_amount = int(maya_price["expected_amount_out"]) / (10**8)

    threshold = 1.10

    if he_leo_amount > arb_leo_amount * threshold:
        print("HIVE --> LEO --> ARB.LEO --> ETH")
        notification(f"Buy LEO on H-E, Sell LEO on ARB", user_id)
    elif arb_leo_amount > he_leo_amount * threshold:
        print("ETH --> ARB.LEO --> LEO --> HIVE")
        notification(f"Buy LEO on ARB, Sell LEO on H-E", user_id)
    else:
        print("Nothing to see here")
Si tratta di un lavoro ancora in corso, anche se di base fa già ciò che mi serve, per cui ora quel che voglio fare è semplicemente: 1) rifinirlo, in modo da renderlo più pulito e facilmente utilizzabile anche per altri scopi; 2) attivarlo, perchè per ora non ho ancora impostato un apposito workflow su GitHub Actions.
## Modularità Quanto al primo punto, è particolarmente importante perchè, una volta finito con LEO, mi piacerebbe espandere questo sistema di notifiche ad altri token, così da aumentare il numero di opportunità che potrei essere in grado di intercettare e sfruttare. Il più grande problema che dovrò risolvere sarà, però, trovare altri token che, come LEO, mi possano consentire di effettuare operazioni di arbitraggio. Su Hive, in passato, ho avuto successo con GIFU... ma attualmente i volumi generati da questo token sono praticamente inesistenti. Sempre su Hive abbiamo anche SPS e DEC, che oltre ad esistere su Hive-Engine, si trovano anche su BSC, Ethereum e Base (su quest'ultima solo SPS). Probabilmente però SPS è un token già attivamente arbitrato da molte persone, per cui non credo ci sia niente di interessante per me. Dovrò quindi rivolgere la mia attenzione ad altre chains e vedere se, da qualche parte, riuscirò a trovare altri token con versioni cross-chains le cui differenze di prezzo possa provare ad arbitrare: se le troverò, avrò anche trovato il prossimo token da aggiungere al mio sistema personalizzato di notifiche Discord :)
>cover realizzata con Bing AI ed editata con GIMP >a supporto della community #OliodiBalena, il 3% delle ricompense di questo post va a @balaenoptera ![](https://images.ecency.com/DQmR3FkFbRrZAA3jYtS2bcrk6ZfoZzCM8W3HFbRBpXBwio3/divisorio_2.0_finale.png) Se sei arrivato a leggere fin qui, grazie! Se hai voglia di lasciare un upvote, un reblog, un follow, un commento... be', un qualsiasi segnale di vita, in realtà, è molto apprezzato!

Posted Using INLEO

#hive-146620 #python #dev #coding #inleo #leodex #pob #pimp #cent #bee
Payout: 6.439 HBD
Votes: 126
More interactions (upvote, reblog, reply) coming soon.