Skip to content

Commit

Permalink
Added PsyFi to the investment strategies. (solana-labs#1052)
Browse files Browse the repository at this point in the history
* get PsyFi strategies

* add new apy header for different strategies

* refactor PsyFi strategies for use in strategy modal

* Add basic PsyFi deposit component

* WIP constructing deposit proposal

* WIP wiring up deposits

* proposal went through, few kinks to iron out still

* fix PsyFi deposit strategy

* add link to strategy risks section

* refactor code a little bit

* Add native sol support and fix transaction order

* Add try catch to cater for canceled transactions

* Refactored names and removed rent

* Added error notifier

* Added relevant collateral asset mint address ATA and remove comment

* fix the associated token address creation

* Updated yarn lock

Co-authored-by: Tommy Johnson <[email protected]>
Co-authored-by: Harsh Nagalla <[email protected]>
  • Loading branch information
3 people authored Sep 22, 2022
1 parent de67ac3 commit fc98220
Show file tree
Hide file tree
Showing 17 changed files with 1,153 additions and 16 deletions.
25 changes: 25 additions & 0 deletions Strategies/components/DepositModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import MangoDeposit from './MangoDepositComponent'
import BigNumber from 'bignumber.js'
import { SolendStrategy } from 'Strategies/types/types'
import EverlendModalContent from './EverlendModalContent'
import { PsyFiStrategies } from './psyfi'
import { AssetAccount } from '@utils/uiTypes/assets'
import { MangoAccount } from '@blockworks-foundation/mango-client'

const DepositModal = ({
onClose,
Expand All @@ -19,6 +22,19 @@ const DepositModal = ({
createProposalFcn,
mangoAccounts,
governedTokenAccount,
}: {
onClose: () => void
proposedInvestment: any
handledMint: string
apy: string
protocolName: string
protocolLogoSrc: string
handledTokenName: string
strategyName: string
currentPosition: number
createProposalFcn: any
mangoAccounts: MangoAccount[]
governedTokenAccount: AssetAccount
}) => {
const currentPositionFtm = new BigNumber(
currentPosition.toFixed(0)
Expand Down Expand Up @@ -58,6 +74,15 @@ const DepositModal = ({
createProposalFcn={createProposalFcn}
/>
) : null}
{/* TODO: Add the PsyFi modal */}
{protocolName === 'PsyFi' ? (
<PsyFiStrategies
proposedInvestment={proposedInvestment}
governedTokenAccount={governedTokenAccount}
handledMint={handledMint}
createProposalFcn={createProposalFcn}
/>
) : null}
</Modal>
)
}
Expand Down
Loading

0 comments on commit fc98220

Please sign in to comment.