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

fix build lint #3627

Draft
wants to merge 613 commits into
base: stage
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
613 commits
Select commit Hold shift + click to select a range
14afb1e
Merge branch 'feat/implement-limit-orders' into connor/market-order-e…
crnbarr93 Jul 9, 2024
78aea20
Merge branch 'stage' into feat/implement-limit-orders
crnbarr93 Jul 9, 2024
077ffe6
Merge branch 'feat/implement-limit-orders' into connor/market-order-e…
crnbarr93 Jul 9, 2024
313a84a
chore: merge adjustments
crnbarr93 Jul 10, 2024
f7d39d7
Merge branch 'feat/implement-limit-orders' into connor/resizing-input
crnbarr93 Jul 10, 2024
691b5e0
feat: added adjusting fontsize
crnbarr93 Jul 10, 2024
44d3bd8
feat: limit input size scales with input length
crnbarr93 Jul 10, 2024
bfe8ca1
feat: close modal and reset form on limit/market order
crnbarr93 Jul 10, 2024
f945248
build: fix build errors
crnbarr93 Jul 10, 2024
a383531
Merge pull request #3478 from osmosis-labs/connor/review-market-modal
crnbarr93 Jul 10, 2024
1a3f956
Merge pull request #3487 from osmosis-labs/connor/market-order-expect…
crnbarr93 Jul 10, 2024
1da2c66
Merge branch 'feat/implement-limit-orders' into connor/resizing-input
crnbarr93 Jul 10, 2024
9b9632b
Merge pull request #3489 from osmosis-labs/connor/resizing-input
crnbarr93 Jul 10, 2024
fdd5673
build: removed unused typing
crnbarr93 Jul 10, 2024
6904f47
feat: update price selector font size
fabryscript Jul 10, 2024
8c9dba7
feat: open to asset modal
fabryscript Jul 10, 2024
4455e59
feat: decrease status font size
fabryscript Jul 11, 2024
fa8cea9
fix: fix price selector padding
fabryscript Jul 11, 2024
eb02d78
fix: fix insufficient balance label
fabryscript Jul 11, 2024
b8e5130
feat: simplify toggleMax logic
fabryscript Jul 11, 2024
d561b7f
Merge branch feat/implement-limit-orders into connor/max-button
fabryscript Jul 11, 2024
1506e67
Merge branch 'feat/implement-limit-orders' into connor/max-button
fabryscript Jul 11, 2024
9e776c1
Merge pull request #3462 from osmosis-labs/connor/max-button
fabryscript Jul 11, 2024
e4e757a
Merge branch 'feat/implement-limit-orders' into connor/order-pagination
fabryscript Jul 11, 2024
e3bdd37
Merge pull request #3439 from osmosis-labs/connor/order-pagination
fabryscript Jul 11, 2024
ad8792b
Merge branch 'feat/implement-limit-orders' of github.com:osmosis-labs…
fabryscript Jul 11, 2024
03b4fc9
fix: fix swap button misplaced on swap tool
fabryscript Jul 11, 2024
f23299f
fix: fix select limit responsive justifying
fabryscript Jul 11, 2024
c70ea17
fix: let swap button also swap values
fabryscript Jul 11, 2024
76b646e
fix: fix gap between tab selector and content
fabryscript Jul 11, 2024
bb53a0e
fix: fix token & price selector border radius
fabryscript Jul 11, 2024
2d43ada
feat: add base modal responsive margin rules
fabryscript Jul 11, 2024
bca62d8
chore: remove useless comment
fabryscript Jul 11, 2024
16ae3ad
feat: add open orders card
fabryscript Jul 11, 2024
bc9ce67
feat: show highest balance assets icons on price selector if wallet i…
fabryscript Jul 12, 2024
b467f90
fix: fix manual slippage handling to show correct placeholder
fabryscript Jul 12, 2024
70c62a2
fix: update exchange icon props
fabryscript Jul 12, 2024
bef3e42
feat: WIP add funds UI
fabryscript Jul 12, 2024
7cba044
feat: add deposit USDC/USDT flow start
fabryscript Jul 12, 2024
36dd409
feat: add last add funds option functionality
fabryscript Jul 12, 2024
094e417
fix: fix text left on "Sell an asset" option
fabryscript Jul 12, 2024
e66e0e0
feat: remove fixed width/height from "deposit" icon
fabryscript Jul 12, 2024
9da5d76
feat: adapt add funds modal for swap tool
fabryscript Jul 12, 2024
c421f58
feat: update design of swap token selection modals
fabryscript Jul 12, 2024
daf6b5e
fix: fix trade details height calc
fabryscript Jul 12, 2024
2c92e9c
chore: remove unused hook
fabryscript Jul 12, 2024
812975c
refactor: altered orderbook denoms to be taken from instantiate message
crnbarr93 Jul 15, 2024
a3db132
Merge branch 'stage' into feat/implement-limit-orders
crnbarr93 Jul 15, 2024
83d5166
refactor: matched some files with stage and removed build error
crnbarr93 Jul 15, 2024
39806c8
build: removed duplicate package definition
crnbarr93 Jul 15, 2024
7d9c962
chore: remove unused paramater
crnbarr93 Jul 15, 2024
a7bceb1
Merge branch 'stage' into feat/implement-limit-orders
crnbarr93 Jul 15, 2024
12e5709
build: yarn.lock
crnbarr93 Jul 15, 2024
b81a04e
Merge branch 'stage' into feat/implement-limit-orders
crnbarr93 Jul 15, 2024
beca50a
chore: resolve merge issues
crnbarr93 Jul 15, 2024
d64bdfc
Merge branch 'feat/implement-limit-orders' into connor/orderbook-denoms
crnbarr93 Jul 15, 2024
3dff937
Merge pull request #3517 from osmosis-labs/connor/orderbook-denoms
crnbarr93 Jul 15, 2024
8fa8588
Merge branch 'feat/implement-limit-orders' of github.com:osmosis-labs…
fabryscript Jul 15, 2024
1281530
Merge branch 'feat/implement-limit-orders' into connor/post-order
crnbarr93 Jul 15, 2024
a1223b5
build: removed unused import
crnbarr93 Jul 15, 2024
7423e99
fix: fix merge duplicate condition
fabryscript Jul 15, 2024
edfce7d
fix: fixed order index for order history
crnbarr93 Jul 16, 2024
ec08790
Merge pull request #3471 from osmosis-labs/fabryscript/implement-qa-c…
fabryscript Jul 16, 2024
001fb96
Merge branch 'feat/implement-limit-orders' into connor/post-order
crnbarr93 Jul 16, 2024
517ed5f
fix: removed infinite loading
crnbarr93 Jul 16, 2024
186f835
feat: added loading state for reviewing order modal
crnbarr93 Jul 16, 2024
aac2f9d
refactor: fixed insufficient funds colour
crnbarr93 Jul 16, 2024
e917c93
feat: improved error handling for usePlaceLimit
crnbarr93 Jul 16, 2024
0a9af51
fix: added condition to catch not enough liquidity error from direct …
crnbarr93 Jul 16, 2024
58fae24
feat: added error message passing to error constructors for routeByTo…
crnbarr93 Jul 16, 2024
f7d807b
fix: added mainnet code id for orderbook
crnbarr93 Jul 16, 2024
1b913a2
fix: input limitations and incorrect error states fixed
crnbarr93 Jul 16, 2024
50e0e1f
feat: added useOrderbook error field
crnbarr93 Jul 16, 2024
3d6fd9d
chore: translated no orderbook error
crnbarr93 Jul 16, 2024
c2d9ff9
fix: fixed quote/asset denom fetching for active orders
crnbarr93 Jul 16, 2024
1a32d4a
refactor: removed unused query
crnbarr93 Jul 16, 2024
fec8856
Merge branch 'stage' into feat/implement-limit-orders
crnbarr93 Jul 16, 2024
595f56c
Merge branch 'feat/implement-limit-orders' into connor/error-states
crnbarr93 Jul 16, 2024
f4dca88
feat: added maker fee error for useOrderbook
crnbarr93 Jul 16, 2024
5050528
feat: change side nav swap page title to "trade"
fabryscript Jul 17, 2024
e39d5a6
Merge pull request #3531 from osmosis-labs/connor/error-states
crnbarr93 Jul 17, 2024
6378c1e
Merge pull request #3532 from osmosis-labs/connor/order-history-quote…
crnbarr93 Jul 17, 2024
e4a407d
chore: remove redundant condition on userQuotes
fabryscript Jul 17, 2024
b1aea64
Merge branch 'feat/implement-limit-orders' into connor/post-order
crnbarr93 Jul 17, 2024
ad20b9f
refactor: removed export from unused function
crnbarr93 Jul 17, 2024
d940192
Merge pull request #3526 from osmosis-labs/connor/post-order
crnbarr93 Jul 17, 2024
96f32b1
feat: update figs to route lanes and re-implement layout
fabryscript Jul 17, 2024
51e8601
feat: added canonical orderbooks query to edge router for orderbooks
crnbarr93 Jul 17, 2024
cb0d3a2
feat: migrate asset info page trade tool, add custom tab colors and m…
fabryscript Jul 17, 2024
695391f
feat: migrate pool trade pair swap tool
fabryscript Jul 17, 2024
0cd28b7
fix: adjusted tick placement to account for decimal differences betwe…
crnbarr93 Jul 17, 2024
6b5d65f
fix: removed stablecoin restriction from orderbooks
crnbarr93 Jul 17, 2024
43e3c06
refactor: market quote no longer forces orderbook pool id
crnbarr93 Jul 17, 2024
01de35e
fix: market orders use asset price rather than orderbook price
crnbarr93 Jul 17, 2024
4e34a54
feat: update from & to update methods and add funds modal closing
fabryscript Jul 17, 2024
6aedf40
fix: input loading state for market orders and empty input
crnbarr93 Jul 17, 2024
a0b1a93
feat: wire up virtualization and search
fabryscript Jul 17, 2024
9fb3d5d
build: fixed missing import
crnbarr93 Jul 17, 2024
30895e7
feat: make setToAssetDenom and setFromAssetDenom props optional
fabryscript Jul 17, 2024
0675d39
feat: added all assets to base denom selection for market orders
crnbarr93 Jul 17, 2024
3e60582
feat: added disabled state for limit order selection
crnbarr93 Jul 17, 2024
03e6b78
chore: translation for disabled state
crnbarr93 Jul 17, 2024
50cd04f
Merge branch 'connor/market-price' into connor/asset-selection
crnbarr93 Jul 17, 2024
85c0670
fix: set default base when quote and base are equal
crnbarr93 Jul 18, 2024
d671758
Merge pull request #3546 from osmosis-labs/connor/market-price
crnbarr93 Jul 18, 2024
f3aa601
Merge pull request #3547 from osmosis-labs/connor/asset-selection
crnbarr93 Jul 18, 2024
4fcad8e
Merge branch 'feat/implement-limit-orders' into connor/decimal-place-…
crnbarr93 Jul 18, 2024
fed9cf6
feat: adjusted order history pricing for normalization factor
crnbarr93 Jul 18, 2024
db9cc6b
Merge pull request #3540 from osmosis-labs/connor/decimal-place-pricing
crnbarr93 Jul 18, 2024
061562f
refactor: adjusted canonical orderbook sqs response to include contra…
crnbarr93 Jul 18, 2024
c7e3a36
Merge branch 'stage' into feat/implement-limit-orders
crnbarr93 Jul 18, 2024
5262ee4
build: fixed compilation errors
crnbarr93 Jul 18, 2024
de4b251
Merge pull request #3538 from osmosis-labs/connor/canonical-orderbook
crnbarr93 Jul 18, 2024
b980fd9
feat: added amplitude events for limit orders
crnbarr93 Jul 18, 2024
0bea6a7
feat: added claim all orders amplitude events
crnbarr93 Jul 18, 2024
0c45869
feat: added order history page viewed amplitude event
crnbarr93 Jul 18, 2024
cd0213b
feat: added swap amplitude events for market orders
crnbarr93 Jul 18, 2024
9f98055
fix: removed failed claim amplitude event when user rejects tx request
crnbarr93 Jul 18, 2024
c4a4f4e
fix: sort available stables by amount
fabryscript Jul 18, 2024
bf9d34d
fix: removed price truncation from order history
crnbarr93 Jul 18, 2024
1cf2845
fix: fixed duplicate historical order for partial claims
crnbarr93 Jul 18, 2024
254d4a6
fix trade details (#3548)
sunnya97 Jul 18, 2024
05c5321
feat: added refetch interval to active orders
crnbarr93 Jul 18, 2024
0883d17
Merge branch 'connor/order-history-bug-fixes' into connor/fix-order-h…
crnbarr93 Jul 18, 2024
d7367b2
fix: fixed order history indexing
crnbarr93 Jul 18, 2024
f730811
chore: removed logs
crnbarr93 Jul 18, 2024
88b6115
fix: removed unused disable check for buy/sell
crnbarr93 Jul 19, 2024
300c92d
feat: persist open orders tab on swap tool, wire-up missing hasFunds …
fabryscript Jul 19, 2024
7be86d3
fix: remove mock condition
fabryscript Jul 19, 2024
5ac9e53
fix: fix recommendedAssets display and issue with querying assets
fabryscript Jul 19, 2024
f1f06a1
fix: update onClickAssets logic
fabryscript Jul 19, 2024
6ce3f5b
Merge branch 'feat/implement-limit-orders' into connor/order-history-…
crnbarr93 Jul 19, 2024
102de66
Merge branch 'connor/order-history-bug-fixes' into connor/fix-order-h…
crnbarr93 Jul 19, 2024
b2a050b
fix: index adjustments for order history page
crnbarr93 Jul 19, 2024
ae1e677
feat: limit fiat input to two digits
fabryscript Jul 19, 2024
567f090
feat: added limitations to price input to prevent erroring
crnbarr93 Jul 19, 2024
9270839
feat: limit fiat input to two digits
fabryscript Jul 19, 2024
3c21e72
Merge branch 'fabryscript/implement-second-qa-changes' of github.com:…
fabryscript Jul 19, 2024
3eaa534
Revert "feat: limit fiat input to two digits"
fabryscript Jul 19, 2024
5df7a81
fix: empty market amount after emptying fiat amount
fabryscript Jul 19, 2024
20067c0
Merge branch 'feat/implement-limit-orders' of github.com:osmosis-labs…
fabryscript Jul 19, 2024
bb69828
fix: removed query calls when parameters didn't exist for orderbooks
crnbarr93 Jul 19, 2024
54dfc5f
fix: improved and fixed selectable quote denoms
crnbarr93 Jul 19, 2024
979cdc3
feat: switch input to type text and condense value setters
fabryscript Jul 19, 2024
8246e8e
refactor: further improvements to useOrderbookSelectableDenoms
crnbarr93 Jul 19, 2024
3883bd5
feat: switch limit price selector inputs to text and handle validation
fabryscript Jul 19, 2024
307ca2c
feat: added disabled state for quote assets
crnbarr93 Jul 19, 2024
6352059
feat: persist base denom from swap tool to buy/sell tab
fabryscript Jul 19, 2024
2862289
fix: fix linting on transactions page
fabryscript Jul 19, 2024
7d32901
fix: add missing w-full attribute to ClientOnly component
fabryscript Jul 19, 2024
9da40bc
feat: update order filled percent color
fabryscript Jul 19, 2024
74784ff
fix: trim input on limit price input
fabryscript Jul 19, 2024
262f22b
fix: lint and update input logic on swap tool
fabryscript Jul 19, 2024
2a357e6
refactor: rewrote quote selection map
crnbarr93 Jul 19, 2024
70d7f0a
chore: translate new localisations
crnbarr93 Jul 19, 2024
075fa96
feat: unify from & base and fix equal denoms in swap tool
fabryscript Jul 19, 2024
427a4ed
fix: fix same from & quote edge case on place limit tool
fabryscript Jul 19, 2024
eb6db5f
chore: updated claim bounty
crnbarr93 Jul 19, 2024
034ece2
fix slippage
sunnya97 Jul 19, 2024
cfb264c
feat: vertically aligned fiat amounts in swap review
crnbarr93 Jul 20, 2024
7e8d0bd
feat: redesigned price input
crnbarr93 Jul 20, 2024
ffa37d2
feat: focus price input on swap
crnbarr93 Jul 20, 2024
20c75d0
refactor: refactored useLimitPrice
crnbarr93 Jul 20, 2024
97dcf0e
feat: added tab/type selection events for amplitude
crnbarr93 Jul 20, 2024
4c0bfd2
refactor: removed unused useMemo
crnbarr93 Jul 20, 2024
1ec29fa
Merge pull request #3558 from osmosis-labs/connor/amplitude-events
crnbarr93 Jul 20, 2024
8c6460c
Merge branch 'feat/implement-limit-orders' into connor/quote-denom-se…
crnbarr93 Jul 20, 2024
d5b4d1f
refactor: altered countDecimals export
crnbarr93 Jul 20, 2024
fc56f6b
Update packages/web/components/place-limit-tool/index.tsx
crnbarr93 Jul 20, 2024
8355353
refactor: readded scrollbar for quote denom selection
crnbarr93 Jul 21, 2024
67bbc62
Merge pull request #3562 from osmosis-labs/connor/price-input-fix
crnbarr93 Jul 22, 2024
6b66869
fix: fix some design & logic issues
fabryscript Jul 22, 2024
63fe05f
Merge branch 'feat/implement-limit-orders' into fabryscript/implement…
crnbarr93 Jul 22, 2024
27ab841
Merge pull request #3542 from osmosis-labs/fabryscript/implement-seco…
crnbarr93 Jul 22, 2024
43d4cbe
Merge feat/implement-limit-orders
crnbarr93 Jul 22, 2024
90cb83f
build: fix build errors
crnbarr93 Jul 22, 2024
2fabf3b
fix: price-selector query param change
crnbarr93 Jul 22, 2024
09482b5
fix: fix default from value & responsiveness issues
fabryscript Jul 22, 2024
d04a655
Merge branch 'feat/implement-limit-orders' into connor/quote-denom-se…
crnbarr93 Jul 22, 2024
dad8df5
Merge pull request #3566 from osmosis-labs/connor/quote-denom-selection
crnbarr93 Jul 22, 2024
086d35b
Merge branch 'feat/implement-limit-orders' into connor/price-input-ch…
crnbarr93 Jul 22, 2024
f6b977b
refactor: replaced several Boolean calls
crnbarr93 Jul 22, 2024
294e763
Merge branch 'feat/implement-limit-orders' into connor/conditional-or…
crnbarr93 Jul 22, 2024
4a96ea1
Merge pull request #3569 from osmosis-labs/sunny/fix-stuff-trade
fabryscript Jul 22, 2024
c082fae
refactor: readded enabled flag for several queries
crnbarr93 Jul 22, 2024
1617658
Merge pull request #3573 from osmosis-labs/connor/price-input-changes
crnbarr93 Jul 22, 2024
effb213
Merge branch 'feat/implement-limit-orders' into connor/fix-order-hist…
crnbarr93 Jul 22, 2024
1d3ede7
fix: simplify logic for getOrderbookState enabling
fabryscript Jul 22, 2024
a3f4c6b
Merge branch 'feat/implement-limit-orders' into connor/conditional-or…
fabryscript Jul 22, 2024
98cd94f
Merge pull request #3563 from osmosis-labs/connor/conditional-orderbo…
fabryscript Jul 22, 2024
446116d
Merge branch 'feat/implement-limit-orders' into connor/order-history-…
crnbarr93 Jul 22, 2024
921f944
Merge branch 'connor/fix-order-history-pagination' into connor/order-…
crnbarr93 Jul 22, 2024
72d2fd6
Merge branch 'feat/implement-limit-orders' into connor/order-history-…
crnbarr93 Jul 22, 2024
d39c718
fix: fix build errors
fabryscript Jul 22, 2024
46b75c8
Merge pull request #3560 from osmosis-labs/connor/order-history-bug-f…
crnbarr93 Jul 22, 2024
c17284b
feat: create generic disclaimer tooltip
fabryscript Jul 23, 2024
4d6011f
fix: enable propagation on generic disclaimer
fabryscript Jul 23, 2024
ee2f644
feat: re-arrange and update market trade details
fabryscript Jul 23, 2024
7b85b07
feat: add free state to trade details
fabryscript Jul 23, 2024
9617a83
feat: re-arrange limit order fees
fabryscript Jul 23, 2024
5ac9f98
feat: add gas icon
fabryscript Jul 23, 2024
67100bf
feat: move and update review-swap into review-order
fabryscript Jul 23, 2024
40c5b0b
feat: re-implement review-order modal
fabryscript Jul 23, 2024
784c059
Merge branch 'stage' into feat/implement-limit-orders
crnbarr93 Jul 23, 2024
5717447
feat: add button disabling on review modal
fabryscript Jul 23, 2024
60fc2af
fix: removed repeating asset price query
crnbarr93 Jul 23, 2024
06fc4b9
fix: adjusted placed quantity to be exact input
crnbarr93 Jul 23, 2024
5e9d988
fix: remove unused var
fabryscript Jul 23, 2024
5183f93
refactor: remove old limit order review modal and extract recap row
fabryscript Jul 23, 2024
06ab7a8
feat: add high slippage warning to review order
fabryscript Jul 23, 2024
0e5de26
feat: inject maxSlippage into usePlaceLimit hook
fabryscript Jul 23, 2024
f5f160c
chore: remove useless style from GenericDisclaimer
fabryscript Jul 23, 2024
a3c12fa
feat: add gas icon to limit trade details network fees recap row
fabryscript Jul 23, 2024
ad8e9fa
feat: add tooltips to trade details row
fabryscript Jul 23, 2024
f27ee96
Merge branch 'stage' into feat/implement-limit-orders
fabryscript Jul 24, 2024
fc3f688
Merge branch 'feat/implement-limit-orders' of github.com:osmosis-labs…
fabryscript Jul 24, 2024
bdad3f0
build: fixed translation json error
crnbarr93 Jul 24, 2024
ea8e400
Merge pull request #3585 from osmosis-labs/connor/placed-quantity
crnbarr93 Jul 24, 2024
14bb1c8
Merge branch 'stage' into feat/implement-limit-orders
crnbarr93 Jul 25, 2024
31128bc
redesign swap widget (#3591)
sunnya97 Jul 25, 2024
684ae0e
Improve rate info (#3588)
sunnya97 Jul 25, 2024
ef33052
Merge branch 'stage' of github.com:osmosis-labs/osmosis-frontend into…
fabryscript Jul 26, 2024
4670be1
Merge branch 'feat/implement-limit-orders' of github.com:osmosis-labs…
fabryscript Jul 26, 2024
2c6d3de
Merge branch 'feat/implement-limit-orders' of github.com:osmosis-labs…
fabryscript Jul 26, 2024
bdd7521
fix: fix missing attributes
fabryscript Jul 26, 2024
deb660b
Merge pull request #3605 from osmosis-labs/fabryscript/implement-fina…
fabryscript Jul 26, 2024
438020b
feat: redesign widget base layout & top selectors
fabryscript Jul 26, 2024
49150b8
chore: remove unused old commented code
fabryscript Jul 26, 2024
f1f71ea
chore: remove tab uqs
fabryscript Jul 26, 2024
17c16ac
feat: update token selection & input/output designs
fabryscript Jul 26, 2024
5d27e3e
feat: redesign quote selection
fabryscript Jul 26, 2024
9461630
feat: WIP redesign limit price selector and update page widget size
fabryscript Jul 26, 2024
a7e8b1f
Merge branch 'stage' of github.com:osmosis-labs/osmosis-frontend into…
fabryscript Jul 29, 2024
c412f04
Merge branch 'feat/implement-limit-orders' into fabryscript/feat-add-…
fabryscript Jul 29, 2024
0467185
fix: invert triangles direction and comment out unused code
fabryscript Jul 29, 2024
e283f4b
fix: fix button click disabled when tooltip open
fabryscript Jul 29, 2024
7dec55d
feat: re-implement open orders card
fabryscript Jul 29, 2024
e7d36c7
feat: WIP init implementing focus switching
fabryscript Jul 29, 2024
b8843c4
feat: add switching button UI
fabryscript Jul 29, 2024
11309f5
feat: change default percent adjustment and label render logic
fabryscript Jul 29, 2024
74dd987
feat: re-add trade details
fabryscript Jul 29, 2024
1562414
chore: remove unused code
fabryscript Jul 29, 2024
90a8ebf
refactor: extract AssetFieldset
fabryscript Jul 29, 2024
40cc6b5
chore: comment out unused code
fabryscript Jul 29, 2024
dc6000a
feat: wire-up trade details limit variant
fabryscript Jul 29, 2024
0f4c64d
feat: WIP implement new swap tool designs
fabryscript Jul 29, 2024
4495569
feat: finish implementing swap tool redesign
fabryscript Jul 29, 2024
e2ef75b
fix build lint
sunnya97 Jul 30, 2024
63d1d7d
fix build lint
sunnya97 Jul 30, 2024
8b870ed
fix build lint
sunnya97 Jul 30, 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
13 changes: 11 additions & 2 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
{
"presets": [["@babel/preset-env", { "targets": { "node": "current" } }]]
}
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current"
}
}
]
]
}
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
"message": "chore(release): publish"
}
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@
"@keplr-wallet/types": "0.10.24-ibc.go.v7.hot.fix",
"@keplr-wallet/unit": "0.10.24-ibc.go.v7.hot.fix"
}
}
}
2 changes: 1 addition & 1 deletion packages/keplr-stores/src/price/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type { AppCurrency } from "@osmosis-labs/types";
class Throttler {
protected fns: (() => void)[] = [];

private timeoutId?: NodeJS.Timeout;
private timeoutId?: number;

constructor(public readonly duration: number) {}

Expand Down
34 changes: 33 additions & 1 deletion packages/math/src/pool/concentrated/__tests__/tick.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Dec, Int } from "@keplr-wallet/unit";

import { approxSqrt } from "../../../utils";
import { maxSpotPrice, maxTick, minSpotPrice } from "../const";
import { priceToTick, tickToSqrtPrice } from "../tick";
import { priceToTick, tickToPrice, tickToSqrtPrice } from "../tick";

// https://github.com/osmosis-labs/osmosis/blob/0f9eb3c1259078035445b3e3269659469b95fd9f/x/concentrated-liquidity/math/tick_test.go#L30
describe("tickToSqrtPrice", () => {
Expand Down Expand Up @@ -217,6 +217,38 @@ describe("priceToTick", () => {
});
});

describe("tickToPrice", () => {
const testCases: Record<string, { tick: Int; priceExpected: Dec }> = {
"Tick Zero": {
tick: new Int("0"),
priceExpected: new Dec("1"),
},
"Large Positive Tick": {
tick: new Int("1000000"),
priceExpected: new Dec("2"),
},
"Large Negative Tick": {
tick: new Int("-5000000"),
priceExpected: new Dec("0.5"),
},
"Max Tick": {
tick: new Int("182402823"),
priceExpected: new Dec("340282300000000000000"),
},
"Min Tick": {
tick: new Int("-108000000"),
priceExpected: new Dec("0.000000000001"),
},
};

Object.values(testCases).forEach(({ tick, priceExpected }, i) => {
it(Object.keys(testCases)[i], () => {
const price = tickToPrice(tick);
expect(price.toString()).toEqual(priceExpected.toString());
});
});
});

// TEMORARY: commenting out until we confirm adding a buffer around current tick avoids invalid queries
// describe("estimateInitialTickBound", () => {
// // src: https://github.com/osmosis-labs/osmosis/blob/0b199ee187fbff02f68c2dc503d60efe617a67b2/x/concentrated-liquidity/tick_test.go#L1865
Expand Down
47 changes: 47 additions & 0 deletions packages/math/src/pool/concentrated/tick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,53 @@ export function tickToSqrtPrice(tickIndex: Int): Dec {
return approxSqrt(price);
}

export function tickToPrice(tickIndex: Int): Dec {
if (tickIndex.isZero()) {
return new Dec(1);
}

const geometricExponentIncrementDistanceInTicks = nine.mul(
powTenBigDec(new Int(exponentAtPriceOne).neg()).toDec()
);

if (tickIndex.lt(minTick) || tickIndex.gt(maxTick)) {
throw new Error(
`tickIndex is out of range: ${tickIndex.toString()}, min: ${minTick.toString()}, max: ${maxTick.toString()}`
);
}

const geometricExponentDelta = new Dec(tickIndex)
.quoTruncate(new Dec(geometricExponentIncrementDistanceInTicks.truncate()))
.truncate();

let exponentAtCurTick = new Int(exponentAtPriceOne).add(
geometricExponentDelta
);
if (tickIndex.lt(new Int(0))) {
exponentAtCurTick = exponentAtCurTick.sub(new Int(1));
}

const currentAdditiveIncrementInTicks = powTenBigDec(exponentAtCurTick);

const numAdditiveTicks = tickIndex.sub(
geometricExponentDelta.mul(
geometricExponentIncrementDistanceInTicks.truncate()
)
);

const price = powTenBigDec(geometricExponentDelta)
.add(new BigDec(numAdditiveTicks).mul(currentAdditiveIncrementInTicks))
.toDec();

if (price.gt(maxSpotPrice) || price.lt(minSpotPrice)) {
throw new Error(
`price is out of range: ${price.toString()}, min: ${minSpotPrice.toString()}, max: ${maxSpotPrice.toString()}`
);
}

return price;
}

/** PriceToTick takes a price and returns the corresponding tick index
* This function does not take into consideration tick spacing.
*/
Expand Down
1 change: 1 addition & 0 deletions packages/server/src/queries/complex/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export * from "./chains";
export * from "./concentrated-liquidity";
export * from "./earn";
export * from "./get-timeout-height";
export * from "./orderbooks";
export * from "./pools";
export * from "./staking";
export * from "./swap-routers";
Expand Down
32 changes: 32 additions & 0 deletions packages/server/src/queries/complex/orderbooks/active-orders.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Chain } from "@osmosis-labs/types";
import cachified, { CacheEntry } from "cachified";
import { LRUCache } from "lru-cache";

import { DEFAULT_LRU_OPTIONS } from "../../../utils/cache";
import { LimitOrder, queryOrderbookActiveOrders } from "../../osmosis";

const activeOrdersCache = new LRUCache<string, CacheEntry>(DEFAULT_LRU_OPTIONS);

export function getOrderbookActiveOrders({
orderbookAddress,
userOsmoAddress,
chainList,
}: {
orderbookAddress: string;
userOsmoAddress: string;
chainList: Chain[];
}) {
return cachified({
cache: activeOrdersCache,
key: `orderbookActiveOrders-${orderbookAddress}-${userOsmoAddress}`,
ttl: 1000 * 3, // 3 seconds
getFreshValue: () =>
queryOrderbookActiveOrders({
orderbookAddress,
userAddress: userOsmoAddress,
chainList,
}).then(
({ data }: { data: { count: number; orders: LimitOrder[] } }) => data
),
});
}
28 changes: 28 additions & 0 deletions packages/server/src/queries/complex/orderbooks/denoms.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Chain } from "@osmosis-labs/types";
import cachified, { CacheEntry } from "cachified";
import { LRUCache } from "lru-cache";

import { DEFAULT_LRU_OPTIONS } from "../../../utils/cache";
import { queryOrderbookDenoms } from "../../osmosis";

const orderbookDenomsCache = new LRUCache<string, CacheEntry>(
DEFAULT_LRU_OPTIONS
);

export function getOrderbookDenoms({
orderbookAddress,
chainList,
}: {
orderbookAddress: string;
chainList: Chain[];
}) {
return cachified({
cache: orderbookDenomsCache,
key: `orderbookDenoms-${orderbookAddress}`,
ttl: 1000 * 60 * 60 * 24 * 7, // 7 days
getFreshValue: () =>
queryOrderbookDenoms({ orderbookAddress, chainList }).then(
({ data }) => data
),
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import cachified, { CacheEntry } from "cachified";
import { LRUCache } from "lru-cache";

import { DEFAULT_LRU_OPTIONS } from "../../../utils/cache";
import { HistoricalLimitOrder, queryHistoricalOrders } from "../../osmosis";

const orderbookHistoricalOrdersCache = new LRUCache<string, CacheEntry>(
DEFAULT_LRU_OPTIONS
);

export function getOrderbookHistoricalOrders({
userOsmoAddress,
}: {
userOsmoAddress: string;
}) {
return cachified({
cache: orderbookHistoricalOrdersCache,
key: `orderbookHistoricalOrders-${userOsmoAddress}`,
ttl: 1000 * 3, // 3 seconds
getFreshValue: () =>
queryHistoricalOrders(userOsmoAddress).then((data) => {
const orders = data;
orders.forEach((o) => {
if (o.status === "cancelled" && o.claimed_quantity !== "0") {
const newOrder: HistoricalLimitOrder = {
...o,
quantity: o.claimed_quantity,
status: "fullyClaimed",
};
orders.push(newOrder);
}
});
return orders;
}),
});
}
7 changes: 7 additions & 0 deletions packages/server/src/queries/complex/orderbooks/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export * from "./active-orders";
export * from "./denoms";
export * from "./historical-orders";
export * from "./maker-fee";
export * from "./orderbook-state";
export * from "./pools";
export * from "./tick-state";
27 changes: 27 additions & 0 deletions packages/server/src/queries/complex/orderbooks/maker-fee.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Dec } from "@keplr-wallet/unit";
import { Chain } from "@osmosis-labs/types";
import cachified, { CacheEntry } from "cachified";
import { LRUCache } from "lru-cache";

import { DEFAULT_LRU_OPTIONS } from "../../../utils/cache";
import { queryOrderbookMakerFee } from "../../osmosis";

const makerFeeCache = new LRUCache<string, CacheEntry>(DEFAULT_LRU_OPTIONS);

export function getOrderbookMakerFee({
orderbookAddress,
chainList,
}: {
orderbookAddress: string;
chainList: Chain[];
}) {
return cachified({
cache: makerFeeCache,
key: `orderbookMakerFee-${orderbookAddress}`,
ttl: 1000 * 60 * 60 * 4, // 4 hours
getFreshValue: () =>
queryOrderbookMakerFee({ orderbookAddress, chainList }).then(
({ data }: { data: string }) => new Dec(data)
),
});
}
29 changes: 29 additions & 0 deletions packages/server/src/queries/complex/orderbooks/orderbook-state.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Chain } from "@osmosis-labs/types";
import cachified, { CacheEntry } from "cachified";
import { LRUCache } from "lru-cache";

import { DEFAULT_LRU_OPTIONS } from "../../../utils/cache";
import { queryOrderbookState } from "../../osmosis";

const orderbookStateCache = new LRUCache<string, CacheEntry>(
DEFAULT_LRU_OPTIONS
);

export function getOrderbookState({
orderbookAddress,
chainList,
}: {
orderbookAddress: string;
chainList: Chain[];
}) {
return cachified({
cache: orderbookStateCache,
key: `orderbookState-${orderbookAddress}`,
ttl: 1000 * 3, // 3 seconds
getFreshValue: () =>
queryOrderbookState({
orderbookAddress,
chainList,
}).then(({ data }) => data),
});
}
35 changes: 35 additions & 0 deletions packages/server/src/queries/complex/orderbooks/pools.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import cachified, { CacheEntry } from "cachified";
import { LRUCache } from "lru-cache";

import { DEFAULT_LRU_OPTIONS } from "../../../utils/cache";
import { queryCanonicalOrderbooks } from "../../sidecar/orderbooks";

const orderbookPoolsCache = new LRUCache<string, CacheEntry>(
DEFAULT_LRU_OPTIONS
);

export interface Orderbook {
baseDenom: string;
quoteDenom: string;
contractAddress: string;
poolId: string;
}

export function getOrderbookPools() {
return cachified({
cache: orderbookPoolsCache,
key: `orderbookPools`,
ttl: 1000 * 60 * 60, // 1 hour
getFreshValue: () =>
queryCanonicalOrderbooks().then(async (data) => {
return data.map((orderbook) => {
return {
baseDenom: orderbook.base,
quoteDenom: orderbook.quote,
contractAddress: orderbook.contract_address,
poolId: orderbook.pool_id.toString(),
};
}) as Orderbook[];
}),
});
}
Loading
Loading