Rena Dev Report #30 — V2

Rena Finance
5 min readFeb 5, 2024

Following the final re-audit, attention has shifted towards enhancing the front-end aspects of the new Rena smart contracts, with this report focusing specifically on user interface (UI) improvements. As the front-end development approaches completion, there is a strong commitment to refining the user experience to ensure it meets the highest standards for the upcoming Rena Beta, scheduled for release in Q1 2024. Although the progress is significant, efforts are ongoing to perfect the interface further. An internal release date has been established, with an announcement to the Rena community anticipated in the near future.

Summary of Tasks Completed

Wallet Management:

  • Improved connect/disconnect handling on MetaMask
  • Improved network change handling on MetaMask
  • Using fallback provider in case there is no wallet

Data Display:

  • Global number formatting fixes
  • Ability to display some data when no account is connected
  • Taking into account trading fees when calculating net discount and output tokens
  • Fixed locking duration slider
  • Fixed pre-selection of dropdown
  • Faster token symbol drop down implementation on rBond creation
  • Implemented fetching of token prices
  • Optimised CoinGecko API calls
  • Filtering for rBonds by token name works for lowercase

Error Management:

  • Implemented fallback to dev subgraph in case main subgraph fails
  • Non critical errors are no longer being notified

Bugs:

  • Fixed error when setting duration on rBond
  • Fixed all occurrences of MAX button
  • Dropdown closing when clicking outside
  • Different math issues when dealing with token digits

What was Achieved?

Wallet Management:

The Wallet Management system has been extensively updated for enhanced functionality and user experience. Balance and rBond data are accurately refetched upon connection changes. Additionally, account-specific data is hidden when disconnected, and fetch calls for account-related data are disabled if no account is connected.

The dApp is configured to load only on the appropriate network, with an added feature to request a network change upon dApp initialization.

In scenarios where no wallet is available, the system now defaults to an RPC provider on testnet and to Infura on mainnet. Renalib has been successfully connected to these fallback providers, ensuring continuous functionality across different network c onditions.

Improved connect/disconnect handling on MetaMask:

  • Balances refetch correctly
  • Managed rBonds refetch
  • Hiding account related data on disconnect
  • Disabling fetch calls to account related data when no account is connected

Improved network change handling on MetaMask:

  • Dapp loads only when on proper network
  • Requesting network change on dApp load

Using fallback provider in case there is no wallet:

  • Using an RPC provider when on testnet
  • Using infura provider when on mainnet
  • Correctly connecting Renalib to the fallback provider

Data Display:

The recent feature updates led to a series of regression bugs, all of which have now been resolved. We enhanced the formatting of most balances to two decimal places and refined the use of token decimal information for accurate value representation.

The loading of rBonds and partial loading of the Dashboard even when no account is connected.

The net discount and output tokens from trades are now accurately simulated through a static call, taking into account trading fees.

Global number formatting fixes:

  • Formatting most Balances with 2 digits precision
  • Using token decimals information to proper format values

Ability to display some data when no account is connected:

  • rBonds are loading when no account is connected
  • Dashboard is partially loading when no account is connected

Taking into account trading fees when calculating net discount and output tokens:

  • Net discount and resulting trade output directly simulated through a static call

Fixed locking duration slider

  • Fixed Math

Fixed pre-selection of dropdown

  • Bound pairs can be pre-selected now

Faster token symbol drop down implementation on rBond creation:

  • Virtualized List Implemented — Basis for new Token-Select Modal

Implemented fetching of token prices:

  • All tokens used in rBonds have their information fetched
  • All fetched data is dynamically loaded and forwarded

Optimised CoinGecko API calls:

  • Regrouped fetching of RENA, ITS, rGov and ETH prices with a single CoinGecko call

Filtering for rBonds by token name works for lowercase

  • Looking for both “RENA” or “rena” will display only rBonds with RENA either as input or output token

Error Management:

Recent updates have addressed issues with the reliability of the Uniswap subgraph repository.

In response to multiple failures with the main Uniswap subgraph, we’ve implemented a fallback to a secondary subgraph. This backup source is maintained by one of Uniswap’s developers, ensuring continued access to reliable data.

Non-critical errors, such as a user declining a transaction, are no longer flagged as errors.

Failures in systems that have an effective fallback method are no longer reported as critical issues.

These changes enhance the stability and user experience by ensuring more consistent data access and reducing unnecessary error notifications.

Implemented fallback to dev subgraph in case main subgraph fails:

  • After several Uniswap subgraph fails, we added a second source of information maintained by one of Uniswap’s devs

Non critical errors are no longer being notified:

  • Errors like user declining a transaction are no longer errors
  • Failures of systems that have a functioning fallback method is no longer reported

Bugs:

Fixed error when setting duration on rBond:

  • Invalid input in the transaction was corrected

Fixed all occurrences of MAX button:

  • Clicking on MAX button now sets the amount in the input

Dropdown closing when clicking outside:

  • Replaced dropdown component with a different custom version with better capabilities
  • New dropdown also has default value that will be used to fix an recurring issue

Different math issues when dealing with token digits:

  • Tokens have usually between 2 and 18 digits, resulting in some errors when trying to simulate smart contract computation through javascript

Next Tasks

  • Improve rBond Creation UI for Multi-transaction Flow
  • Improve rBond Management UI for Updating rBond
  • Dashboard Styling Completion
  • Final Checking on Number Formatting & Notification Syntax
  • New Rena Info Page

Thank you for taking the time to read our Rena V2 dev report. We’ll be back with more updates again soon! 🙌

--

--