Inspiration

We were initially motivated to build a project after attending NEARCON in Lisbon, in November of 2021. Looking at NEAR's DeFi ecosystem, we saw the necessity for an ultimate yield suite - easy-to-use routers integrated into major DEXes, yield opportunity aggregation, auto-compounding, and vault strategies.

Motivation

Our motivation goes beyond that - easy-to-use DeFi investment opportunities on NEAR are a huge opportunity to get DeFi into the masses and democratize the web3 ecosystem even further. NEAR is the perfect blockchain for that, with its mobile-native UX, green principles, and fast finality. Fluxus Finance isn't trying to bring the Ethereum experience and features to NEAR, we're following NEAR's guiding principles to reimagine how yield should work and, above all, how the end-user is supposed to interact with it seamlessly.

Influences

As the leading AMM on NEAR, Ref Finance's amazing work paved the way for DeFi within the Layer 1. We're intentionally building on top of them as the first integrated DEX and our immediate goal is to deliver an initial product that could expand their functionalities further and bring in users. We have also based our vault structure/log on Beefy Finance's, as the main multi-chain yield product out there.

Fluxus Finance

What it does

  • Fluxus indexes the farm pairs available on Ref Finance in a modular way (automatically expanding as new farms are released), also being able to index new DEXes in the NEAR ecosystem, serving as the to-go place to find the highest yield generating opportunities.

  • Paving the way for a future launch, we also deployed our own farms smart contracts that reward users via $UXU, Fluxus' very own governance token. Users can toggle between Ref-based rewards and Fluxus-native ones in a single click and pick and choose in what way they want to be rewarded.

  • On top of that, we built our own vault smart contracts in a modular way, including all methods and features necessary for more complex automated yield strategies. To start off the vaults, we've implemented auto-compounding strategies on top of Ref Finance's farm pools, turning user rewards from APR to APY in a very easy way. Currently, we're able to auto-compound every 20 seconds with no technical limitations, though we'll use longer periods in real-life scenarios to optimize profits.

  • Fluxus' Aurora implementation is live as well. We're also very close to achieving NEAR-to-Aurora native transactions, but since we had to refactor our front-end components to handle both NEAR-like and Web3-like the hackathon ended up being a little too tight to showcase that as well. This is a very important feature for us since it establishes Fluxus as the definitive yield suite and brings our users an even better UX.

How we built it

We broke down the hackathon tasks along multiple sprints using an agile methodology, setting up multiple deliverables in order to reach farms aggregation, vault implementations, Aurora integration, and a nice UI along the way to bring investors a good user experience.

Our team comes from an Ethereum/Solana-like development background, so we also coordinated group studies and structured training so we could get up and running faster. Understanding the NEAR blockchain (things like the chain architecture, near-rust SDK, near-api, wallet connection, RPC methods), studying Ref Finance's protocol (data models, design decisions, write methods), and architecting our own smart contracts were crucial to achieving the current submission.

Challenges we ran into

As mentioned, there was a learning curve involved in the workflow, so we couldn't follow a traditional get-up-and-running development process, going for a hackathon-like instead. This meant compromising code quality for fast prototyping, requiring us to refactor parts of the code afterward so we're able to maintain quality standards. We also spend a considerable amount of time thinking of the user flow and how to best structure parallel blockchain interactions to minimize user actions.

With that in mind, the project naturally took more work than anticipated, but we're glad to have taken the more holistic, though-out approach since it ended up helping us out significantly on understanding the new functionalities brought by the NEAR tech and ultimately taking better architecture decisions with more future-proof code.

Accomplishments that we're proud of

We believe the final submission is a good display of our work. On the smart contract side, forking Ref's farms was relatively simpler, but writing our own vaults was a good challenge and we're really glad to end up with efficient, modular, NEAR-native contracts that we built from the ground up. We also enabled cross-contact calls in a way that wouldn't consume considerable fees and could maximize the amount of compounding that our vault contract is able to achieve per day.

The Fluxus front end is also pretty comprehensive with minimalistic and functional components that deliver a simple UX. Our goal here was to deliver a basis experience our users can help us shape into a definitive one in the near future, so we also had to take some additional time to make our front end easily adjustable and expandable. We also had to adapt the code in order to find a way to work around the NEAR wallet opening a new full-screen on top of our screen, which brings an experience that would require a different UI flow that would mismatch our initial planned user experience.

Finally, we're really proud of making the process of investing in a vault even smoother than what is possible through the auto-compounders on EVM-compatible chains nowadays. In our dApp, users just need to insert the native blockchain token and we handle the logic of converting it to LP tokens, with efficiency in mind, and then we convert it back for them in the token format they first invested with gains on top.

What we learned

There were plenty of learning points along the process of developing this Fluxus beta, including strategies for auto-compounding, what is the state of art for this kind of service currently, and what are the pitfalls we could run into. Learning how to better structure blockchain-agnostic components was also a very interesting knowledge to acquire.

We also went deeper on NEAR's blockchain amazing capabilities, such as being able to store a whole SVG image on the FT (fungible token) contract, the way it has shards, and the different model of charging for storage usage in the blockchain

What's next for Fluxus

Fluxus has a bright roadmap ahead, we intend to expand our yield aggregation to include Aurora Dexes by doing cross-contract calls to Aurora from our contracts that way providing the best yield aggregator for the ecosystem and pushing it to the cutting edge of innovation that has been brought by Near blockchain.

We believe our code is in a good point to release a public beta over the next few days, so we're structuring our socials and institutional materials to build our community. If you like what you read so far, please join our Discord server and help us build the Fluxus DAO!

This initial release will also be testnet-only so we can better refine the experience alongside our community and have more code review time before deploying it to Mainnet on March 2022. We're following a gradual-release schedule and will go for a product-first release (releasing the protocol and building a good user base before following along our tokenomics and DAO plans).

Built With

+ 4 more
Share this project:

Updates