Skip to content
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

Update master / release assets #1037

Merged
merged 285 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
285 commits
Select commit Hold shift + click to select a range
d5b03e1
Move reset button next to control title
edmulraney Aug 24, 2022
78fee4a
Merge pull request #874 from liquity/testnet-feedback
edmulraney Aug 24, 2022
8b35756
Add support for automatically refreshing backend values
edmulraney Aug 26, 2022
f5e2508
Load app like normal if bond contracts aren't found
edmulraney Aug 26, 2022
e76b000
Merge pull request #877 from liquity/background-synchronize
edmulraney Aug 26, 2022
54fb734
feat: simple swap pane
danielattilasimon Aug 31, 2022
2b91caa
feat: approve input token before swapping
danielattilasimon Aug 31, 2022
a6c0277
feat: describe error when input amount exceeds balance
danielattilasimon Aug 31, 2022
fa3b0ff
feat: add secondary actions for swapping bLUSD
danielattilasimon Aug 31, 2022
19b48c1
Fix rounding issues in bond time estimations. Use real NFT images fro…
edmulraney Sep 2, 2022
0c01623
Remove superfluous optimistic-bond logic
edmulraney Sep 2, 2022
37e9582
Merge pull request #880 from liquity/blusd-swap
danielattilasimon Sep 2, 2022
9677027
feat: adding liquidity
danielattilasimon Sep 2, 2022
4270e95
feat: don't show withdrawal when there's no LP
danielattilasimon Sep 2, 2022
79af81f
feat: removing liquidity
danielattilasimon Sep 2, 2022
89175ec
fix: able to press confirm on zero input
danielattilasimon Sep 2, 2022
0bc1437
Handle all cases where market premium can be 1 or less, leading to in…
edmulraney Sep 5, 2022
8e90e0c
Merge branch 'main' into use-nft-images
edmulraney Sep 5, 2022
d9fc023
Shadow and border on NFT image. Use simulated price when market price…
edmulraney Sep 5, 2022
27350d1
Merge pull request #881 from liquity/use-nft-images
edmulraney Sep 5, 2022
87ab52d
fix: image size off by 2 pixels after adding border
danielattilasimon Sep 6, 2022
c66a419
Merge remote-tracking branch 'origin/main' into blusd-lp
danielattilasimon Sep 6, 2022
b5fc127
Merge pull request #882 from liquity/blusd-lp
danielattilasimon Sep 6, 2022
4e95888
fix: ensure NFT image is always the correct size
danielattilasimon Sep 6, 2022
0119d97
feat: use counters to get bond stats
danielattilasimon Sep 6, 2022
bc1b60f
fix: no need to use BondNFT to get total bond count
danielattilasimon Sep 6, 2022
dd557b4
fix: error thrown when pressing max on "Create bond"
danielattilasimon Sep 7, 2022
6dc5a9b
fix: floor price being infinity when there's yield during bootstrap
danielattilasimon Sep 7, 2022
786cf26
fix: incorrect calculation of premium resulting in errors
danielattilasimon Sep 7, 2022
a072c8d
chore: upgrade to new Goerli deployment
danielattilasimon Sep 7, 2022
e9c59f2
Merge pull request #884 from liquity/use-counters
danielattilasimon Sep 7, 2022
61f1292
fix: incorrect accrued bLUSD values
danielattilasimon Sep 8, 2022
5efea75
fix: large number of decimals in percentages
danielattilasimon Sep 8, 2022
1c9fc5f
fix: too high returns
danielattilasimon Sep 8, 2022
354c980
fix: incorrect figure shown under max APR
danielattilasimon Sep 8, 2022
1bb8968
feat: don't show a milestone for "Accruing"
danielattilasimon Sep 8, 2022
65b2e2a
fix: corner cases of timeline
danielattilasimon Sep 8, 2022
023a4c4
Merge pull request #885 from liquity/fix-accrued-amounts
danielattilasimon Sep 8, 2022
48e27f6
feat: add a dropdown for pool balance and LP supply
danielattilasimon Sep 8, 2022
6290b8e
Merge pull request #886 from liquity/timeline-feedback
danielattilasimon Sep 8, 2022
5e63c2e
Merge pull request #887 from liquity/blusd-lp-stats
danielattilasimon Sep 8, 2022
6a78737
fix: get the most up-to-date alpha
danielattilasimon Sep 9, 2022
5818314
Replace bond approval with a permit
edmulraney Sep 13, 2022
5512c16
Merge branch 'main' into create-bond-with-permit
edmulraney Sep 13, 2022
c4c5b9b
Merge pull request #894 from liquity/create-bond-with-permit
edmulraney Sep 22, 2022
e4fd5b5
Make pie chart render real treasury stats
edmulraney Sep 23, 2022
c397417
Switch AMM price from internal oracle to spot price since the oracle …
edmulraney Sep 23, 2022
d2f6aab
Merge pull request #897 from liquity/use-amm-spot-price-for-market-price
edmulraney Sep 23, 2022
032e9e2
Merge pull request #896 from liquity/dynamic-treasury-chart
edmulraney Sep 23, 2022
798c8e0
Add fair price range
edmulraney Sep 23, 2022
7dac2ab
Merge pull request #898 from liquity/fair-price-range
edmulraney Sep 23, 2022
82442f1
Merge pull request #888 from liquity/fix-alpha
danielattilasimon Sep 26, 2022
d0886e6
fix: permits not working on Goerli
danielattilasimon Sep 26, 2022
c484991
Merge pull request #899 from liquity/goerli-permit
danielattilasimon Sep 26, 2022
5c151d3
chore: update addresses to new deployment for the game
danielattilasimon Sep 26, 2022
24f4787
Merge pull request #901 from liquity/game-deployment
danielattilasimon Sep 26, 2022
b460496
Add bLUSD APR and Yield amplification stat
edmulraney Sep 26, 2022
725e879
Use the canoninical definition of break even and rebond time in the b…
edmulraney Sep 27, 2022
01c41b5
Hide liquidity management if on mainnet
edmulraney Sep 27, 2022
b76a1f6
Add message explaining that buying/selling bLUSD function is using th…
edmulraney Sep 27, 2022
994a5d4
Final information message before bonding
edmulraney Sep 27, 2022
b0762a2
Remove unused assets from prototype testing
edmulraney Sep 27, 2022
b3a5945
Disable Claim bond when bootstrap period is active
edmulraney Sep 27, 2022
6bd394c
Address outstanding TODOs
edmulraney Sep 27, 2022
5e45c5c
Use opensea URL for NFT image link
edmulraney Sep 27, 2022
1b6c208
Make treasury chart handle zero and small values better
edmulraney Sep 27, 2022
3aa0bfd
Work out APR relative to reserve size rather than bLUSD supply size
edmulraney Sep 28, 2022
5e93727
Merge branch 'blusd-apr-and-yield-amplification' into various-ui-tasks
edmulraney Sep 28, 2022
2fdd5a4
Merge pull request #902 from liquity/blusd-apr-and-yield-amplification
edmulraney Sep 28, 2022
5630b3c
feat: configurable slippage tolerance
danielattilasimon Sep 28, 2022
47dcc9c
Use the LUSD sources to work out the fair price more accurately
edmulraney Sep 28, 2022
18f7f37
If a user's bonds fail to load, don't prevent protocol-info from load…
edmulraney Sep 28, 2022
8e5537f
Merge pull request #907 from liquity/lusd-bucket-source-for-apr-calcu…
edmulraney Sep 28, 2022
610aa4e
Merge pull request #906 from liquity/slippage
danielattilasimon Sep 28, 2022
7e9ead3
Merge remote-tracking branch 'origin/main' into various-ui-tasks
danielattilasimon Sep 28, 2022
4d9c314
Catch error from contracts that aren't deployed
edmulraney Sep 28, 2022
86b449f
Merge pull request #905 from liquity/various-ui-tasks
edmulraney Sep 28, 2022
29bf736
If reserve is empty don't show yield amplification
edmulraney Sep 28, 2022
54a0aea
Merge pull request #908 from liquity/empty-reserve-yield-amplification
edmulraney Sep 28, 2022
853de7a
Add the bLUSD amount that the bonder obtained when they claimed their…
edmulraney Sep 28, 2022
03eaf7d
Show reason why claim bond is disabled during bootstrap period
edmulraney Sep 28, 2022
108a659
Reword bond info message
edmulraney Sep 28, 2022
1f65ea1
Fit fair price statistic
edmulraney Sep 28, 2022
2e672e5
Merge pull request #909 from liquity/claimed-blusd-amount
edmulraney Sep 28, 2022
168d1fd
Center the example NFT image to match new designs
edmulraney Sep 29, 2022
4fda3cf
Remove superfluos warning about rebonding late
edmulraney Sep 29, 2022
84b8eff
fix: bonding TXs sometimes running out of gas
danielattilasimon Sep 29, 2022
fc9e628
fix: bLUSD swaps sometimes running out of gas
danielattilasimon Sep 29, 2022
4cc4ff6
fix: claim bond doesn't need added gas for LQTY issuance
danielattilasimon Sep 29, 2022
801bd2e
Merge pull request #910 from liquity/gas-headroom
danielattilasimon Sep 29, 2022
b6c5fa2
Add more descriptive lexicons for fair price, yield amplification etc.
edmulraney Sep 29, 2022
032add7
Show error message if user enters too little or too much LUSD when bo…
edmulraney Sep 29, 2022
52de1c8
Remove redemptions page as its not a user feature. Hide "new" badge o…
edmulraney Sep 29, 2022
46246fa
Merge pull request #911 from liquity/ui-feedback
edmulraney Sep 29, 2022
35c2fb8
Bond list rebond time tooltip was set to break even text
edmulraney Sep 30, 2022
26699c7
Merge pull request #912 from liquity/fix-rebond-tooltip
edmulraney Sep 30, 2022
ab3cdcc
feat: swap bLUSD/LUSD through bLUSD/3CRV pool
danielattilasimon Oct 2, 2022
102af15
fix: calculation of bLUSD market price on mainnet
danielattilasimon Oct 2, 2022
cba8011
feat: swap through LUSD-3Crv-f LP tokens instead of 3Crv
danielattilasimon Oct 3, 2022
0627c52
Add support for running against different networks at runtime
edmulraney Oct 3, 2022
bc1f598
Update market price tooltip
edmulraney Oct 3, 2022
f7fa6bf
feat: get addresses synchronously
danielattilasimon Oct 4, 2022
2dfbbe0
Merge pull request #914 from liquity/support-testnets
danielattilasimon Oct 4, 2022
cb89e22
Merge branch 'main' into swap-thru-lusd-3crv
danielattilasimon Oct 4, 2022
4cffc40
Merge pull request #916 from liquity/swap-thru-lusd-3crv
danielattilasimon Oct 4, 2022
9b01a78
Don't show that there are no pending bonds while theyre still loading
edmulraney Oct 4, 2022
3bb1f46
Merge pull request #918 from liquity/dont-show-no-bonds-when-loading
edmulraney Oct 4, 2022
2e61969
Readd max button on create bond
edmulraney Oct 4, 2022
1d2bb66
Merge pull request #919 from liquity/re-add-max-button
edmulraney Oct 4, 2022
c3c34dd
feat: show message when pool is empty
danielattilasimon Oct 4, 2022
3432a09
Various changes picked up on mainnet deployment
edmulraney Oct 4, 2022
fa54c9b
Merge pull request #920 from liquity/empty-pool-message
danielattilasimon Oct 4, 2022
7fc6c11
Merge pull request #921 from liquity/mainnet-changes
edmulraney Oct 4, 2022
3b7fe00
Add mainnet addresses
edmulraney Oct 4, 2022
5b360c6
Merge pull request #922 from liquity/mainnet-address
edmulraney Oct 4, 2022
9dbb35f
Use real correct LUSD address
edmulraney Oct 4, 2022
44614a5
Merge pull request #924 from liquity/fix-faucet
edmulraney Oct 4, 2022
48c8e17
Add zapper support and stake and unstake support for LP tokens
edmulraney Oct 13, 2022
4a5e2ad
Update node version in tests for compatibility with metamask sig-utils
edmulraney Oct 13, 2022
9c0e243
Rename acquired to reserve bucket
edmulraney Oct 13, 2022
03748fd
fix: Remove bLUSD liquidity Zap events and bLUSD removal wrapper
bingen Oct 14, 2022
a6182fc
Change OpenSea link to LooksRare
edmulraney Oct 17, 2022
86f7bd6
Use Curve instead of zapper for bLUSD deposits. Handle staking LP vs …
edmulraney Oct 18, 2022
7c55914
Improve description of simulator
edmulraney Oct 18, 2022
efb7fb5
Merge pull request #934 from liquity/simulator-tooltip
edmulraney Oct 18, 2022
fd936d2
Merge pull request #935 from liquity/looks-rare
edmulraney Oct 18, 2022
f6d516d
Merge pull request #929 from liquity/manage-blusd-liquidity
edmulraney Oct 18, 2022
b7da7bc
Add bLUSD zapper address
edmulraney Oct 18, 2022
d837c41
Merge pull request #936 from liquity/zapper-address
edmulraney Oct 18, 2022
20eec7b
BigInt support is required from cryptography dependencies etc. so mak…
edmulraney Oct 18, 2022
539ed83
Merge pull request #937 from liquity/set-browserslist-versions
edmulraney Oct 18, 2022
56e714d
fix: add extra gas to chickenIn() to ensure TX success
danielattilasimon Oct 19, 2022
b71d30e
fix: pool details show LUSD instead of LUSD3CRV-f
danielattilasimon Oct 19, 2022
fcd0288
Add bLUSD LP APR to bond stats
edmulraney Oct 20, 2022
93399e3
Shorten bLUSD market price description
edmulraney Oct 20, 2022
d83a989
Enable user to deposit liquidity balanced and show balance ratio
edmulraney Oct 20, 2022
94886ac
Increase floor price decimals so users can see it increasing
edmulraney Oct 20, 2022
d9636b3
Merge pull request #940 from liquity/fix-pool-details
danielattilasimon Oct 21, 2022
d13c0c3
Merge pull request #939 from liquity/chicken-in-gas-buffer
danielattilasimon Oct 21, 2022
2c38121
Merge pull request #944 from liquity/floor-price-decimals
edmulraney Oct 21, 2022
2a6de77
Merge pull request #942 from liquity/market-price-tooltip
edmulraney Oct 21, 2022
4cea560
Apply the balance ratio correcty!
edmulraney Oct 21, 2022
59dd8b8
Include base APR (trade fees)
edmulraney Oct 21, 2022
3cbe0a9
Merge branch 'main' into lp-balanced
edmulraney Oct 21, 2022
9872db4
Merge pull request #941 from liquity/blusd-lp-apr
edmulraney Oct 21, 2022
426126b
Merge pull request #943 from liquity/lp-balanced
edmulraney Oct 21, 2022
3149bc4
Enable viewing and claiming LP rewards
edmulraney Oct 24, 2022
dd2bf5f
Remove expandable element from pending rewards list
edmulraney Oct 25, 2022
3536c37
Merge pull request #948 from liquity/lp-rewards
edmulraney Oct 25, 2022
55f27ba
Update bond estimation formulas to factor the bLUSD controller ajuste…
edmulraney Nov 8, 2022
5ccb213
Use new bond length estimation in rebond APR calculation for pending …
edmulraney Nov 8, 2022
f195361
Fix linter
edmulraney Nov 8, 2022
e17f243
Subtract average from target instead of target from average
edmulraney Nov 8, 2022
add502f
Don't show rebond/break-even for non-pending bonds
edmulraney Nov 9, 2022
efc0d1d
Calculate floor price using the currently harvested LUSD amount to av…
edmulraney Nov 9, 2022
d4b89dd
Merge pull request #954 from liquity/bond-estimations-with-controller
edmulraney Nov 10, 2022
d5e6a6e
Merge branch 'main' into more-accurate-floor-price
edmulraney Nov 10, 2022
0e4b832
Merge pull request #956 from liquity/more-accurate-floor-price
edmulraney Nov 10, 2022
c0b686f
Increase blUSD market price by 1 DP
edmulraney Nov 10, 2022
2c41b68
Correct description of bLUSD
edmulraney Nov 10, 2022
ef17a13
Just use manage liquidity instead of intermediary 'adding liquidity' …
edmulraney Nov 10, 2022
f9afdae
Rename APR to bLUSD APR for clarity
edmulraney Nov 10, 2022
100f62b
Make pending bonds the default view for bonds page
edmulraney Nov 10, 2022
6c471d6
Specify pool balance asset as LUSD-3CRV not LUSD
edmulraney Nov 10, 2022
dd93b9a
Add bLUSD market price to pool details
edmulraney Nov 10, 2022
d4720b7
Add bLUSD APR to liquidity manager
edmulraney Nov 11, 2022
ce70b38
Merge pull request #957 from liquity/ui-enhancements
edmulraney Nov 11, 2022
d06d5cd
Update Readme with Tellor price data lag section
RickGriff Nov 21, 2022
7031c6a
Use current floor price for bonding calculations
edmulraney Nov 23, 2022
77ccbba
Merge pull request #960 from liquity/current-floor-price
edmulraney Nov 24, 2022
b244294
Add tooltips to actions view
edmulraney Jan 17, 2023
e55aa07
Add wind down price to bond stats
edmulraney Jan 17, 2023
a25a194
Show tooltips when estimations are infinite. Show warning when taking…
edmulraney Jan 17, 2023
c755df4
Get claimed bLUSD amount from NFT contract instead of logs
edmulraney Jan 18, 2023
71f3503
Optimize contract calls
edmulraney Jan 18, 2023
6d06098
Remove unused type
edmulraney Jan 18, 2023
9e5b05f
Rename wind down price to net asset value
edmulraney Jan 18, 2023
0b4eccc
Add links to tooltips. Use one tooltip library.
edmulraney Jan 19, 2023
24702f6
Update old links URLs to new ones
edmulraney Jan 19, 2023
2210a56
Merge pull request #983 from liquity/fixes
edmulraney Jan 19, 2023
04d2844
Reuse LearnMore link
edmulraney Jan 19, 2023
e2f7dc4
Merge pull request #984 from liquity/fixes
edmulraney Jan 19, 2023
33af915
chore: update yarn.lock
danielattilasimon Feb 17, 2023
444f786
feat: redeploy to Goerli
danielattilasimon Feb 17, 2023
dfd2cdf
Add tests for liquidation success with tiny P
RickGriff Feb 24, 2023
0c341ad
docs: fix minor typos
ChmielewskiKamil Feb 26, 2023
2fff46e
Merge pull request #996 from ChmielewskiKamil/patch-1
bingen Feb 27, 2023
aeff38e
Merge pull request from GHSA-m9f3-hrx8-x2g3
bingen Mar 1, 2023
1ec07b8
Fix bLUSD LP withdrawal sandwich attack
edmulraney Mar 12, 2023
f95dacc
Disable bLUSD LP withdraw
edmulraney Mar 13, 2023
2d3952b
Merge pull request #1006 from liquity/disable-lp-withdrawal
edmulraney Mar 13, 2023
5b3229e
Enforce min slippage of 0.1% on bLUSD lp withdrawal to reduce transac…
edmulraney Mar 14, 2023
44ea177
Merge pull request #1005 from liquity/fix-blusd-lp-sandwich-attack
edmulraney Mar 14, 2023
2d6b4e8
Fix CI
edmulraney Mar 17, 2023
6bfac43
Merge pull request #1007 from liquity/fix-blusd-lp-sandwich-attack
edmulraney Mar 17, 2023
5eea179
Updade min node version required for BigInt browser support etc.
edmulraney Mar 17, 2023
6598d41
Merge pull request #1008 from liquity/upgrade-ci-node
edmulraney Mar 17, 2023
08972de
Address the TODOs left in code
edmulraney Mar 17, 2023
57d9bb0
Merge pull request #1009 from liquity/update-todos
edmulraney Mar 21, 2023
8160392
Merge pull request #843 from liquity/eth_oracle
bingen Apr 13, 2023
6744df3
refactor: ditch create-react-app for vite
danielattilasimon May 17, 2023
4a89db4
chore: upgrade Ethers to v5.7
danielattilasimon May 18, 2023
1cb7728
feat: unfinished ConnectKit integration
danielattilasimon May 19, 2023
d033f0b
refactor: migrate to Yarn v3
danielattilasimon May 19, 2023
d43f72e
contracts: Fix typo. Rename LSUD to LUSD.
bingen May 29, 2023
3952efd
doc: fix broken link, description and typo
tanliwei Sep 9, 2022
14de1c1
fixup! doc: fix broken link, description and typo
bingen May 29, 2023
8f550ee
Merge pull request #1019 from liquity/tanliwei-main
bingen Jun 1, 2023
15853ad
Merge pull request #1018 from liquity/lsud_to_lusd
bingen Jun 1, 2023
966f86c
refactor: always call through Provider, even if there's a Signer
danielattilasimon Jun 12, 2023
ddadfc0
feat: finish up ConnectKit integration
danielattilasimon Jun 12, 2023
2560c92
test: fix smoke test
danielattilasimon Jun 12, 2023
55b3674
ci: fix use of deprecated yarn option
danielattilasimon Jun 12, 2023
137409e
refactor: make helper function a private method
danielattilasimon Jun 12, 2023
f690cd5
ci: update checkout and setup-node actions
danielattilasimon Jun 12, 2023
a110750
chore: add interactive-tools to yarn
danielattilasimon Jun 12, 2023
8580389
chore: upgrade @graphprotocol pkgs
danielattilasimon Jun 12, 2023
5470329
test: fix failing test case
danielattilasimon Jun 12, 2023
cd48f1d
ci: harmonize Node version across workflows
danielattilasimon Jun 12, 2023
3166b30
feat: bring back Multicall to optimize API usage
danielattilasimon Jun 13, 2023
0aa2271
test: fix some test failure
danielattilasimon Jun 13, 2023
84f94df
feat: expose new config options in Docker app
danielattilasimon Jun 13, 2023
0609ebd
Merge pull request #1016 from liquity/connectkit
danielattilasimon Jun 13, 2023
3063ed7
fix: 404 when put in a subdirectory
danielattilasimon Jun 13, 2023
9268fb0
fix: alchemyApiKey not being used from config
danielattilasimon Jun 13, 2023
b50cdb0
fix: don't hammer provider with calls after waking up from sleep
danielattilasimon Jun 14, 2023
facc947
fix: unsupported network message briefly shown while loading
danielattilasimon Jun 14, 2023
e59decd
fix: can't connect to Coinbase wallet
danielattilasimon Jun 14, 2023
2c19736
chore: automatically prepare after installation
danielattilasimon Jun 14, 2023
91821c2
Merge pull request #1020 from liquity/postinstall
danielattilasimon Jun 14, 2023
159a3c1
fix: not being able to swap bLUSD on mainnet
danielattilasimon Jun 14, 2023
767a7c0
fix: re-enable bLUSD withdrawal
edmulraney Jun 14, 2023
3c9cafd
Merge pull request #1021 from liquity/withdraw-blusd-lp
edmulraney Jun 14, 2023
019f29d
Make Stability pool APR badge single line
edmulraney Jun 19, 2023
652331c
Merge pull request #1022 from liquity/sp-apr-style
edmulraney Jun 19, 2023
89b4bd5
docs: update required Node version to v16
danielattilasimon Jul 14, 2023
92465ea
docs: fix DefiSafety link
danielattilasimon Aug 25, 2023
b6df1c9
docs: fix DefiSafety badge
danielattilasimon Aug 25, 2023
1f4a74d
docs: use an image from the repo for badge
danielattilasimon Aug 25, 2023
a0948b6
docs: add DefiSafety badge image
danielattilasimon Aug 25, 2023
f369e82
Update README
bingen Dec 5, 2023
28b8649
chore: upgrade Graph tooling but disable build
danielattilasimon Dec 25, 2023
b5007c2
Merge pull request #1032 from liquity/fix-install
danielattilasimon Dec 25, 2023
4d96eab
feat: add Sepolia testnet
danielattilasimon Jan 2, 2024
e5e5367
Merge pull request #1033 from liquity/sepolia
danielattilasimon Jan 2, 2024
40372dd
fix: testnet Sepolia not working with Alchemy API key
danielattilasimon Jan 3, 2024
ce7f382
Merge pull request #1034 from liquity/fix-sepolia
danielattilasimon Jan 4, 2024
b2b5025
Merge pull request #1030 from liquity/README_redeem_frontrun
bingen Jan 11, 2024
6781cd9
fix: missing bLUSD APR and yield amplification
danielattilasimon Jan 11, 2024
fc37ee6
Merge pull request #1035 from liquity/update-yearn-api
edmulraney Jan 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 8 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: 12.x

- id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: 16
cache: yarn
env:
# Workaround for https://github.com/actions/setup-node/issues/317
FORCE_COLOR: 0

- run: yarn install --frozen-lockfile
- run: yarn install --immutable
- run: yarn build

- name: Test SDK & UI
Expand Down
44 changes: 16 additions & 28 deletions .github/workflows/test-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: 12.x

- id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: 16
cache: yarn
env:
# Workaround for https://github.com/actions/setup-node/issues/317
FORCE_COLOR: 0

- run: yarn install --frozen-lockfile
- run: yarn install --immutable

- name: Test contracts
run: yarn test-contracts
Expand All @@ -46,23 +40,17 @@ jobs:
continue-on-error: true

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: 12.x

- id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: 16
cache: yarn
env:
# Workaround for https://github.com/actions/setup-node/issues/317
FORCE_COLOR: 0

- run: yarn install --frozen-lockfile
- run: yarn install --immutable

- name: Test contract coverage
run: yarn coverage
Expand Down
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,18 @@ node_modules

# Don't track NPM lockfile (we use Yarn)
package-lock.json

# Don't track hardhat mainnet fork cache
cache

# ngrok config is individual to each dev
ngrok.config.yml

# Yarn
.pnp.*
/.yarn/*
!/.yarn/patches
!/.yarn/plugins
!/.yarn/releases
!/.yarn/sdks
!/.yarn/versions
541 changes: 541 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

873 changes: 873 additions & 0 deletions .yarn/releases/yarn-3.5.1.cjs

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

yarnPath: .yarn/releases/yarn-3.5.1.cjs
46 changes: 39 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Liquity: Decentralized Borrowing Protocol

[<img alt="DeFiSafety Badge" width="96px" align="right" src="images/defisafety-badge.png" />](https://www.defisafety.com/app/pqrs/376)

![Tests](https://github.com/liquity/dev/workflows/CI/badge.svg) [![Frontend status](https://img.shields.io/uptimerobot/status/m784948796-056b56fd51c67d682c11bb24?label=Testnet&logo=nginx&logoColor=white)](https://devui.liquity.org) ![uptime](https://img.shields.io/uptimerobot/ratio/7/m784948796-056b56fd51c67d682c11bb24) [![Discord](https://img.shields.io/discord/700620821198143498?label=join%20chat&logo=discord&logoColor=white)](https://discord.gg/2up5U32) [![Docker Pulls](https://img.shields.io/docker/pulls/liquity/dev-frontend?label=dev-frontend%20pulls&logo=docker&logoColor=white)](https://hub.docker.com/r/liquity/dev-frontend) [![codecov](https://codecov.io/gh/liquity/dev/branch/add_codecov/graph/badge.svg)](https://codecov.io/gh/liquity/dev)


Expand Down Expand Up @@ -123,6 +125,7 @@ Visit [liquity.org](https://www.liquity.org) to find out more and join the discu
- [Start a local blockchain and deploy the contracts](#start-a-local-blockchain-and-deploy-the-contracts)
- [Start dev-frontend in development mode](#start-dev-frontend-in-development-mode)
- [Start dev-frontend in demo mode](#start-dev-frontend-in-demo-mode)
- [Start dev-frontend against a mainnet fork RPC node](#start-dev-frontend-against-a-mainnet-fork-rpc-node)
- [Build dev-frontend for production](#build-dev-frontend-for-production)
- [Configuring your custom frontend](#configuring-your-custom-dev-ui)
- [Running a frontend with Docker](#running-dev-ui-with-docker)
Expand Down Expand Up @@ -306,7 +309,7 @@ In the first year after launch:

- The Liquity admin address may transfer tokens **only to verified lockup contracts with an unlock date at least one year after system deployment**

Also, separate LQTY allocations are made at deployent to an EOA that will hold an amount of LQTY for bug bounties/hackathons and to a Uniswap LP reward contract. Aside from these allocations, the only LQTY made freely available in this first year is the LQTY that is publically issued to Stability Providers via the `CommunityIssuance` contract.
Also, separate LQTY allocations are made at deployment to an EOA that will hold an amount of LQTY for bug bounties/hackathons and to a Uniswap LP reward contract. Aside from these allocations, the only LQTY made freely available in this first year is the LQTY that is publically issued to Stability Providers via the `CommunityIssuance` contract.

### Lockup Implementation and admin transfer restriction

Expand Down Expand Up @@ -411,6 +414,12 @@ There is also a return condition `bothOraclesLiveAndUnbrokenAndSimilarPrice` whi

The current `PriceFeed.sol` contract has an external `fetchPrice()` function that is called by core Liquity functions which require a current ETH:USD price. `fetchPrice()` calls each oracle's proxy, asserts on the responses, and converts returned prices to 18 digits.

### Tellor price data lag

Liquity sees a Tellor ETH-USD price that is at least 15 minutes old. This is because Tellor operates via proof-of-stake, and some dispute period is needed in which fake prices can be disputed. When a Tellor price is disputed, it is removed from the list of prices that Liquity sees. This dispute period ensures that, given at least one responsive disputer who disputes fake ETH prices, Liquity will never consume fake price data from Tellor.

The choice of 15 minutes for the dispute period was based on careful analysis of the impact of a delayed ETH price on a Liquity system. We used historical ETH price data and looked at the impact of different delay lengths. 15 minutes was chosen as a sweet spot that gives plenty of time for disputers to respond to fake prices, while keeping any adverse impacts on Liquity to a minimum.

### PriceFeed Logic

The PriceFeed contract fetches the current price and previous price from Chainlink and changes its state (called `Status`) based on certain conditions.
Expand Down Expand Up @@ -481,7 +490,7 @@ Thus, nodes need only be re-inserted to the sorted list upon a Trove operation -

![Flow of Ether](images/ETH_flows.svg)

Ether in the system lives in three Pools: the ActivePool, the DefaultPool and the StabilityPool. When an operation is made, Ether is transferred in one of three ways:
Ether in the system lives in four Pools: the ActivePool, the DefaultPool, the StabilityPool and the CollSurplusPool, plus LQTYStaking contract. When an operation is made, Ether is transferred in one of three ways:

- From a user to a Pool
- From a Pool to a user
Expand All @@ -491,6 +500,8 @@ Ether is recorded on an _individual_ level, but stored in _aggregate_ in a Pool.

Likewise, the StabilityPool holds the total accumulated ETH gains from liquidations for all depositors.

LQTYStaking receives ETH coming from redemption fees.

**Borrower Operations**

| Function | ETH quantity | Path |
Expand Down Expand Up @@ -771,7 +782,7 @@ All data structures with the ‘public’ visibility specifier are ‘gettable

`getEntireSystemDebt()` Returns the systemic entire debt assigned to Troves, i.e. the sum of the LUSDDebt in the Active Pool and the Default Pool.

`getTCR()`: returns the total collateralization ratio (TCR) of the system. The TCR is based on the the entire system debt and collateral (including pending rewards).
`getTCR()`: returns the total collateralization ratio (TCR) of the system. The TCR is based on the entire system debt and collateral (including pending rewards).

`checkRecoveryMode()`: reveals whether or not the system is in Recovery Mode (i.e. whether the Total Collateralization Ratio (TCR) is below the Critical Collateralization Ratio (CCR)).

Expand All @@ -783,7 +794,7 @@ All data structures with the ‘public’ visibility specifier are ‘gettable

- `firstRedemptionHint` is a positional hint for the first redeemable Trove (i.e. Trove with the lowest ICR >= MCR).
- `partialRedemptionHintNICR` is the final nominal ICR of the last Trove after being hit by partial redemption, or zero in case of no partial redemption (see [Hints for `redeemCollateral`](#hints-for-redeemcollateral)).
- `truncatedLUSDamount` is the maximum amount that can be redeemed out of the the provided `_LUSDamount`. This can be lower than `_LUSDamount` when redeeming the full amount would leave the last Trove of the redemption sequence with less debt than the minimum allowed value.
- `truncatedLUSDamount` is the maximum amount that can be redeemed out of the provided `_LUSDamount`. This can be lower than `_LUSDamount` when redeeming the full amount would leave the last Trove of the redemption sequence with less debt than the minimum allowed value.

The number of Troves to consider for redemption can be capped by passing a non-zero value as `_maxIterations`, while passing zero will leave it uncapped.

Expand Down Expand Up @@ -1055,7 +1066,7 @@ Stability Providers expect a positive ROI on their initial deposit. That is:

When a liquidation hits the Stability Pool, it is known as an **offset**: the debt of the Trove is offset against the LUSD in the Pool. When **x** LUSD debt is offset, the debt is cancelled, and **x** LUSD in the Pool is burned. When the LUSD Stability Pool is greater than the debt of the Trove, all the Trove's debt is cancelled, and all its ETH is shared between depositors. This is a **pure offset**.

It can happen that the LUSD in the Stability Pool is less than the debt of a Trove. In this case, the the whole Stability Pool will be used to offset a fraction of the Trove’s debt, and an equal fraction of the Trove’s ETH collateral will be assigned to Stability Providers. The remainder of the Trove’s debt and ETH gets redistributed to active Troves. This is a **mixed offset and redistribution**.
It can happen that the LUSD in the Stability Pool is less than the debt of a Trove. In this case, the whole Stability Pool will be used to offset a fraction of the Trove’s debt, and an equal fraction of the Trove’s ETH collateral will be assigned to Stability Providers. The remainder of the Trove’s debt and ETH gets redistributed to active Troves. This is a **mixed offset and redistribution**.

Because the ETH collateral fraction matches the offset debt fraction, the effective ICR of the collateral and debt that is offset, is equal to the ICR of the Trove. So, for depositors, the ROI per liquidation depends only on the ICR of the liquidated Trove.

Expand Down Expand Up @@ -1416,7 +1427,7 @@ In addition, some package scripts require Docker to be installed (Docker Desktop
You'll need to install the following:

- [Git](https://help.github.com/en/github/getting-started-with-github/set-up-git) (of course)
- [Node v12.x](https://nodejs.org/dist/latest-v12.x/)
- [Node v16.x](https://nodejs.org/dist/latest-v16.x/)
- [Docker](https://docs.docker.com/get-docker/)
- [Yarn](https://classic.yarnpkg.com/en/docs/install)

Expand Down Expand Up @@ -1489,7 +1500,7 @@ This copies the contract artifacts to a version controlled area (`packages/lib/l
yarn start-dev-chain
```

Starts an openethereum node in a Docker container, running the [private development chain](https://openethereum.github.io/wiki/Private-development-chain), then deploys the contracts to this chain.
Starts an openethereum node in a Docker container, running the [private development chain](https://openethereum.github.io/Private-development-chain), then deploys the contracts to this chain.

You may want to use this before starting the dev-frontend in development mode. To use the newly deployed contracts, switch MetaMask to the built-in "Localhost 8545" network.

Expand Down Expand Up @@ -1532,6 +1543,25 @@ When you no longer need the demo mode, press Ctrl+C in the terminal then run:
yarn stop-demo
```

#### Start dev-frontend against a mainnet fork RPC node

This will start a hardhat mainnet forked RPC node at the block number configured in `hardhat.config.mainnet-fork.ts`, so you need to make sure you're not running a hardhat node on port 8545 already.

You'll need an Alchemy API key to create the fork.

```
ALCHEMY_API_KEY=enter_your_key_here yarn start-fork
```

```
yarn start-demo:dev-frontend
```

This spawns a modified version of dev-frontend that automatically signs transactions so you don't need to interact with a browser wallet. It directly uses the local forked RPC node.

You may need to wait a minute or so for your fork mainnet provider to load and cache all the blockchain state at your chosen block number. Refresh the page after 5 minutes.


#### Build dev-frontend for production

In a freshly cloned & installed monorepo, or if you have only modified code inside the dev-frontend package:
Expand Down Expand Up @@ -1709,6 +1739,8 @@ In case of a redemption, the “last” trove affected by the transaction may en

An attacker trying to DoS redemptions could be bypassed by redeeming an amount that exactly corresponds to the debt of the affected trove(s).

The attack can be aggravated if a big trove is placed first in the queue, so that any incoming redemption is smaller than its debt, as no LUSD would be redeemed if the hint for that trove fails. But that attack would be very expensive and quite risky (risk of being redeemed if the strategy fails and of being liquidated as it may have a low CR).

Finally, this DoS could be avoided if the initial transaction avoids the public gas auction entirely and is sent direct-to-miner, via (for example) Flashbots.


Expand Down
2 changes: 1 addition & 1 deletion dev-chain/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"accountStartNonce": "0x0",
"maximumExtraDataSize": "0x20",
"minGasLimit": "0x1388",
"networkID": "0x11",
"networkID": "0x539",
"registrar": "0x0000000000000000000000000000000000001337",
"eip150Transition": "0x0",
"eip160Transition": "0x0",
Expand Down
25 changes: 25 additions & 0 deletions hardhat.config.mainnet-fork.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { HardhatUserConfig } from "hardhat/config";

const alchemyApiKey = process.env.ALCHEMY_API_KEY;

const config: HardhatUserConfig = {
solidity: "0.7.3",
networks: {
hardhat: {
chainId: 1,
forking: {
url: `https://eth-mainnet.g.alchemy.com/v2/${alchemyApiKey}`,
blockNumber: 16233419
},
accounts: [
{
privateKey: "0x4d5db4107d237df6a3d58ee5f70ae63d73d7658d4026f2eefd2f204c81682cb7",
balance: "100000000000000000000000"
}
],
initialBaseFeePerGas: 0
}
}
};

export default config;
Binary file added images/defisafety-badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions ngrok.config.template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: "2"
region: "eu"
web_addr: 127.0.0.1:41356
tunnels:
web:
addr: 32318
proto: http
schemes: [http]
host_header: rewrite
rpc:
addr: 8545
proto: http
schemes: [http]
36 changes: 23 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
"**/react-scripts"
]
},
"engines": {
"node": ">=14.0.0 <17.0.0"
},
"release": {
"extends": "semantic-release-monorepo",
"branches": [
Expand All @@ -40,15 +43,19 @@
]
},
"scripts": {
"build": "run-s build:*",
"build": "run-s 'build:*'",
"build:dev-frontend": "yarn workspace @liquity/dev-frontend build",
"build:subgraph": "yarn workspace @liquity/subgraph build",
"deploy": "yarn workspace @liquity/lib-ethers hardhat deploy",
"docs": "run-s docs:*",
"deploy:chicken-bonds": "yarn --cwd ../ChickenBond deploy-fork compile publish:local",
"watch:chicken-bonds": "yarn --cwd ../ChickenBond watch",
"link:chicken-bonds": "yarn workspace @liquity/dev-frontend link:chicken-bonds",
"unlink:chicken-bonds": "yarn workspace @liquity/dev-frontend unlink:chicken-bonds",
"docs": "run-s 'docs:*'",
"docs:collect-sdk-apis": "node scripts/collect-sdk-apis.js",
"docs:api-documenter": "api-documenter generate -i temp/sdk-apis -o docs/sdk",
"fuzzer": "yarn workspace @liquity/fuzzer fuzzer",
"prepare": "run-s prepare:*",
"postinstall": "run-s prepare",
"prepare": "run-s 'prepare:*'",
"prepare:contracts": "yarn workspace @liquity/contracts prepare",
"prepare:lib-base": "yarn workspace @liquity/lib-base prepare",
"prepare:lib-ethers": "yarn workspace @liquity/lib-ethers prepare",
Expand All @@ -58,35 +65,37 @@
"prepare:subgraph": "yarn workspace @liquity/subgraph prepare",
"prepare:docs": "run-s docs",
"rebuild": "run-s prepare build",
"release": "run-s release:*",
"release": "run-s 'release:*'",
"release:delete-dev-deployments": "yarn workspace @liquity/lib-ethers delete-dev-deployments",
"release:lib-base": "yarn workspace @liquity/lib-base semantic-release",
"release:lib-ethers": "yarn workspace @liquity/lib-ethers semantic-release",
"release:lib-react": "yarn workspace @liquity/lib-react semantic-release",
"release:providers": "yarn workspace @liquity/providers semantic-release",
"save-live-version": "yarn workspace @liquity/lib-ethers save-live-version",
"start-dev-chain": "run-s start-dev-chain:*",
"start-dev-chain": "run-s 'start-dev-chain:*'",
"start-dev-chain:openethereum": "node dev-chain/start.js",
"start-dev-chain:prepare-providers": "yarn prepare:providers",
"start-dev-chain:deploy-contracts": "yarn deploy --network dev",
"start-dev-chain:prepare-lib-ethers": "yarn prepare:lib-ethers",
"stop-dev-chain": "docker kill openethereum",
"start-dev-frontend": "yarn workspace @liquity/dev-frontend start",
"start-demo": "run-s start-demo:*",
"start-demo": "run-s 'start-demo:*'",
"start-demo:dev-chain": "yarn start-dev-chain",
"start-demo:dev-frontend": "yarn workspace @liquity/dev-frontend start-demo",
"stop-demo": "yarn stop-dev-chain",
"test": "run-s test:*",
"start-fork": "hardhat --config hardhat.config.mainnet-fork.ts node",
"start-tunnel": "./scripts/start-local-tunnel.sh",
"test": "run-s 'test:*'",
"test:lib-base": "yarn workspace @liquity/lib-base test",
"test:lib-ethers": "yarn workspace @liquity/lib-ethers test",
"test:dev-frontend": "run-s --continue-on-error test:dev-frontend:*",
"test:dev-frontend": "run-s --continue-on-error 'test:dev-frontend:*'",
"test:dev-frontend:start-dev-chain": "yarn start-dev-chain",
"test:dev-frontend:run": "yarn workspace @liquity/dev-frontend test --watchAll=false --forceExit --detectOpenHandles",
"test:dev-frontend:run": "yarn workspace @liquity/dev-frontend test run",
"test:dev-frontend:stop-dev-chain": "yarn stop-dev-chain",
"test-contracts": "yarn workspace @liquity/contracts test",
"test-live": "run-s test-live:*",
"test-live": "run-s 'test-live:*'",
"test-live:lib-ethers": "yarn workspace @liquity/lib-ethers test-live",
"coverage": "run-s coverage:*",
"coverage": "run-s 'coverage:*'",
"coverage:contracts": "yarn workspace @liquity/contracts coverage"
},
"devDependencies": {
Expand All @@ -98,5 +107,6 @@
"prettier": "^2.1.2",
"semantic-release": "^17.4.2",
"semantic-release-monorepo": "^7.0.4"
}
},
"packageManager": "yarn@3.5.1"
}
Loading
Loading