Changelog

September - October 2021

UI

  1. Added the ability to find and close (release SOL and return to the pool owner's address) unused temporary accounts for calculating collateral
  2. Made Oxygen even faster with caching layer for market data
  3. Added cancel button for pending lends
  4. Pending liabilities cancel button now cancells orders grouped by 3 instead of all orders together
  5. Dashboard page updated with liquidation info and translations fixes
  6. Fixed: SOL action amount of deposited funds was subtracted from transaction cost field of the Deposit
  7. UI minor fixes and updates

Solana

  1. Implemented a set of instructions for close pool and refund SOLs

August 2021

UI

  1. Rework fetching data for render pool summary, pool management, my pools page. Now, we get this information directly from Solana on UI instead of backend API. This feature allows users to receive more responsive updates because we can read recent data. Also, in the future, we plan to put in open source our JS client like serum-ts
  2. Make a lot of fixes on the Trade page:
    1. Balance sync
    2. Decimal precision in inputting conversion from / to

Solana

  1. In lend/borrow agreements used clock.timestamp instead of clock.slot

May - July 2021

UI

  1. Developed UI for adaptive version
  2. On Pool Management: added borrow re-roll functionality
  3. Added transaction error dictionary to show readable message instead of error codes
  4. app.oxygen.org prepared for translation to multiple languages
  5. Developed UI for pool liquidation summary
  6. Added tooltips on all important columns for desktop, mobile
  7. Oxygen now supports external wallets (Sollet.io, Sollet.io extension, Ledger, Phantom, MathWallet).

Solana

  1. Added instruction for the set end date of lend re-roll
  2. Added instructions for close pool and release allocated space, so all spent SOLs are returned to the pool owner
  3. Move from clock.slot to clock.unix_timestamp in lend/borrow agreements, so customers can see more precise time instead of a number of slots
  4. Developed off-chain program for lend, borrow re-rolling
  5. Implemented pool liquidation by a margin call
  6. Created liquidator program which can be used in CLI mode (pass the pool address which must be liquidated) or run like a demon which polls API feed

March - April 2021

UI

  1. Added Local QR generation on web & mobile. Now customer can see which instruction would be executed and how much it costs. See the progress on transactions confirmation process.
  2. Reworked deposit/withdraw/borrow/repay
    1. Fixed calculation for available borrow, withdraw values
    2. Enhanced UI
  3. [WIP] Start works on adaptive version of app.oxygen.org
  4. Added support page for report issues
  5. Added balance structure on PoolManagement page
  6. Added market stats (TVL) on main page
  7. LTV / NetYield chart shows correct values
  8. Change borrow rate for multiples borrows

Solana program

  1. Moved to Serum dex v3 in lending, spot trading functions
  2. Added running “event queue” for settle operation after trade between lender/borrower.
    Necessary for lending market crank
  3. Added protocol base currency as entity (USDC)
  4. Added borrow reroll instruction
  5. Added borrow change rate instruction
  6. Improved oxygen test kit for support liquidation test cases
  7. Developed service for monitoring pools which should be liquidated
  8. Developed rust client for oxygen protocol

January - February 2021

Solana Program

Liquidation

  1. Liquidation discount based on how many liabilities must be liquidated
  2. Tests for liquidation happy path
  3. JS Client for liquidation instructions

Trade

  1. Make tests for trade module
  2. Fix bugs for pool balance held amount in trade
  3. Add validation on max available to trade

Risks

  1. Test on withdrawing for assets with zero iltv
  2. Make it possible to run pool viability accounting in parallel for liquidators race purpose
  3. Ability to change price oracle program vendor
  4. Change protocol asset risk params

Miscellaneous

  1. Add unique error codes for each instruction
  2. Store oxygen fee in full scale instead of native asset decimal
  3. Fix from cargo clippy recommendation
  4. Add field updated_at_slot for caching pool state
  5. Use solana_program instead of solana_sdk
  6. TestKit for remove boilerplate code in tests
  7. State versioning

UI

Trade

  1. Make able to enter on trade page and choose any asset pair
  2. Add orders summary tab

Pool assets balance structure

Miscellaneous

  1. Stopped wait for trx confirmation on backend check only from Solana
  2. Add i18n to support more languages
  3. Fix various bugs with pool management & trade pages

Java backend

  1. Developing oxygen client on java lang for infrastructure services
  2. Read events about oxygen pools transaction directly from Solana (socket, http)
  3. Read prices from price oracle on every price update
  4. Read pool state directly from Solana
  5. [API] Calculation pool state on the backend side
  6. [API] In case of unavailability Solana fetch pool data from the cache
  7. QR transaction service rework to guaranteeing more stability

QA

Create selenium tests for:
  1. Creating pool & wallet
  2. Deposit assets to pool with various lend out, APR rate settings
  3. Withdraw assets from the pool

December 2020

Liquidation

Instant assets exchange

Previously, all liquidators had to wait until the end of liquidation to receive bought pool assets(proportional). In the new version, the liquidator can immediately acquire funds from the pool under liquidation.

We have implemented the exchange state for store information about amount of bought pool assets and the number of tokens he had already drawn from the pool. Each exchange state stores in a separate address.

Default scenario (debt overdue)

We have implemented a liquidation scenario, which occurs if the pool is overdue on its loan. In this scenario, the liquidation initiator provides an agreement book on which the pool has an outstanding debt. In the course of liquidation, the pool must, first of all, pay off all overdue debts. It is also important to note that as in the case of margin call the liquidation pool LTV will be decreased to reset LTV value if it exceeds it.

Liquidation discount

Liquidation discount table specific for each asset
Based on the size of the position, estimated daily move (based on a weighted average of short-term and medium-term intraday move)

Discount is calculated for the amount required for liquidation and is distributed proportionally among all liquidators depending on the provided liquidator's value.

Reward system for liquidation initiator

To quickly start the liquidation process, we have developed a bonus system for the user who began the liquidation.

  1. The initiator can carry out liquidation on his own until X slots have passed since the moment the pool was transit to the liquidation state. X slots are specified in the protocol settings.
  2. The initiator also receives a liquidation discount from the amount that came out due to the netting step.

Trade

This module implements Serum DEX trading with available (funds that are not in lent out or held) pool assets. The exchange can be made for any protocol assets, even if it was not already in the pool before. An essential part of risk management is that with trade, the LTV pool indicator does not change. We have done it by adding a new concept of asset hold to the balance sheet. As the asset hold value increases, the available amount decreases and vice versa. In this case, the hold is not taken into account to calculate the protocol's risk indicators.

Available operations:
  • Place a new order
  • Cancel exists order
  • Settle

Also added a vault to the protocol to get a rebate fee when executing the settle instruction.

Risk management

Reset loan to value

Added parameter reset LTV. This parameter is the target LTV ratio to be achieved after exiting liquidation.

Support borrowing operation for high-risk assets.

Now assets that have a high risk can be added to the oxygen protocol, which does not allow them to be used as collateral, but at the same time, users can borrow them. To do this, when adding a new asset, protocol owner must set the initial LTV to 0%.

Buying power

Previously, the protocol determined buying power value (USDC) based on calculations for the current pool state, which could lead to the fact that iLTV could increase and make it possible to borrow even more. The new formula considers the iLTV borrowed asset and limits the maximum allowable amount within a given asset.

Event Emitter

We have developed a possibility to provide information about changes in the internal states (of the pool) within the statement. It generates events (for example, which reflect changes in the state of assets/liabilities). These events are encoded in base64 and sent to transaction log. After that, the client, upon receiving the transaction, can perform deserialization followed by data processing. This mechanism allows you to enrich transactions with useful meta information for building statistics and a detailed history of the pool.

Fault tolerance for data read ops.

We have implemented a possibility to ensure the availability of reading data on the states of the pools of the oxygen system, regardless of Solana node rpc health. Now we have a mechanism based on the consume event oxygen protocol, which reflects the pool's state to the last received event in the pool. Using this data source instead of requesting directly from the Solana node also significantly speeds up page loading. Since the data is stored in reading optimized structures, it can be displayed on the pools, pool detail pages and does not require creating dozens of queries to collect all the necessary data about the pool assets.

Miscellaneous

  • Added output to transaction log error detail, before that the client received only error_code
  • For operations cancel all lend/borrow orders; you can now specify a limit. Previously, the instruction tried to cancel all orders, but hypothetically it could reach the limits of the maximum number of vm instructions.