Skip to content

Commit bc02e13

Browse files
authored
feat: upgrade API to backend v0.1.2-v0.2.1 fixes (#382)
* feat: add new token pair types and utilities * feat: add more tokens in development * fix: decodeEvent should accept EventSDKType * fix: getEventAttributeMap should only resolve Dex actions * docs: note needed fix around Swap subscription events * feat: improve and add to chain events list * docs: note event string types more specifically * feat: add parseAmountDenomString utility function * fix: setState sometimes during render was causing error * feat: show ticks of all fees at all times on the liquidity chart * docs: note purpose of mergeBuckets better * feat: make behind-enemy-ticks visible on liquidity chart: - by allowing them to be grouped into buckets - and stacking bucket values on top of each other in the chart * fix: pair midpoint assuming that liquidity may be "behind enemy lines" - calculate the midpoint in a way to minimize the amount of liquidity value that is "behind enemy lines" of the midpoint * fix: make bucket height the reserves current sale value at pair price this value well represents value near the pair price and at extremes - eg. using a pair price of 100: - 1 token1 placed at price 10,000,000,000 is value of 100 - 1 token0 placed at price 0.00000000001 is value of 0.01 - the value of the bucket height represents the relative value of depositing that amount of reserves at this point in time (at this price, assuming our price is relatively accurate) * refactor: match most ticks by tickIndex related to current price index * feat: allow liquidity buckets to be shown stacked or merged * feat: improve transition animation for tick buckets * feat: make h1 text heavier * feat: add border to page-card style * chore: update react and dependencies to support 18.2.0 * feat: upgrade react-query * feat: allow fetching user share values from a specific token pair * feat: abstract out userShares hooks * fix: token0 totalReserves context was not being queried correctly * fix: remove queries that query the incorrect pool reserve endpoints * feat: abstract out user positions context hook * refactor: improve setting UserDepositFilter default values * refactor: abstract out userShareValues hooks * refactor: abstract out userBankValues hooks * refactor: simplify ShareValuesPage, remove unused props * refactor: calculate userReserves in the UserPositionDepositContext - and make the context properties more clearly differentiated * refactor: simplify type * refactor: make used DepositRecord types more strict - this should help us not have to check for the pairID property whenever we want to use the type * fix: deposit context should have connected upper/lower contexts * fix: replace userPositions endpoint with bank balances endpoint: - until the data is fixed - currently the endpoint only return positive index shares * fix: query return functions should not return undefined: - these trigger a dev console error - fix by explicitly returning null * fix: update useQueries options for referentially stable results: - see: TanStack/query#5219 * fix: empty arrays were referentially unstable and causing rerenders * fix: reduce re-rendering with better memoization and dense result arrays * fix: reduce re-rendering caused by useQueries "combine" recalculations * refactor: remove unused useRpc and use LcdClient methods - these methods were unreliable and would sometimes not connect to the endpoint as intended - possibly the resolving of the promise did not set the new value * fix: pool composition in table was missing context * fix: allow useShareValueMap to work with all pairs or given pairs * fix: compute share values in small tokens * fix: calculate user reserve values in table from small denom units * fix: find totalShares item correctly in useUserPositionsContext * docs: add note about placement of user balance filtering * feat: resolve dev tokens prices better: alongside real prices
1 parent 9d231a5 commit bc02e13

28 files changed

+1221
-598
lines changed

.env.development

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
PUBLIC_URL=https://app.dev.duality.xyz
33

4+
REACT_APP__IS_MAINNET=testnet
5+
46
# Add prices for development tokens
57
REACT_APP__DEV_TOKEN_DENOMS=["sdk.coin:token", "sdk.coin:stake"]
68

package-lock.json

Lines changed: 89 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@fortawesome/react-fontawesome": "^0.2.0",
2626
"@reach/dialog": "^0.17.0",
2727
"@react-hook/resize-observer": "^1.2.6",
28-
"@tanstack/react-query": "^4.29.7",
28+
"@tanstack/react-query": "^5.0.0-alpha.35",
2929
"bignumber.js": "^9.0.2",
3030
"buffer": "^6.0.3",
3131
"chain-registry": "^1.0.0",

src/components/LiquiditySelector/LiquiditySelector.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
.tick-buckets {
2222
.tick-bucket {
23-
transition: opacity 0.15s ease-in-out, d 0.15s ease-in-out;
23+
transition: opacity 0.15s ease-in-out, y 0.1s ease, height 0.1s ease;
2424
stroke-width: 0.125;
2525
opacity: 0.75;
2626
}
@@ -30,6 +30,11 @@
3030
fill: hsl(202deg 58% 33%);
3131
stroke: hsl(202deg 58% 33%);
3232
}
33+
34+
// make behind-enemy-lines buckets placed over main buckets a little less opaque
35+
&.tick-buckets--merged .tick-bucket.behind-enemy-lines {
36+
fill-opacity: 0.75;
37+
}
3338
}
3439
.chart-type--amm {
3540
.tick-bucket {

0 commit comments

Comments
 (0)