Michael Garcia avatar

NectarEngine Status Update

thecrazygm

Published: 31 Mar 2025 › Updated: 31 Mar 2025NectarEngine Status Update

NectarEngine Status Update

This morning I thought I would focus a little bit of love on NectarEngine and, well, that's exactly what I did.

So, I went through it and made sure all the tests pass first, I updated the test cases to make use of the block data from lite nodes as that is what most people seem to be running.

All tests pass!

Now, some eagle eyed person might notice among those tests are things that mention the liquidity pool!

I have added the classes for Liquidity pools and Pool objects, as well as many methods to use with them.

from nectarengine.pool import LiquidityPool

# Initialize the LiquidityPool instance
pool = LiquidityPool()

# Get the SWAP.HIVE:INCOME pool
income_pool = pool.get_pool("SWAP.HIVE:INCOME")

if income_pool:
    print(f"Pool Info: {income_pool}")

    # Get liquidity positions
    positions = income_pool.get_liquidity_positions()

    print("\nLiquidity Positions:")
    for position in positions:
        print(f"Account: {position['account']}, Shares: {position['shares']}")

    # Get pool price
    price = income_pool.calculate_price()

    print(f"\nPool Price: {price}")
else:
    print("SWAP.HIVE:INCOME pool not found")

So Handy!

I haven't went through the setup for readthedocs yet, but the html documentation is in the repo, for those wanting to give it a go. I need to update the kanban with the progress, and give it a couple more tests, I've tested most everything, need to test the token swap, but I'm fairly confident it works, and if it doesn't, I'll get right on it.

I did want to share that NectarEngine is also getting love, and this isn't all about beem HiveNectar.

As I said the other day:

Maybe this will help someone, maybe it won't. But it is the kind of stuff I do daily just because I enjoy doing it.

Perhaps you will support our vision:
Proposal 339: A modular open-source development framework with critical library maintenance.

As always,
Michael Garcia a.k.a. TheCrazyGM

Leave NectarEngine Status Update to:

Written by

Solving IT puzzles and crafting Python solutions. When not coding, I'm rolling dice in RPGs, navigating Linux (MCMXCVI), and keeping a keen eye on the Crypto space.

Read more #nectar posts


Best Posts From Michael Garcia

We have not curated any of thecrazygm's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From Michael Garcia