#8 | Product Update (Mar 2023)
· 3 min read
Historical context: This post describes early Sai work as of 2023-03-10. Product details and launch plans reflect that period. See the Sai documentation for current trading and integration guides.
This note is a brief update for supporters of Nibiru as part of an ongoing series from the founding team outlining key milestones.
In January 2023, we released a first version of both our perpetual futures platform and spot AMM on testnet the web application, and had ~16K community members in our Discord.
Since then, we have launched Nibiru’s phased incentivized testnet, receiving +34K new followers and 35K registrations, our Discord community more than doubled in size to 55,000+, and our Ambassador Program received 1,000+ applications with talent hoping to contribute to content creation, community engagement, and build on behalf of Nibiru.
On the technical front, we designed and implemented our (1) Oracle Module, (2) its associated Price Feeder, (3) the “Heart Monitor”, which indexes all of our data from the chain, and (4) added robust APIs for interfacing with this data.
Nibiru Incentivized Testnet Roadmap
NIT will be released in 4 phases, each rolling out improvements and features on the chain with tasks for community members to complete and help stress-test the stack. These phases are centered around:
- Staking and the Oracle Module: NIT 1 is a chance for thousands of external users to test the new features through the web app, such as the addition of staking functionality on top of the perps and spot AMM.
- Governance: NIT 2 is aimed at ensuring decentralization by preparing community members to be involved in the governance proposal process. You may recall that we altered consensus parameters in the past to lower the finality time to about 1.4s with 100 validators and no requirement for collocation. NIT 2 will be an empirical test to see how much we can increase Nibiru’s Nakamoto Coefficient and experiment with active set sizes of 200, 300, or 500+.
- Liquidity Applications: NIT 3 is meant to test out the Sai and Nibi-Swap trading applications and help users get better acquainted with the product before launch. We’ll also integrate roll out several innovations on perp trading in this phase that will enable lower slippage, higher leverage, and a novel mechanism for fully automating liquidations at the smart contract level without off-chain calls: 🏔️ Automated Liquidation Protocol (ALP). Stay tuned for more details.
- Trading Competition: NIT 4 is the final step for traders to simulate how the protocol will function in a more realistic environment, where there’s real upside to trading well.
Following each phase of NIT, Nibiru will launch mainnet, targeted in Summer of 2023.
Oracle Module
“
Oracles are the weakest link of any blockchain project, and they just cannot fail.”
-Mariano Conti - MakerDAO’s Head of Oracles
Oracles must be fast and efficient, but this often comes at the expense of security. Oracles are essential infrastructure in Web3 because they provide a critical link between the blockchain and the outside world. Because many transactions are automated without intermediaries, oracles are often targeted for immense financial exploitation.
For example, in 2020 Compound Finance experienced an oracle exploit causing $89M in liquidations with DAI/USDT, while more recently, Mango Markets was exploited for a whopping $112M. Numerous examples exist, with victims including Solend, QuickSwap, Deus Finance, Inverse Finance, and MakerDAO ($7M).
Several of Nibiru’s decentralized applications oracle-based price feeds. Funding payments and liquidations on Sai depend on a feed of index prices for each market, while NUSD mints and redeems depend on accurate pricing for both USDC and NIBI. For this reason, it was essential that we make a custom-tailored solution that is both performant and secure. Nibiru’s Oracle Module aligns incentives between validators and traders and addresses potential attack vectors present in other oracles without sacrificing on efficiency.
How does Nibiru’s Oracle Module work?
Validator nodes act as oracles by voting on the exchange rates between pairs of crypto assets. A cycle of voting occurs every few blocks, after which the protocol would tally up all the votes and create a ballot for each exchange rate. To disincentive bad actors, oracles are rewarded for posting “good prices” and slashed for posting “bad prices.” The weighted median of the ballot becomes the on-chain exchange rate.
What are the advantages of this approach?
-
Front-running prevention: Our commit-reveal design protects against front-running. Posted prices are encrypted and kept hidden so that each oracle cannot know what data the other oracles are attesting to beforehand. This keeps oracles honest and reduces the risk of free-riders (copying revealed prices to know what to post) in the consensus process.
-
Sybil attack prevention: Sybil attacks are nullified because there’s no advantage to creating extra oracle accounts. Exchange rates are decided based on the weighted median of voting power
-
Speed: Chainlink feeds update much more slowly than block time in the range of
20+ minutes, and MakerDAO’s oracle takes as long as 1 hour. Nibiru’s oracle consensus occurs quickly like Pyth Newtork, taking just a few blocks and leading to an update speed of 10-15 seconds.
-
Decentralization and Availability: Centralized oracles create a vulnerability by localizing the point of failure. Service outages happen. A hacker can stop the feed of incoming prices with a denial of service (DoS) attack. Our design helps mitigate these risks for Nibiru and other blockchains that subscribe to the feeds.
Alongside the Oracle Module, we developed an open-source tool for querying and posting prices called the “price feeder”. Using this, validators can seamlessly send requests from several data sources asynchronously with minimal additional overhead for participating in consensus.
Heart Monitor — A scalable indexing solution on Tendermint
Because blockchain data is stored across multiple nodes in a decentralized network, the data’s difficult to access and analyze without the use of specialized tools.
Developers made it super easy to
write
to blockchains but not so easy to *
*read**
from them.
Indexers solve this problem by creating a searchable index of blockchain data that can be easily queried and analyzed, allowing DeFi projects to track user behavior, monitor network activity, and make data-driven decisions. Nibiru developed an indexing service called the Heart Monitor that:
- Listens to blockchain events,
- Stores data into a structured database tables for easier representation and reporting,
- Enables us to leverage custom alerts with Grafana.
- Supplies complex data to the web application, and
- Facilitates the creation of public APIs for data science and analytics (*image below).
For curious devs: The SQL database allows us to create a data source in Grafana and set up alerting. The heart monitor is deployed with its own Terraform module in Nibiru’s Kubernetes cluster (GKE), and it uses Google BigQuery database to keep data—deployed as a separate pod—and maintains a GraphQL API (*image below) that helps developers working in JavaScript or Python.
The Heart Monitor works by continuously scanning the blockchain for new data and indexing it in a searchable format, allowing us to track the performance of the protocol in real-time. This is critical for understanding the behavior of users, making strategic decisions and identifying trends, potential vulnerabilities, or opportunities for improvement.
Easily access information about transactions, addresses, tokens, and other data.
-
High performance and Scalability: The sheer amount of data that needs to be processed during analysis of blockchain data can be enormous. Our solution can scale to meet the demands of high network traffic and high volumes of event and transaction data.
-
Flexibility and Accuracy: We chose to prioritize extraction as the main priority in the ETL process. The core utility of the Heart Monitor is storing raw JSON data on events, messages, and transactions in a format similar to the tables of
Flipside Crypto. In this way, the heart monitor creates a single source of truth for structured historical data.
Next Steps
- **Engage LPs:**To ensure sufficient liquidity at mainnet launch, the Nibiru team will be sourcing commitments of stablecoin liquidity to bootstrap the platform.
- Audits: All contract logic will undergo code audits with Zellic in April 2023. For technical and financial audits, we’ve also chosen to engage several other teams. We’re picking between Salus Security and crowdsourced audits with code4rena.
- Launch: Lastly, Nibiru is targeting its mainnet launch in the Summer of 2023. We’ll also be conducting a Series A raise prior to launch.
Follow Nibiru to see future announcements.
🔮 Docs | 👾 Discord | 🐦 Twitter | 🔥 Web App
⛓️ ️Explorer | 🌴 Link Tree | 👨💻 Code | 🎥 YouTube