Oh My Opium - alternative UI for Opium pools

Hi there, just built a simple alternative decentralized UI for Opium pools

Here is the link to stake/unstake into pools
https://ipfs.io/ipfs/QmUcsrRqCdV54c4rtzAYk4ZieSjKZM6qvGknh7dUUtBgLr/

Feel free to contribute and help to make it bigger and powerful

2 Likes

Hi, can someone here help me?
I want to implement maintenance functionality such as oracle calls and pool initialization. Can you please explain or show somewhere how to do it? Tried to figure it out from txs. But it’s still unclear for me.

Hey there

The easiest way to do the pools maintenance is to properly send 3 transactions in the following order:

  1. Read the derivative data from the pool

  2. Call the oracle to push the data to the Opium Protocol and make underlying pool’s derivative executable

  3. Execute currently active LONG position

  4. Initialize pool epoch

#0 Read the data

You need to get pool.derivative() structure and also pool.getDerivativeParams() to compose them into standard Opium.Derivative structure

USDT Protection pool didn’t have getDerivativeParams, so use [‘950000000000000000’, ‘2500’]

#1 Call the oracle

Added oracle addresses and types to attached file, some of them though are Optimistic Oracles and can’t be called automatically, only through this interface

ABI

Function _callback(timestamp)

#2 Execute current LONG positions

Address of current long position is available at pool.longPositionWrapper()

Then you just call a long.execute(derivative) (using OpiumERC20Position ABI) and pass derivative structure composed in step #0

#3 Initialize epoch

Once oracle data is pushed and LONG position is executed, you can call pool.initializeEpoch() and it’s done

This info is also available in the docs

Attached file with oracles and types export const ethPools = [ { title: 'USDT Protection', poolAddress: - Pastebin.com

Great, thank you!
It’s very useful

The latest version is on Oh My Opium

This version includes maintenance functionality

Above all made RealT special version here: RealT Opium UI

2 Likes

Latest links
Main: Oh My Opium
RealT version: RealT Opium UI
Added positions for Polygon and BSC networks

Hey there!

I have one addition for you.
Phases calculation is not finished. There is one more thing.
From the staking contract you should call methods.idleStakingTimeLimit(), which returns you staking limit for idle phase. That means that until endTime - idleStakingTimeLimit users can still stake into pool, but not unstake.

And check this ABI, seems like you have it unfinished as well

Hi, thank you. I will check it out

According to suggestions fixed phases
main: Oh My Opium
RealT: https://cloudflare-ipfs.com/ipfs/QmUbmxVPtjhrWxVjoB6KZEwfBcPFQCztdr3Qzzaiv36TPH/

Last versions:
main: Oh My Opium
RealT: RealT Opium UI

added small redesign to load pool info in a more ux friendly way

Amazing work @mrnobody ! I love alternatives )))

While looking at it I come across with an idea… how about little additions :

  1. “sort by” menu:
    where you can select one of the options a) Name b) Liquidity c) Expiration date d) APR etc…
  2. “filter by” menu:
    where you can chose one of the options: a) All b) My pools c) Stable coin pools etc…

I did a little mocap here:

And a little question… - there is no way to see available liquidity in the pool on expand mode?

1 Like

Hello, @sergelove!

Thank You for suggestions. I will take a look and maybe include some of them in the next release.

Anyway everyone is free to contribute and help, maybe someone can help and implement smth as well.

Meanwhile some new changes are deployed
Main: Oh My Opium
RealT: https://cloudflare-ipfs.com/ipfs/QmSFzQU7o7Tpsv2rE4qW44NBjksswdQwe4ocXbugDuiZww/

1 Like

Lastest version available for Gnosis Safe
Main: Oh My Opium
RealT: RealT Opium UI

Added button to retrieve all positions at once
main: Oh My Opium
RealT: RealT Opium UI

Hey man, can you add these pools to RealT version?

{
    title: 'RealT 2661-2663 Cortland Rent insurance',
    poolAddress: '0x20120864944fC47fed4821C1c4B1b6a7D400844b',
    nominal: 1,
    marginTitle: 'USDC',
    oracle: {
      address: '0x739de5bea03346dee2c402f0499409f43b78cd3c',
      type: OracleTypeEnum.OPTIMISTIC
    }
},
{
    title: 'RealT 20160 Conant Rent insurance',
    poolAddress: '0xCd9955ba381e408575Acca4F712573c5f6e4b174',
    nominal: 1,
    marginTitle: 'USDC',
    oracle: {
      address: '0x614fc2a2d689b38f8f711f300ce1f924fa230513',
      type: OracleTypeEnum.OPTIMISTIC
    }
},
{
    title: 'RealT 5517-5519 Elmhurst Rent insurance',
    poolAddress: '0xcd465bedccBF1Bd89998757563f4A3b3D6bb01B6',
    nominal: 1,
    marginTitle: 'USDC',
    oracle: {
      address: '0x0e6ab9aeaa60778ab6758dd094ef2e12cb301f14',
      type: OracleTypeEnum.OPTIMISTIC
    }
 },

Also noticed that withdrawal fees are not shown anywhere, can you add them too?

This is Haytham Allos, CTO of RealT.co. I love what you are doing here. I look forward to contributing.

1 Like

Hello, I appreciate your interest in my work.
@Haytham_Allos please, welcome to contribute and help, it will be fantastic
@alirun by the way, wanted to ask if I can apply for developer grant you have. If I understood it correctly, I can do almost whatever I want based on opium, right?

I have added new pools, thank you for the provided info.
New links
main: Oh My Opium
realt: RealT Opium UI

3 Likes

Yes, of course

Take a look

This team already applied for developer grant to improve visual part and business analysis of your project

Hello! According to this proposal, TORN community wants to have a pool like following

Network: BSC
{
    title: 'Turbo TORN',
    poolAddress: '0xD7f28222f6955CdB948d176acfc60fc716DC13f8',
    nominal: 1,
    marginTitle: 'TORN',
    oracle: {
      address: '0x5c1e6bc8e52ce1a262014c743508f74923a5b0d2',
      type: OracleTypeEnum.WITH_TIMESTAMP
    }
}