[ENG/ITA] Looking for New Arbitrage Opportunities with Python
La versione italiana si trova sotto quella inglese
The italian version is under the english one
Looking for New Arbitrage Opportunities with Python
To date, arbitrage has proven to be one of the most effective and interesting techniques I’ve found to earn cryptocurrencies.
By now, I’ve encountered and managed to leverage several opportunities, as I’ve previously shared in some of my posts:
- [ENG/ITA] Target Achieved: 5000 LEO! Plus, Over 150$ Earned in Arbitrage
- [ENG/ITA] Catched a Good Arbitrage Opportunity for 110 HIVE! And Rising My GIFU to 150.000
- [ENG/ITA] Earning HIVE Thanks to My Scripts: Bridges Arbitrage and Grid Trading
Enough to make me reflect and ask myself: “how much potential is there in this technique?”
Because if I’ve already found three different opportunities on Hive, how many more could be out there? And what would happen if I could leverage them in a more systematic way?
These are questions I’d like to find answers to, because if what I’ve encountered so far isn’t just a lucky streak, then arbitrage could be the way I’ve been looking for years to take my crypto investment to the next level.
Not only that: over the past year and a half I’ve learned some Python basics, becoming capable of creating small scripts useful for collecting data or performing recurring operations in an automated way.
By combining these two elements — arbitrage and programming — I’ve been able to exploit the opportunities that came my way much more effectively than if I had done everything manually; in fact, many opportunities I wouldn’t have even noticed if it weren’t for some of the scripts I created.
For this reason, and even more so, in the past few weeks I’ve been trying to consistently dedicate myself to creating a new script, one that could allow me, in the future, to significantly expand my ability to spot opportunities and use them to generate profit.
SPS and DEC
The testing ground for this work will be the main Splinterlands tokens, SPS and DEC, which have their native versions on Hive-Engine but also offer wrapped versions on other chains, such as Ethereum, Base, and Binance Smart Chain.
They are therefore the perfect proving ground for trying to implement my idea, creating a script that monitors their price and — to start — notifies me of any fluctuations via Discord, giving me the chance, if an opportunity is confirmed, to perform an arbitrage operation.
The core of this script is the playwright
library, which allows simulating browser behavior and makes it much easier to interact with a multitude of DEXs.
with sync_playwright() as p:
print("🌐 Starting browser...")
browser = p.chromium.launch(
headless=False,
slow_mo=200, # Add a delay between actions
args=["--disable-blink-features=AutomationControlled"],
)
page = browser.new_page()
page.set_default_timeout(90000) # Global timeout
# Warm-up
page.goto("https://example.com", wait_until="domcontentloaded")
Is this the best solution? The most efficient? The most professional?
Not even close… but it’s the simplest, the one that allows me to easily reuse my script for other DEXs, the one that doesn’t require learning a ton of new things without being sure they’ll be useful.
Thanks to the script I’m working on, I can easily simulate swap operations involving SPS and DEC across different decentralized exchanges, with the data stored in a dedicated .json
file:
{
"sps": [
{
"dex": "pancakeswap",
"url": "https://pancakeswap.finance/swap?chain=bsc&outputCurrency=0x1633b7157e7638C4d6593436111Bf125Ee74703F&inputCurrency=0x2170Ed0880ac9A755fd29B2688956BD959F933F8"
},
{
"dex": "aerodrome",
"url": "https://aerodrome.finance/swap?from=0x4200000000000000000000000000000000000006&to=0x578661e9a09eee6b2cd97d4ded1ccbae7b8516b9&chain0=8453&chain1=8453"
},
{
"dex": "uniswap",
"url": "https://app.uniswap.org/swap?inputCurrency=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2&outputCurrency=0x00813E3421E1367353BfE7615c7f7f133C89df74&chain=1"
}
],
"dec": [
{
"dex": "pancakeswap",
"url": "https://pancakeswap.finance/swap?chain=bsc&network=56&network=97&network=1&network=8453&network=204&network=324&network=1101&network=59144&network=42161&search=sps&inputCurrency=0x2170Ed0880ac9A755fd29B2688956BD959F933F8&outputCurrency=0xE9D7023f2132D55cbd4Ee1f78273CB7a3e74F10A"
},
{
"dex": "uniswap",
"url": "https://app.uniswap.org/swap?inputCurrency=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2&outputCurrency=0x9393fdc77090f31c7db989390d43f454b1a6e7f3&chain=1"
}
]
}
The URLs already point to the token pairs I’m interested in, allowing me to simply input the amount I want to swap and read the result.
The next step will be to add the monitoring of the pools on Hive-Engine — which will take only a few minutes since I already have suitable scripts — and then implement the notification system — also already ready.
After that, all that remains is to wait and see if opportunities arise: if they do and I can exploit them, not only will I have a fourth confirmation that this technique has potential, but I’ll also be ready to expand the system to other tokens, increasing the number I monitor… and with it my ability to generate profits.
cover made with Grok AI and edited with GIMP
to support the #OliodiBalena community, @balaenoptera is 3% beneficiary of this post
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
Alla Ricerca di Nuove Opportunità di Arbitraggio con Python
Ad oggi l'arbitraggio si è rivelato come una delle tecniche più efficaci ed interessanti che abbia trovato per guadagnare cryptovalute.
A questo punto sono diverse le occasioni che mi sono capitate e che sono riuscito a sfruttare, come ho raccontato in precedenza in alcuni dei miei post:
- [ENG/ITA] Target Achieved: 5000 LEO! Plus, Over 150$ Earned in Arbitrage
- [ENG/ITA] Catched a Good Arbitrage Opportunity for 110 HIVE! And Rising My GIFU to 150.000
- [ENG/ITA] Earning HIVE Thanks to My Scripts: Bridges Arbitrage and Grid Trading
Abbastanza da farmi riflettere e portarmi a chiedere: "quanto potenziale c'è in questa tecnica?"
Perchè se ho trovato già 3 diverse opportunità su Hive, quante altre possono essercene là fuori? E che cosa succederebbe se riuscissi a sfruttarle in maniera più sistematica?
Domande a cui mi piacerebbe trovare una risposta, perchè se ciò che mi è capitato sinora non è stato soltanto una fortunata serie di casi, allora l'arbitraggio potrebbe essere quel modo che da anni sto cercando per portare il mio crypto-investimento ad un livello superiore.
Non solo: nel corso dell'ultimo anno e mezzo ho imparato un po' di basi di Python, diventando capace di creare piccoli script utili per raccogliere dati o effettuare operazioni ricorrenti in maniera automatizzata.
Combinando questi due elementi - arbitraggio e programmazione - sono riuscito a sfruttare le opportunità che mi si sono presentate davanti in maniera molto più efficace che se avessi dovuto fare tutto a mano; tante opportunità, in realtà, non le avrei nemmeno notate se non fosse stato per alcuni degli script che ho creato.
Per cui, ed a maggior ragione, in queste ultime settimane sto cercando di dedicarmi con costanza alla creazione di un nuovo script, uno che potrebbe consentirmi, un domani, di ampliare notevolmente la mia capacità di cogliere opportunità e di poterle così sfruttare per realizzare un guadagno.
SPS e DEC
Il campo di prova di questo mio lavoro saranno i principali token di Splinterlands, ossia SPS e DEC, che hanno le loro versioni native su Hive-Engine ma offrono poi versioni wrapped su altre chain, come Ethereum, Base e Binance Smart Chain.
Sono quindi il banco di prova perfetto per provare a mettere in pratica la mia idea, creando uno script che monitori il loro prezzo e - per iniziare - mi avvisi di eventuali fluttuazioni attraverso Discord, così da darmi modo, se l'opportunità è confermata, di compiere un'operazione di arbitraggio.
La base di questo script è la libreria playwright
, che consente di simulare il comportamento di un browser e rende molto più semplice interagire con una moltitudine di dex.
with sync_playwright() as p:
print("🌐 Starting browser...")
browser = p.chromium.launch(
headless=False,
slow_mo=200, # Add a delay between actions
args=["--disable-blink-features=AutomationControlled"],
)
page = browser.new_page()
page.set_default_timeout(90000) # Global timeout
# Warm-up
page.goto("https://example.com", wait_until="domcontentloaded")
E' la soluzione migliore? La più efficiente? La più professionale?
Neanche lontanamente... ma è la più semplice, quella che mi consente di riutilizzare facilmente il mio script anche per altri dex, quella che non mi richiede di imparare una marea di cosa nuove senza avere la certezza che poi mi torneranno utili.
Grazie allo script a cui sto lavorando posso simulare facilmente operazioni di swap che coinvolgano SPS e DEC su diversi exchanges decentralizzati, i cui dati ho inserito in un apposito file .json
:
{
"sps": [
{
"dex": "pancakeswap",
"url": "https://pancakeswap.finance/swap?chain=bsc&outputCurrency=0x1633b7157e7638C4d6593436111Bf125Ee74703F&inputCurrency=0x2170Ed0880ac9A755fd29B2688956BD959F933F8"
},
{
"dex": "aerodrome",
"url": "https://aerodrome.finance/swap?from=0x4200000000000000000000000000000000000006&to=0x578661e9a09eee6b2cd97d4ded1ccbae7b8516b9&chain0=8453&chain1=8453"
},
{
"dex": "uniswap",
"url": "https://app.uniswap.org/swap?inputCurrency=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2&outputCurrency=0x00813E3421E1367353BfE7615c7f7f133C89df74&chain=1"
}
],
"dec": [
{
"dex": "pancakeswap",
"url": "https://pancakeswap.finance/swap?chain=bsc&network=56&network=97&network=1&network=8453&network=204&network=324&network=1101&network=59144&network=42161&search=sps&inputCurrency=0x2170Ed0880ac9A755fd29B2688956BD959F933F8&outputCurrency=0xE9D7023f2132D55cbd4Ee1f78273CB7a3e74F10A"
},
{
"dex": "uniswap",
"url": "https://app.uniswap.org/swap?inputCurrency=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2&outputCurrency=0x9393fdc77090f31c7db989390d43f454b1a6e7f3&chain=1"
}
]
}
Gli url puntano già alla coppia di token che mi interessa, consentendomi di potermi limitare a dover inserire solo la quantità che voglio scambiare e leggere il risultato.
Il prossimo step sarà aggiungere anche il controllo delle pool presenti su Hive-Engine - cosa che mi richiederà pochi minuti perchè ho già degli script adatti - e poi implementare il sistema di notifiche - anche questo già pronto.
Dopo di che non mi resterà che attendere e vedere se ci sono delle opportunità: se ci saranno e sarò in grado di sfruttarle, non solo avrò avuto una quarta conferma che questa tecnica ha del potenziale, ma sarò anche pronto per espandere il sistema ad altri token, in modo da poter accrescere sempre più il numero di quelli che monitoro... e con esso la mia capacità di realizzare profitti.
cover realizzata con Grok AI ed editata con GIMP
a supporto della community #OliodiBalena, il 3% delle ricompense di questo post va a @balaenoptera
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
Good luck!, sounds fun, a long way over my head, but a fantastic project.
Happy Hunting!
I might start this arbitrage campaign.
Which exchanges are you using for hive and Gifu?
I'm doing everything through Hive-Engine rn :)
Gifu is a bit inactive, though, so not sure there are arbitrage opportunities
Congratulations @arc7icwolf! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)
Your next payout target is 19000 HP.
The unit is Hive Power equivalent because post and comment rewards can be split into HP and HBD
You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word
STOP
Mi piace sempre leggere questi tuoi post perchè la programmazione è stata una delle mie materie di studio ma poi la vita mi ha portato altrove... ti auguro di diventare il King degli arbitraggi ;)
!PIMP
!discovery 30
@tipu curate 2
Upvoted 👌 (Mana: 2/42) Liquid rewards.
Magari! Allora sì che si potrebbe anche parlare di possibile futura whale di Hive 🤣
Spero allora di poter postare presto nuovi aggiornamenti, magari sempre legati alla programmazione :)
!LOL !PIZZA !LUV
This post was shared and voted inside the discord by the curators team of discovery-it
Join our Community and follow our Curation Trail
Discovery-it is also a Witness, vote for us here
Delegate to us for passive income. Check our 80% fee-back Program
$PIZZA slices delivered:
@arc7icwolf(4/10) tipped @libertycrypto27
Come get MOONed!