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

feat: stop loss with autonomy on-chain bot #846

Open
wants to merge 71 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
c9f6599
feat: stop-loss view
unbreakablery Apr 17, 2022
d2a0805
Merge branch 'master' of github.com-unbreakablery:sushiswap/sushiswap…
unbreakablery Apr 17, 2022
fe34527
feat: integrate autonomy for stop-loss
unbreakablery Apr 18, 2022
383efbb
fix: autonomy addresses
unbreakablery Apr 18, 2022
dd46442
fix: autonomy validation
unbreakablery Apr 18, 2022
a5aa1a0
feat: add autonomy reg of avax
unbreakablery Apr 19, 2022
301aec7
fix: stop-loss by autonomy bot
unbreakablery Apr 26, 2022
bb18012
feat: update stopLimitOrder ui
unbreakablery Apr 26, 2022
bfa56b7
feat: prepareOracleData for stopPrice
unbreakablery Apr 26, 2022
c30c160
feat: implement stopLimitOrder
unbreakablery Apr 27, 2022
be92943
refactor: stopLimitOrder
unbreakablery Apr 27, 2022
63652ad
feat: update stopLimitOrderWrapper address
unbreakablery Apr 27, 2022
2b421f3
fix: avax chainlinkV2 addr
unbreakablery Apr 27, 2022
b21d5cf
fix: oracleData in stopLimitOrder
unbreakablery Apr 28, 2022
8afebfa
fix: stopLimitOrder slippage as 10%
unbreakablery Apr 28, 2022
c6699c3
fix: stopLimitOrder ui
unbreakablery Apr 28, 2022
dacd9e7
fix: stopLimitOrder ui/ux
unbreakablery Apr 28, 2022
58fc603
refactor: stopLimitOrder ui
unbreakablery May 2, 2022
a223eb2
refactor: stop-limit-order
unbreakablery May 3, 2022
b29d0fb
refactor: stop-limit-order
unbreakablery May 3, 2022
45547b3
fix: stopLimitOrderWrapper address
unbreakablery May 3, 2022
7aac349
refactor: stop loss order hooks
unbreakablery May 6, 2022
0111d99
feat: stop limit order ui popup
unbreakablery May 18, 2022
dd9df02
feat: customize stop-loss ui
unbreakablery May 19, 2022
baf0ee9
feat: fetch stop-loss-order history
unbreakablery May 20, 2022
854e95f
fix: useStopLossOrders
unbreakablery May 20, 2022
df78e9a
feat: parse stopLossOrder
unbreakablery May 20, 2022
40f9500
fix: fetch history from moralis
unbreakablery May 23, 2022
e4d7933
fix: fetch stop-loss-orders
unbreakablery May 23, 2022
5c16bd1
feat: fetch exec stop-loss-orders
unbreakablery May 24, 2022
df066e8
fix: fetching stop-loss-orders
unbreakablery May 24, 2022
19b82b6
fix: stop-loss-orders ui
unbreakablery May 25, 2022
91db9cf
fix: open orders list
unbreakablery May 25, 2022
f12a954
Merge branch 'master' of github.com-unbreakablery:sushiswap/sushiswap…
unbreakablery May 26, 2022
52011bc
feat: show open/history of stop-loss-orders
unbreakablery May 27, 2022
75fd7c5
feat: cancel stop-loss orders
unbreakablery May 30, 2022
cb5792f
feat: update stop-loss orders ui
unbreakablery May 30, 2022
2467f17
fix: env var for stop-loss
unbreakablery May 30, 2022
e17dcc2
Merge branch 'master' of github.com-unbreakablery:sushiswap/sushiswap…
unbreakablery May 31, 2022
b825dbc
Merge branch 'master' into feat/stop-loss-with-autonomy-bot
unbreakablery Jun 21, 2022
7f49911
Merge branch 'master' of github.com-unbreakablery:sushiswap/sushiswap…
unbreakablery Jul 17, 2022
e6016a3
fix: add explainer in stop-loss ui
unbreakablery Jul 18, 2022
31fa95f
Merge branch 'master' of github.com-unbreakablery:sushiswap/sushiswap…
unbreakablery Jul 28, 2022
f36a2d8
feat: add input validation in stop-loss ui
unbreakablery Aug 2, 2022
89d74ab
fix: stop-loss orders ui
unbreakablery Aug 2, 2022
38b4f81
feat: add amount validation in stop-loss ui
unbreakablery Aug 3, 2022
fb2b207
fix: margin rate validation in stop-loss order
unbreakablery Aug 4, 2022
d1e9956
refactor: stop and minimum rate validation in stop-loss
unbreakablery Aug 4, 2022
690dfd0
fix: amountExternal in stop-loss
unbreakablery Aug 5, 2022
2528a36
chore: moralis version
unbreakablery Aug 5, 2022
b1183ae
fix: moralis version
unbreakablery Aug 5, 2022
18830db
fix: stop-loss order params
unbreakablery Aug 5, 2022
613ee23
fix: stop-loss validation
unbreakablery Aug 5, 2022
0c776b2
fix: stop-loss validation
unbreakablery Aug 8, 2022
57c3bac
fix: pagination in stop-loss ui
unbreakablery Aug 8, 2022
b66d786
fix: stop-loss orders pagination
unbreakablery Aug 8, 2022
b763dd2
feat: expert mode in stop-loss
unbreakablery Aug 9, 2022
6806495
Merge branch 'master' of github.com-unbreakablery:sushiswap/sushiswap…
unbreakablery Aug 9, 2022
3dda0ca
fix: stop loss ui
unbreakablery Aug 11, 2022
c2ba3a0
Merge branch 'master' of github.com-unbreakablery:sushiswap/sushiswap…
unbreakablery Aug 11, 2022
5ef81cc
fix: stop-loss zero-division issue
unbreakablery Aug 11, 2022
eb96493
feat: add more validation in stop-loss ui
unbreakablery Aug 12, 2022
a468b7e
fix: stop-loss overflow
unbreakablery Aug 12, 2022
c3523fa
Merge branch 'master' of github.com-unbreakablery:sushiswap/sushiswap…
unbreakablery Aug 16, 2022
74eeb94
fix: dependency of moralis
unbreakablery Aug 16, 2022
a77beb3
fix: moralis version
unbreakablery Aug 16, 2022
32ccf13
Merge branch 'master' of github.com-unbreakablery:sushiswap/sushiswap…
unbreakablery Aug 22, 2022
f28b4ca
fix: npm dependency
unbreakablery Sep 8, 2022
8169b73
fix: trade nav header
unbreakablery Sep 9, 2022
62c7c78
feat: add more stopLimitOrder wrapper
unbreakablery Sep 13, 2022
ed0b5f4
Merge branch 'master' of github.com-unbreakablery:sushiswap/sushiswap…
unbreakablery Oct 7, 2022
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
Prev Previous commit
Next Next commit
fix: oracleData in stopLimitOrder
  • Loading branch information
unbreakablery committed Apr 28, 2022
commit b21d5cfe0c350e739c6e31f250d3ce7a57445c63
5 changes: 3 additions & 2 deletions src/features/stop-limit-order/useStopLossExecute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
IStopLimitOrderReceiverParam,
prepareStopPriceOracleData,
ZERO_ORACLE_ADDRESS,
ZERO_ORACLE_DATA,
} from './utils'

const getEndTime = (orderExpiration: OrderExpiration | string): number => {
Expand Down Expand Up @@ -98,9 +99,9 @@ const useStopLossExecute: UseLimitOrderExecute = () => {
recipient ? recipient : account,
Math.floor(new Date().getTime() / 1000).toString(),
endTime.toString(),
oracleData && oracleData.stopPrice,
oracleData && oracleData.stopPrice ? oracleData.stopPrice : '0',
oracleData && oracleData.stopPrice ? CHAINLINK_ORACLE_ADDRESS[chainId] : ZERO_ORACLE_ADDRESS,
oracleData && oracleData.oracleData
oracleData && oracleData.stopPrice ? oracleData.oracleData : ZERO_ORACLE_DATA
)

try {
Expand Down
5 changes: 2 additions & 3 deletions src/features/stop-limit-order/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function calculateAmountExternal(
}

export interface IStopPriceOracleData {
stopPrice: string
stopPrice?: string
oracleData: string
}

Expand Down Expand Up @@ -93,8 +93,7 @@ export function prepareStopPriceOracleData(
// if priceFeed does not exists
if (!inAggregator || !outAggregator) {
return {
stopPrice: '',
oracleData: ZERO_ORACLE_ADDRESS,
oracleData: ZERO_ORACLE_DATA,
}
}

Expand Down