Skip to content

Commit

Permalink
2024 q3 geysers (#257)
Browse files Browse the repository at this point in the history
* updated deps

* removed binaries from git

* deployed new geysers q3 2024

* updated apy calc

* ran format

* fixed build ssl error

* fixed staking token parse error

* removed binary from history

* updated openssl version

* fixed weth price error
  • Loading branch information
aalavandhan authored Sep 6, 2024
1 parent 7b5697c commit a3e99b4
Show file tree
Hide file tree
Showing 65 changed files with 27,652 additions and 19,550 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,7 @@ flattened
scripts.sh

# python
.python-version
.python-version

# yarn
.yarn/install-state.gz
Binary file modified .yarn/install-state.gz
Binary file not shown.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,18 @@ ethereum:
proxyAdmin: 0xc70F5bc82ccb3de00400814ff8bD406C271db3c4
geyserRegistry: 0xFc43803F203e3821213bE687120aD44C8a21A7e7
geysers:
- poolRef: "UNI-ETH-AMPL-V2 (Beehive V7)"
deployment: 0x5Ec6f02D0b657E4a56d6020Bc21F19f2Ca13EcA9
- poolRef: "CHARM-WAMPL-WETH (Crystal V1)"
deployment: 0xEac308Fa45A9b64cfb6965e8d1237B39016862e3

- poolRef: "BB-SPOT-USDC (Steamboat V1)"
deployment: 0xF0a45FA4fBec33A2A51E08058bEA92761c08D7D5

- poolRef: "CHARM-SPOT-USDC (Great geyser V1)"
deployment: 0x7B2e9353D3Bf71d9f9246B1291eE29DFB11B32C7

# - poolRef: "UNI-ETH-AMPL-V2 (Beehive V7)"
# deployment: 0x5Ec6f02D0b657E4a56d6020Bc21F19f2Ca13EcA9

# - poolRef: "Arrakis Vault V1 USDC/SPOT (RAKIS-35) (Fly V2)"
# deployment: 0x392b58F407Efe1681a2EBB470600Bc2146D231a2

Expand Down
3 changes: 3 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ yarn-error.log*
.env
factories-*.json
!factories-latest.json

# yarn
.yarn/install-state.gz
15 changes: 10 additions & 5 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# token-geyser-v2-ui

Jump to

- [Known workarounds](#known-workarounds)
- [Required Setup](#required-setup)
- [Stats Calculation](#stats)
Expand All @@ -12,7 +13,7 @@ Jump to
## Known Workarounds

- `let mounted = true` in `useEffect` is a workaround for suppressing the warning saying that a state update on an unmounted component is not possible: https://stackoverflow.com/questions/53949393/cant-perform-a-react-state-update-on-an-unmounted-component
- react-spring has a bug where floating point numbers are casted as integers on re-render (e.g. '1.0' gets shown as '1' on re-render). This is a temporary work-around, see https://github.com/pmndrs/react-spring/issues/1564
- react-spring has a bug where floating point numbers are casted as integers on re-render (e.g. '1.0' gets shown as '1' on re-render). This is a temporary work-around, see https://github.com/pmndrs/react-spring/issues/1564
- Opening a modal right after closing a previous one can mess up the `overflow-y` of the page. As a workaround, there is a delay before the second modal is opened (see the function `handleConfirmUnstake` under `src/components/GeyserStakeView.tsx`)

## Required Setup
Expand All @@ -25,7 +26,6 @@ The following are the main elements that need to be configured prior to deployin
4. [List of additional tokens for vault management](#list-of-additional-tokens)
5. [Infura Project ID](#ethereum-provider)


## GraphQL Endpoint

To make sure that the application can fetch data from the subgraph,
Expand All @@ -37,7 +37,6 @@ The initialization of the GraphQL client can be found under `src/queries/client.

Make sure that the environment variable `NODE_ENV` is set to something other than `development` when deploying to production.


## Geyser Specific Configuration

### List of Geysers
Expand Down Expand Up @@ -69,6 +68,7 @@ and write a function that will return `Promise<StakingTokenInfo>`.
Say we want to add a new staking token called `LP`. The following changes will need to be made:

Under `src/constants.ts`

```
export enum StakingToken {
...
Expand All @@ -77,6 +77,7 @@ export enum StakingToken {
```

Under `src/utils/stakingToken.ts`

```
export const getStakingTokenInfo = async (...) => {
...
Expand Down Expand Up @@ -113,6 +114,7 @@ and write a function that will return `Promise<RewardTokenInfo>`.
Say we want to add a new reward token called `REW`. The following changes will need to be made:

Under `src/constants.ts`

```
export enum RewardToken {
...
Expand All @@ -121,6 +123,7 @@ export enum RewardToken {
```

Under `src/rewardToken.ts`

```
export const getRewardTokenInfo = async (...) => {
...
Expand Down Expand Up @@ -161,6 +164,7 @@ Note that it is assumed that the token is an ERC20 token.
Say we want to show the `WETH` balance of users' vaults. The following changes will need to be made:

Under `src/config/additionalTokens.ts`

```
const mainnetAdditionalTokens = [
...
Expand Down Expand Up @@ -203,19 +207,20 @@ A user can manage their vaults through the vault management view. This view will

It is possible for the user to withdraw the unlocked balance of a token from their vault to their wallet through this view.


## Withdraw Unlocked Balance When Unstaking

One edge case that comes up in the current unstake flow is that the staking tokens might be staked into different geyser programs (maybe external ones). If that is the case, then unstaking, say, 5 tokens from a geyser does not always imply that 5 tokens will be unlocked after the unstaking. As it currently stands, if this scenario were to arise, the transaction to withdraw the staking tokens will fail, and the user can withdraw the actual unlocked balance from their vault using the vault management view.

However, the functionality to withdraw exactly the unlocked balance is implemented in the code, but it is simply not used. If the decision is to enable this functionality, the following changes are required:

To withdraw the entire unlocked balance of staking tokens after unstaking, under `src/constants.ts`, set `WITHDRAW_UNLOCKED_STAKING_TOKENS_WHEN_UNSTAKING` to `true`

```
export const WITHDRAW_UNLOCKED_STAKING_TOKENS_WHEN_UNSTAKING = true
```

To withdraw the entire unlocked balance of reward tokens after unstaking, under `src/constants.ts`, set `WITHDRAW_UNLOCKED_REWARD_TOKENS_WHEN_UNSTAKING` to `true`

```
export const WITHDRAW_UNLOCKED_REWARD_TOKENS_WHEN_UNSTAKING = true
```
Expand Down Expand Up @@ -271,7 +276,7 @@ You can learn more in the [Create React App documentation](https://facebook.gith

To learn React, check out the [React documentation](https://reactjs.org/).

***
---

## Deployment

Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"eject": "react-scripts eject",
"lint:fix": "eslint src --ext .ts,.tsx --fix",
"lint": "eslint src --ext .ts,.tsx",
"prettify": "prettier --write ."
"format": "prettier --write ."
},
"browserslist": {
"production": [
Expand Down
80 changes: 40 additions & 40 deletions frontend/public/favicon/manifest.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
{
"name": "App",
"icons": [
{
"src": "\/android-icon-36x36.png",
"sizes": "36x36",
"type": "image\/png",
"density": "0.75"
},
{
"src": "\/android-icon-48x48.png",
"sizes": "48x48",
"type": "image\/png",
"density": "1.0"
},
{
"src": "\/android-icon-72x72.png",
"sizes": "72x72",
"type": "image\/png",
"density": "1.5"
},
{
"src": "\/android-icon-96x96.png",
"sizes": "96x96",
"type": "image\/png",
"density": "2.0"
},
{
"src": "\/android-icon-144x144.png",
"sizes": "144x144",
"type": "image\/png",
"density": "3.0"
},
{
"src": "\/android-icon-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": "4.0"
}
]
}
"name": "App",
"icons": [
{
"src": "/android-icon-36x36.png",
"sizes": "36x36",
"type": "image/png",
"density": "0.75"
},
{
"src": "/android-icon-48x48.png",
"sizes": "48x48",
"type": "image/png",
"density": "1.0"
},
{
"src": "/android-icon-72x72.png",
"sizes": "72x72",
"type": "image/png",
"density": "1.5"
},
{
"src": "/android-icon-96x96.png",
"sizes": "96x96",
"type": "image/png",
"density": "2.0"
},
{
"src": "/android-icon-144x144.png",
"sizes": "144x144",
"type": "image/png",
"density": "3.0"
},
{
"src": "/android-icon-192x192.png",
"sizes": "192x192",
"type": "image/png",
"density": "4.0"
}
]
}
45 changes: 25 additions & 20 deletions frontend/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Ampleforth geyser liquidity mining application"
/>
<meta name="description" content="Ampleforth geyser liquidity mining application" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
Expand All @@ -25,22 +22,30 @@
-->

<!-- Ample additions start -->
<link rel="preload" href="https://fonts.gstatic.com/s/cormorantgaramond/v5/EI2hhCO6kSfLAy-Dpd8fdwtAvOaaBo6YYi0S8FnWF2s.woff2" as="font" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/1df5373559.css">
<link href="https://fonts.googleapis.com/css2?family=Montserrat+Alternates:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet">
<link rel="apple-touch-icon" sizes="57x57" href="%PUBLIC_URL%/favicon/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="%PUBLIC_URL%/favicon/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="%PUBLIC_URL%/favicon/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="%PUBLIC_URL%/favicon/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="%PUBLIC_URL%/favicon/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="%PUBLIC_URL%/favicon/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="%PUBLIC_URL%/favicon/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="%PUBLIC_URL%/favicon/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="%PUBLIC_URL%/favicon/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="%PUBLIC_URL%/favicon/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="%PUBLIC_URL%/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="%PUBLIC_URL%/favicon/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="%PUBLIC_URL%/favicon/favicon-16x16.png">
<link
rel="preload"
href="https://fonts.gstatic.com/s/cormorantgaramond/v5/EI2hhCO6kSfLAy-Dpd8fdwtAvOaaBo6YYi0S8FnWF2s.woff2"
as="font"
crossorigin="anonymous"
/>
<link rel="stylesheet" href="https://use.fontawesome.com/1df5373559.css" />
<link
href="https://fonts.googleapis.com/css2?family=Montserrat+Alternates:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"
rel="stylesheet"
/>
<link rel="apple-touch-icon" sizes="57x57" href="%PUBLIC_URL%/favicon/apple-icon-57x57.png" />
<link rel="apple-touch-icon" sizes="60x60" href="%PUBLIC_URL%/favicon/apple-icon-60x60.png" />
<link rel="apple-touch-icon" sizes="72x72" href="%PUBLIC_URL%/favicon/apple-icon-72x72.png" />
<link rel="apple-touch-icon" sizes="76x76" href="%PUBLIC_URL%/favicon/apple-icon-76x76.png" />
<link rel="apple-touch-icon" sizes="114x114" href="%PUBLIC_URL%/favicon/apple-icon-114x114.png" />
<link rel="apple-touch-icon" sizes="120x120" href="%PUBLIC_URL%/favicon/apple-icon-120x120.png" />
<link rel="apple-touch-icon" sizes="144x144" href="%PUBLIC_URL%/favicon/apple-icon-144x144.png" />
<link rel="apple-touch-icon" sizes="152x152" href="%PUBLIC_URL%/favicon/apple-icon-152x152.png" />
<link rel="apple-touch-icon" sizes="180x180" href="%PUBLIC_URL%/favicon/apple-icon-180x180.png" />
<link rel="icon" type="image/png" sizes="192x192" href="%PUBLIC_URL%/favicon/android-icon-192x192.png" />
<link rel="icon" type="image/png" sizes="32x32" href="%PUBLIC_URL%/favicon/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="96x96" href="%PUBLIC_URL%/favicon/favicon-96x96.png" />
<link rel="icon" type="image/png" sizes="16x16" href="%PUBLIC_URL%/favicon/favicon-16x16.png" />
<!-- Ample additions end -->

<title>Ampleforth Geyser</title>
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ import { DropdownsContainer } from 'components/DropdownsContainer'
import { useEffect } from 'react'

function App() {

useEffect(() => {
localStorage.clear();
localStorage.clear()
}, [])

return (
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/DisabledInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface Props extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onCha

export const DisabledInput: React.FC<Props> = (props) => (
<Container>
<Input {...props} disabled />
<Input {...props} disabled />
</Container>
)

Expand Down
8 changes: 3 additions & 5 deletions frontend/src/components/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import { Fragment } from 'react'
// needs one of options or optgroups
interface Props {
options?: string[]
optgroups?: { group: string, options: string[] }[]
optgroups?: { group: string; options: string[] }[]
selectedOption: string
onChange: (arg0: string) => void
}

export const Dropdown: React.FC<Props> = ({ options, optgroups, selectedOption, onChange }) => {
const renderOptions = (opts: string[]) => (
const renderOptions = (opts: string[]) =>
opts.map((option) => (
<Listbox.Option
key={option}
Expand All @@ -36,9 +36,8 @@ export const Dropdown: React.FC<Props> = ({ options, optgroups, selectedOption,
)}
</Listbox.Option>
))
)

const renderOptgroups = (groups: { group: string, options: string[] }[]) => (
const renderOptgroups = (groups: { group: string; options: string[] }[]) =>
groups.map(({ group, options: opts }) => (
<div key={group}>
<Listbox.Option disabled className="text-gray align-center justify-center flex" value={group}>
Expand All @@ -47,7 +46,6 @@ export const Dropdown: React.FC<Props> = ({ options, optgroups, selectedOption,
{renderOptions(opts)}
</div>
))
)

return (
<Listbox value={selectedOption} onChange={onChange}>
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/components/EtherscanLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ import { useContext } from 'react'
import Web3Context from 'context/Web3Context'
import { getConnectionConfig } from 'config/app'


interface Props {
txHash?: string
}

export const EtherscanLink: React.FC<Props> = ({ txHash }) => {
const { networkId } = useContext(Web3Context)
const {explorerUrl} = getConnectionConfig(networkId)
const { explorerUrl } = getConnectionConfig(networkId)
return (
<a rel="noreferrer" className="text-link" href={`${explorerUrl}/${txHash}`} target="_blank">Block explorer</a>
<a rel="noreferrer" className="text-link" href={`${explorerUrl}/${txHash}`} target="_blank">
Block explorer
</a>
)
}
Loading

0 comments on commit a3e99b4

Please sign in to comment.