Following on my post on a unified marketplace, I decided not to sit around and wait for someone else to build what I want myself, so I built my own private version. It probably wont work on anyone elses device. But if you are curious about this dysfunctional prototype you can catch the code here:
https://github.com/oceanbluu/accessOlympus
Here are some details on the conceptual logic I used:
Objectives:
- Simplify my workflow
- Simplify jargon / terminology
- Improve my access to Olympus markets
- Improve my access to trading relevant information
- Eliminate my reliance on hosted webpages
- Minimal files deployment (index.html, index.js)
- No library dependency
Accomplished:
- Single screen access to all markets and portfolio with more relevant details than official page
- Action word consolidation; reduced 8 action words to 2 action words
- Redundant action words: Bond, Deposit, Claim, Redeem, Wrap, Unwrap, Stake, Unstake
- New action words: Cash, Bid
USAGE
Any assets held in user wallet are considered liquid, and thereby as good as CASH.
Any assets deposited into an Olympus depository contract are considered non-liquid. Once their lockup period has passed, they are CASH-able. (ie redeemable/claimable). “Cashable” is a synonym with “redeemable”, and allows for more catchy language use. Only CASH can be used to participate in MARKETS.
MARKETS are identified same as a currency pairing.
https://www.dailyfx.com/education/beginner/how-to-read-currency-pairs.html
Format: <baseToken/quoteToken>
As a speculator, one buys baseToken, and pays for it with quoteToken.
There are two native markets:
gOHM/OHM : This pairing implies one would buy gOHM and pay for it with OHM. (“staking”)
OHM/gOHM : This pairing implies one would buy OHM and pay for it with gOHM. (“unstaking”)
All other markets are non-native but follows same principles. The old action word was “deposit” or “bond”.
Because we turn everything into a MARKET, we can replace all old action words with “BID”. You chose your market, and then you BID to buy at the listed ask price. BID is very accurate for any non-native market as price may have changed before your transaction is accepted. For the native markets, its more of a risk-free swap but BID is kept for a simplified jargon.
You will only be able to BID for a MARKET, if you have the required CASH available in your wallet.
Each market has an ASK price. This is a normalized price. 100 means the market is trading at par value. An ask value of 105 means that Olympus is asking for a 5% premium. 95 means that the ASK price is 5% below par value.
YTM is yield to maturity and accounts for both market price plus expected staking yield.
APR assumes buying the market once, and then keeping the proceeds staked for a year.
APY assumes buying the market, and continuously reinvesting it at same discount after every subsequent lockup period.
i-PRICE allows user to simulate the impact on profitability from current gas price, assumed gas usage, position size, price slippage and commission fees on the ASK price. Theoretically, a market is only profitable for the user if the i-PRICE is below 100. YTM/APR/APY are headline figures, based on zero cost assumption. i-PRICE attempts to give better real life estimations. User simulation settings are stored as cookies.
LOW24H – these lines of code should keep recording low asks while running, and display the lowest ask price recorded in the past 24 hours.
MAX – indicates the largest deposit allowed at a single transaction.
CAP – indicates the current capacity of the market.
CONCLUSION – indicates for how long this market remains open.
Q: I cant select any asset to cash, nor any market to bid. Why ?
A: You need to have valid claim to be able to cash anything.
A: You need to hold the required cash in your wallet to bid on that particular market.
Q: I don’t like typing. Why cant I just click?
A: Double-click on the input field to see all available options to you, if any.
Q: Whats the small number under the omega sign?
A: Current gas price.
Q: All I see is gOHM. What about sOHM?
A: Gas fees are lower using gOHM when working with non-native markets. Gas fees are lower using sOHM only for the native staking market. These lines of code focus on the non-native markets. Furthermore, maintaining sOHM in the UI adds heaps of complexity on the overall data provision. gOHM is also what is explicitly stored in the contracts and thus more true as market representation. Therefore, sOHM needs to be sacrificed/deprecated. User will still be able to see sOHM in the wallet section. It is still possible to transact with sOHM. It just will not be proposed by the UI. If user has a gOHM claim to cash, the user may simply type ‘sohm’ as input instead and the claim will be cashed for sOHM. Likewise with wrapping. As an sOHM market, it is not visualized, but it can still be transacted by typing “sohm/gohm” in the market field and then click BID.
Q: What assets will appear in the wallet section?
A: Any cash asset that has a live market for it. Any claim your account has on Olympus depository.
Q: This calculation is wrong. How can I trust this solution?
A: This is not a solution. Its just lines of code for illustrative purposes. I don’t trust this code. Please advice me how to better it.
Q: Is this an official product?
A: Definitely not. These are untested lines of junk code for personal use only. Its prototype work for demonstration purposes.
Q: Where are priced sourced from?
A: Should pick from Sushiswap and Uniswap V2. Assume all prices are incorrect.
Q: Why is price different from official?
A: Different calculations. Different price sources. Different timing. Only trust numbers provided by Olympus. Do not trust numbers provided by these lines of code.
Q: How do I know this code is not malicious?
A: You don’t. Study the code and communicate if something looks awry. Bear in mind, powerful and malicious actors will always try to access your wallet through multiple attack vectors. Be vigilant. Dont take any risk. Never download anything. Only use official products.
Q: Why is the code so bad?
A: I never coded anything like this before. If it works today, it probably wont work tomorrow. I am publishing only because I need your help to make it right.
Q: Why did you do it?
A: For fun. As therapy.