-
Notifications
You must be signed in to change notification settings - Fork 79
Compound integration with Omen Markets. Archived in favor of https://github.com/protofire/omen-exchange/pull/1570 #1466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 55 commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
e657c99
saving
pRoy24 a80a44a
stashing
pRoy24 f41006f
saving
pRoy24 ecdd4af
saving
pRoy24 1481921
saving
pRoy24 7b58d7c
saving
pRoy24 cf021f4
fixed interest rates for different compound types
pRoy24 b91e7dc
adding files
pRoy24 d4a8284
update readme
pRoy24 241919b
update readme
pRoy24 dbb22d8
adding files
pRoy24 faffce3
Saving
pRoy24 ba855af
update add remove flows
pRoy24 86f756e
adding files
pRoy24 0005bd5
add files
pRoy24 dfd2e5d
merge with remote master
pRoy24 7160a1b
rebase to master
pRoy24 cf0c61f
fix linter
pRoy24 0be6ea0
adding files
pRoy24 97759b8
fix logic for add liquidity using base token
pRoy24 c22422c
finish functionalities, some cleanup still needed, but feature complete
pRoy24 0911cb8
remove hardcode for compound enabled token type
pRoy24 5137be4
add check
pRoy24 4a3d5ab
add check to ensure the token is compound enabled before trying to in…
pRoy24 f3303ca
adding check to ensure service is only initialized for compound enabl…
pRoy24 ccb21bd
adding files
pRoy24 ca8885e
rebase to master
pRoy24 d6ed46f
resolving merge conflicts attempt 1
pRoy24 6925895
cleanup some code after rebase
pRoy24 de4f468
some more cleanup after rebase
pRoy24 fe8ca32
Merge branch 'master' into master
pimato 402e343
fix some display issues, added case for eth on createService
pRoy24 bf263ed
rebase
pRoy24 a48f2fe
rebase to master
pRoy24 a04a0ec
Merge branch 'master' of https://github.com/pRoy24/omen-exchange
pRoy24 210e59c
resolve add token flow, fix bug which was caused by div by 0 error on…
pRoy24 7307342
final bits of cleanup, almost ready to go
pRoy24 d80576e
change css to theme colors
pRoy24 4899556
stashing before rebase
pRoy24 8aa376c
rebase to master
pRoy24 77a22e3
fix ui visual bugs, rebase, testing
pRoy24 25046c9
testing, some cleanup and fixes
pRoy24 c70074d
css and some functionality fixes
pRoy24 4ba233a
fixes and changes
pRoy24 455f33e
adding files
pRoy24 c3d9ece
fix merge conflicts
pRoy24 574b148
rebase, address comments
pRoy24 7650eac
fix dropdown position for withdraw dropdown
pRoy24 abe42d6
Merge branch 'master' into master
pRoy24 a9f3dfd
updates to the calculation to minimize dust
pRoy24 f977f80
Merge branch 'master' of https://github.com/pRoy24/omen-exchange
pRoy24 3cdb883
address style comments, changes related to discussion on men channel …
pRoy24 452a358
rebase to master
pRoy24 050f7c3
pass down compound service from top level component, cleanup
pRoy24 15491c8
rebase to master fix merge conflicts
pRoy24 2a07bc9
adding files
pRoy24 80af976
code review fixes
pRoy24 234cf36
rebase to master
pRoy24 078da4d
fix some remaining merge conflicts
pRoy24 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| src/serviceWorker.ts | ||
| src/abi/compound_abi.ts | ||
| *.d.ts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
app/src/components/common/icons/currencies/CompoundIcon.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import React from 'react' | ||
|
|
||
| export const CompoundIcon = () => ( | ||
| <svg fill="none" height="40" viewBox="0 0 40 40" width="40" xmlns="http://www.w3.org/2000/svg"> | ||
| <circle cx="20" cy="20" r="19.5" stroke="#E8EAF6" /> | ||
| <path | ||
| clipRule="evenodd" | ||
| d="M11.6985 26.7047C11.1099 26.3391 10.75 25.6881 10.75 24.9891V21.0857C10.75 20.9362 10.7894 20.7921 10.863 20.6641C11.0916 20.2639 11.5987 20.1278 11.9928 20.3626L20.6687 25.4987C21.1758 25.8002 21.4884 26.3498 21.4884 26.9475V30.9924C21.4884 31.1764 21.4386 31.3606 21.344 31.518C21.0576 31.9929 20.448 32.1423 19.9803 31.8515L11.6985 26.7047ZM24.6309 19.2927C25.138 19.5942 25.4507 20.1438 25.4507 20.7415V28.9486C25.4507 29.1914 25.322 29.4155 25.1144 29.5329L23.2147 30.6188C23.1911 30.6321 23.1648 30.6428 23.1385 30.6508V26.0937C23.1385 25.5041 22.8337 24.957 22.3345 24.6529L14.7149 20.0238V14.8796C14.7149 14.7302 14.7543 14.5861 14.8278 14.458C15.0564 14.0579 15.5635 13.9217 15.9576 14.1566L24.6309 19.2927ZM28.4276 13.2307C28.9374 13.5295 29.25 14.0845 29.25 14.6822V26.67C29.25 26.9154 29.116 27.1423 28.9032 27.2596L27.1034 28.2468V19.901C27.1034 19.3113 26.7986 18.767 26.302 18.4629L18.5141 13.719V8.83896C18.5141 8.68955 18.5536 8.54549 18.6245 8.41742C18.8531 8.01724 19.3602 7.88112 19.7543 8.11324L28.4276 13.2307Z" | ||
| fill="#60D099" | ||
| fillRule="evenodd" | ||
| /> | ||
| </svg> | ||
| ) |
12 changes: 12 additions & 0 deletions
12
app/src/components/common/icons/currencies/CompoundIconNoBorder.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import React from 'react' | ||
|
|
||
| export const CompoundIconNoBorder = () => ( | ||
| <svg fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"> | ||
| <path | ||
| clipRule="evenodd" | ||
| d="M5.71778 17.0285C5.27239 16.7544 5 16.2661 5 15.7418V12.8142C5 12.7022 5.02982 12.5941 5.08549 12.498C5.25849 12.1979 5.64223 12.0958 5.94047 12.2719L12.5061 16.124C12.8898 16.3501 13.1264 16.7624 13.1264 17.2106V20.2443C13.1264 20.3823 13.0886 20.5204 13.0171 20.6385C12.8003 20.9947 12.339 21.1067 11.9851 20.8886L5.71778 17.0285ZM15.5045 11.4695C15.8882 11.6956 16.1248 12.1079 16.1248 12.5561V18.7114C16.1248 18.8935 16.0274 19.0616 15.8703 19.1496L14.4327 19.9641C14.4149 19.9741 14.395 19.9821 14.3751 19.9881V16.5702C14.3751 16.128 14.1444 15.7178 13.7667 15.4897L8.00043 12.0178V8.15968C8.00043 8.04762 8.03025 7.93957 8.08593 7.84353C8.25892 7.54339 8.64266 7.4413 8.94091 7.61742L15.5045 11.4695ZM18.3777 6.92304C18.7634 7.14716 19 7.56337 19 8.01162V17.0025C19 17.1866 18.8986 17.3567 18.7375 17.4447L17.3755 18.1851V11.9257C17.3755 11.4835 17.1449 11.0753 16.7691 10.8472L10.8756 7.28922V3.62922C10.8756 3.51716 10.9054 3.40911 10.9591 3.31307C11.1321 3.01293 11.5158 2.91084 11.8141 3.08493L18.3777 6.92304Z" | ||
| fill="#4B9E98" | ||
| fillRule="evenodd" | ||
| /> | ||
| </svg> | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
163 changes: 163 additions & 0 deletions
163
app/src/components/market/common/add_compound_service/index.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,163 @@ | ||
| import React from 'react' | ||
| import styled from 'styled-components' | ||
|
|
||
| import { getCTokenForToken } from '../../../../util/tools' | ||
| import { IconTick } from '../../../common/icons' | ||
| import { CompoundIcon } from '../../../common/icons/currencies/CompoundIcon' | ||
|
|
||
| const Wrapper = styled.div` | ||
| border-radius: 4px; | ||
| border: ${({ theme }) => theme.borders.borderLineDisabled}; | ||
| padding: 18px 25px; | ||
| margin-bottom: 20px; | ||
| ` | ||
|
|
||
| const Title = styled.h2` | ||
| color: ${props => props.theme.colors.textColorDark}; | ||
| font-size: 16px; | ||
| letter-spacing: 0.4px; | ||
| line-height: 1.2; | ||
| margin: 0 0 20px; | ||
| font-weight: 400; | ||
| ` | ||
|
|
||
| const DescriptionWrapper = styled.div` | ||
| align-items: center; | ||
| display: flex; | ||
| ` | ||
|
|
||
| const CheckService = styled.div<{ isServiceChecked: boolean }>` | ||
| width: 40px; | ||
| height: 40px; | ||
| border-radius: 50%; | ||
| text-align: center; | ||
| border: 1px solid ${props => (props.isServiceChecked ? props.theme.colors.transparent : props.theme.colors.tertiary)}; | ||
| background-color: ${props => | ||
| props.isServiceChecked ? props.theme.colors.clickable : props.theme.colors.mainBodyBackground}; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| &:hover { | ||
| border: 1px solid ${props => (props.isServiceChecked ? 'none' : props.theme.colors.tertiaryDark)}; | ||
| cursor: pointer; | ||
| } | ||
| &:active { | ||
| border: none; | ||
| } | ||
| path { | ||
| fill: ${props => | ||
| props.isServiceChecked ? props.theme.colors.mainBodyBackground : props.theme.textfield.textColorDark}; | ||
| } | ||
| ` | ||
|
|
||
| const ServiceWrapper = styled.div` | ||
| color: ${props => props.theme.colors.textColorLightish}; | ||
| font-size: ${props => props.theme.textfield.fontSize}; | ||
| letter-spacing: 0.2px; | ||
| line-height: 1.4; | ||
| display: flex; | ||
| -webkit-flex-direction: row; | ||
| -ms-flex-direction: row; | ||
| flex-direction: row; | ||
| -webkit-box-pack: justify; | ||
| ` | ||
|
|
||
| const ServiceIconWrapper = styled.div` | ||
| display: flex; | ||
| padding-right: 16px; | ||
| text-align: center; | ||
| -webkit-box-align: center; | ||
| ` | ||
|
|
||
| const ServiceTextWrapper = styled.div` | ||
| width: 90%; | ||
| ` | ||
|
|
||
| const ServiceCheckWrapper = styled.div` | ||
| width: 10%; | ||
| color: transparent; | ||
| ` | ||
|
pRoy24 marked this conversation as resolved.
|
||
|
|
||
| const CompoundServiceDescription = styled.div` | ||
| color: ${props => props.theme.colors.textColorLightish}; | ||
| font-size: ${props => props.theme.textfield.fontSize}; | ||
| letter-spacing: 0.2px; | ||
| line-height: 1.4; | ||
| margin: 0; | ||
| width: 100%; | ||
| ` | ||
|
|
||
| const ServiceTokenDetails = styled.div` | ||
| width: 100%; | ||
| display: flex; | ||
| ` | ||
|
|
||
| const TextHeading = styled.div` | ||
| color: ${props => props.theme.colors.textColorDark}; | ||
| width: 71px; | ||
| height: 16px; | ||
| left: 54px; | ||
| top: calc(50% - 16px / 2 - 11px); | ||
| font-weight: 500; | ||
| font-size: 14px; | ||
| line-height: 16px; | ||
| display: flex; | ||
| align-items: center; | ||
| letter-spacing: 0.2px; | ||
| margin: 0px 6px 0px 0px; | ||
| ` | ||
|
|
||
| const TextBody = styled.div` | ||
| line-height: 16px; | ||
| font-size: 14px; | ||
| height: 16px; | ||
| margin: 6px 6px 0px 0px; | ||
| ` | ||
|
|
||
| const TextBodyMarker = styled.span` | ||
| color: ${props => props.theme.colors.green}; | ||
| font-weight: 500; | ||
| ` | ||
|
|
||
| export interface AddCompoundServiceProps { | ||
| isServiceChecked: boolean | ||
| toggleServiceCheck?: any | ||
| compoundInterestRate: string | ||
| currentToken: string | ||
| } | ||
|
|
||
| export const AddCompoundService: React.FC<AddCompoundServiceProps> = (props: AddCompoundServiceProps) => { | ||
|
pRoy24 marked this conversation as resolved.
|
||
| const { compoundInterestRate, currentToken, isServiceChecked, toggleServiceCheck } = props | ||
| let serviceChecked = <IconTick selected={true} /> | ||
| if (!isServiceChecked) { | ||
| serviceChecked = <IconTick selected={false} /> | ||
| } | ||
| const cTokenSymbol = getCTokenForToken(currentToken) | ||
|
|
||
| return ( | ||
| <Wrapper> | ||
| <Title>Recommended Service</Title> | ||
| <DescriptionWrapper> | ||
| <CompoundServiceDescription> | ||
| <ServiceWrapper> | ||
| <ServiceIconWrapper> | ||
| <CompoundIcon /> | ||
| </ServiceIconWrapper> | ||
| <ServiceTokenDetails> | ||
| <ServiceTextWrapper> | ||
| <TextHeading>Compound</TextHeading> | ||
| <TextBody> | ||
| Convert {currentToken} to {cTokenSymbol} and | ||
| <TextBodyMarker> earn {compoundInterestRate}% APY</TextBodyMarker> | ||
| </TextBody> | ||
| </ServiceTextWrapper> | ||
| <ServiceCheckWrapper onClick={toggleServiceCheck}> | ||
| <CheckService isServiceChecked={isServiceChecked}>{serviceChecked}</CheckService> | ||
| </ServiceCheckWrapper> | ||
|
Comment on lines
+109
to
+158
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| </ServiceTokenDetails> | ||
| </ServiceWrapper> | ||
| </CompoundServiceDescription> | ||
| </DescriptionWrapper> | ||
| </Wrapper> | ||
|
pRoy24 marked this conversation as resolved.
|
||
| ) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think defining static values to width here is neccesary. I would suggest just adding

justify-content: space-between; to the parent element that is 100% and omitting width for these two values. The reason for this is because 10% is slightly more than 40px and creates this unnecessary margin...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed