just vibin'

TheCarbonSwap 🌱: Week 7 @ ETHIndia Fellowship
It’s time to dive deep into writing our smart contracts for the [carbon] swap, it’s pretty straightforward in what I’m trying to do, but I’ve been facing a couple of bugs in integrating with Balancer which is blocking any progress I’m having. But before we go into that, let’s explore a bit more into what exactly I’m trying to build here.A Primer: the [carbon] swapproposed pool architectureT[C]S is a ReFi-based project that helps you save the planet. It introduces an AMM that owns its liquidit...

TheCarbonSwap 🌱: Week 7 @ ETHIndia Fellowship
It’s time to dive deep into writing our smart contracts for the [carbon] swap, it’s pretty straightforward in what I’m trying to do, but I’ve been facing a couple of bugs in integrating with Balancer which is blocking any progress I’m having. But before we go into that, let’s explore a bit more into what exactly I’m trying to build here.A Primer: the [carbon] swapproposed pool architectureT[C]S is a ReFi-based project that helps you save the planet. It introduces an AMM that owns its liquidit...

TheCarbonSwap 🌱: Week 5 @ ETHIndia Fellowship
Voila! A pool hath been born…Last week, I had been struggling to get a pool created via balancer-sdk, so I decided to use balpy (a repo of python scripts for balancer) - as suggested by a user on Discord, to initialize my pool. I was going through some issues which I wasn’t sure what the problem was. After a few hours of tinkering and some more hours going back and forth on Discord I was finally able to generate my very first Composable Stable Pool on Balancer. In this pool I had added my 3 d...

TheCarbonSwap 🌱: Week 7 @ ETHIndia Fellowship
It’s time to dive deep into writing our smart contracts for the [carbon] swap, it’s pretty straightforward in what I’m trying to do, but I’ve been facing a couple of bugs in integrating with Balancer which is blocking any progress I’m having. But before we go into that, let’s explore a bit more into what exactly I’m trying to build here.A Primer: the [carbon] swapproposed pool architectureT[C]S is a ReFi-based project that helps you save the planet. It introduces an AMM that owns its liquidit...

TheCarbonSwap 🌱: Week 7 @ ETHIndia Fellowship
It’s time to dive deep into writing our smart contracts for the [carbon] swap, it’s pretty straightforward in what I’m trying to do, but I’ve been facing a couple of bugs in integrating with Balancer which is blocking any progress I’m having. But before we go into that, let’s explore a bit more into what exactly I’m trying to build here.A Primer: the [carbon] swapproposed pool architectureT[C]S is a ReFi-based project that helps you save the planet. It introduces an AMM that owns its liquidit...

TheCarbonSwap 🌱: Week 5 @ ETHIndia Fellowship
Voila! A pool hath been born…Last week, I had been struggling to get a pool created via balancer-sdk, so I decided to use balpy (a repo of python scripts for balancer) - as suggested by a user on Discord, to initialize my pool. I was going through some issues which I wasn’t sure what the problem was. After a few hours of tinkering and some more hours going back and forth on Discord I was finally able to generate my very first Composable Stable Pool on Balancer. In this pool I had added my 3 d...
just vibin'

Subscribe to Robin Roy

Subscribe to Robin Roy
<100 subscribers
<100 subscribers
Share Dialog
Share Dialog


With week 6 on the go, and my custom Balancer Composable Stable Pool deployed, it’s time to start testing out the possibilities of Balancer Pools. During this week, I learnt more about swaps, including Batch Swaps and Single Swaps.
As the names imply, a Single Swap is used when only trading 2 tokens against a single pool. And Batch Swap, the more commonly used one, allows for multiple hops, paths, and pools. This differentiation allows for the Single Swap to be even more gas optimized and can be as low as 95k for a swap. I went through the docs to understand how to do a Batch Swap using the balancer-sdk.
I was able to run a script that swaps tokens within a pool, using the SDK. Initially, I had used an Alchemy node for RPC, but the next day the RPC calls were not getting reflected on-chain, which really messed with me, as I thought I had messed something up in my scripts.

Eventually, after talking with Sarang (my mentor for EIF3.0) I tried changing the RPC provider to Infura, which got things back to working well. This could’ve been caused been the reduced support now given to Goerli as it is getting deprecated at the end of year.
I had thought of redoing the entire project on Sepolia, but the time taken for the initial setup could be much more than I’d like for now. So I’m sticking with Goerli temporarily for the duration of the fellowship, and may redo on Sepolia as and when time allows.
Now that I’ve figured out swapping, it’s now time to start working on writing my custom contracts for joining the pool and maintaining protocol-owned-liquidity. That will be my task for next week.
With week 6 on the go, and my custom Balancer Composable Stable Pool deployed, it’s time to start testing out the possibilities of Balancer Pools. During this week, I learnt more about swaps, including Batch Swaps and Single Swaps.
As the names imply, a Single Swap is used when only trading 2 tokens against a single pool. And Batch Swap, the more commonly used one, allows for multiple hops, paths, and pools. This differentiation allows for the Single Swap to be even more gas optimized and can be as low as 95k for a swap. I went through the docs to understand how to do a Batch Swap using the balancer-sdk.
I was able to run a script that swaps tokens within a pool, using the SDK. Initially, I had used an Alchemy node for RPC, but the next day the RPC calls were not getting reflected on-chain, which really messed with me, as I thought I had messed something up in my scripts.

Eventually, after talking with Sarang (my mentor for EIF3.0) I tried changing the RPC provider to Infura, which got things back to working well. This could’ve been caused been the reduced support now given to Goerli as it is getting deprecated at the end of year.
I had thought of redoing the entire project on Sepolia, but the time taken for the initial setup could be much more than I’d like for now. So I’m sticking with Goerli temporarily for the duration of the fellowship, and may redo on Sepolia as and when time allows.
Now that I’ve figured out swapping, it’s now time to start working on writing my custom contracts for joining the pool and maintaining protocol-owned-liquidity. That will be my task for next week.
No activity yet