Skip to content

Commit

Permalink
Merge pull request #44 from bleu/next
Browse files Browse the repository at this point in the history
Next: Refactored UI
  • Loading branch information
ribeirojose authored Jul 5, 2024
2 parents 3f7df9d + d4feabc commit 4211877
Show file tree
Hide file tree
Showing 131 changed files with 21,491 additions and 30,591 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/setup-pnpm/action.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: 'Setup JS Dependencies'
description: 'Install JS dependencies using PNPM'
name: "Setup JS Dependencies"
description: "Install JS dependencies using PNPM"
inputs:
npm_token:
description: 'NPM token for authentication'
description: "NPM token for authentication"
required: true
runs:
using: 'composite'
using: "composite"
steps:
- uses: actions/checkout@v2

- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: 8
version: 9

- name: Setup Node.js
uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
node-linker=node-modules

; Scoped Registry Configuration for bleu-fi
@bleu-fi:registry=https://npm.pkg.github.com
@bleu:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${NPM_TOKEN}
20 changes: 3 additions & 17 deletions codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { gnosis, mainnet, sepolia } from "viem/chains";

export enum Subgraph {
ComposableCow = "composable-cow",
BalancerGauges = "balancer-gauges",
}

export type SupportedChains =
Expand All @@ -12,19 +11,6 @@ export type SupportedChains =
| typeof sepolia.id;

export const SUBGRAPHS = {
[Subgraph.BalancerGauges]: {
name: Subgraph.BalancerGauges,
endpoints() {
return {
[mainnet.id]: `https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-gauges`,
[gnosis.id]: `https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-gauges-gnosis-chain`,
[sepolia.id]: `https://api.studio.thegraph.com/proxy/24660/balancer-gauges-sepolia/version/latest/`,
};
},
endpointFor(network: SupportedChains) {
return this.endpoints()[network];
},
},
[Subgraph.ComposableCow]: {
name: Subgraph.ComposableCow,
endpoints() {
Expand Down Expand Up @@ -72,9 +58,9 @@ const generates = Object.assign(
},
],
])
.flat(1)
)
)
.flat(1),
),
),
);

const config: CodegenConfig = {
Expand Down
5 changes: 3 additions & 2 deletions docs/pages/index.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Stop Loss Documentation

## Introduction
## Introduction

The stop loss is designed to sell a token if its price drops below a certain threshold. It uses the [Composable CoW framework](https://docs.cow.fi/cow-protocol/reference/contracts/periphery/composable-cow) to post an order on the CoW Protocol. To check if the price of the token has dropped below the threshold, the stop loss uses the Chainlink price feed. In the UI, the oracles have to be set by the user, there is a button to load available Chainlink oracles.

The oracles and the strike price are among the token prices. This means that if you select two non-stable tokens and the buy token price increases, the stop loss can be triggered even if the buy token price didn't change.

## Requirements

- Order must be created from a `Safe`.
- The `Safe Multisig` must have the token to be sold at the order creation time.
- The `Safe` has its fallback handler set to `ExtensibleFallbackHandler`.
Expand All @@ -20,7 +21,7 @@ The oracles and the strike price are among the token prices. This means that if

## Hooks

In addition to the stop-loss order, the user can add additional hooks to be executed before and after the order execution. Hooks execution isn't guaranteed; this means that if the hook fails, the order can still be executed. The hooks are executed in the order they are added. For more information about the hooks, check the [CoW Hooks](https://docs.cow.fi/cow-protocol/reference/contracts/periphery/hooks-trampoline) documentation.
In addition to the Stop Loss order, the user can add additional hooks to be executed before and after the order execution. Hooks execution isn't guaranteed; this means that if the hook fails, the order can still be executed. The hooks are executed in the order they are added. For more information about the hooks, check the [CoW Hooks](https://docs.cow.fi/cow-protocol/reference/contracts/periphery/hooks-trampoline) documentation.

These actions are static, meaning that all hook parameters must be defined at the time of the order creation.

Expand Down
102 changes: 52 additions & 50 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,88 +22,90 @@
"test:watch": "pnpm exec jest --watchAll --verbose"
},
"dependencies": {
"@bleu-fi/ui": "^0.1.59",
"@bleu/ui": "^0.1.122",
"@cowprotocol/app-data": "^1.2.2",
"@graphql-codegen/typescript": "^4.0.6",
"@graphql-codegen/typescript-operations": "^4.2.0",
"@hookform/resolvers": "^3.3.4",
"@radix-ui/colors": "^3.0.0",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-alert-dialog": "^1.0.5",
"@radix-ui/react-aspect-ratio": "^1.0.3",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-checkbox": "^1.0.4",
"@radix-ui/react-collapsible": "^1.0.3",
"@radix-ui/react-context-menu": "^2.1.5",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-hover-card": "^1.0.7",
"@radix-ui/react-accordion": "^1.2.0",
"@radix-ui/react-alert-dialog": "^1.1.1",
"@radix-ui/react-aspect-ratio": "^1.1.0",
"@radix-ui/react-avatar": "^1.1.0",
"@radix-ui/react-checkbox": "^1.1.1",
"@radix-ui/react-collapsible": "^1.1.0",
"@radix-ui/react-context-menu": "^2.2.1",
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-dropdown-menu": "^2.1.1",
"@radix-ui/react-hover-card": "^1.1.1",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-menubar": "^1.0.4",
"@radix-ui/react-navigation-menu": "^1.1.4",
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-progress": "^1.0.3",
"@radix-ui/react-radio-group": "^1.1.3",
"@radix-ui/react-scroll-area": "^1.0.5",
"@radix-ui/react-select": "^2.0.0",
"@radix-ui/react-separator": "^1.0.3",
"@radix-ui/react-slider": "^1.1.2",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-switch": "^1.0.3",
"@radix-ui/react-tabs": "^1.0.4",
"@radix-ui/react-toast": "^1.1.5",
"@radix-ui/react-toggle": "^1.0.3",
"@radix-ui/react-toggle-group": "^1.0.4",
"@radix-ui/react-tooltip": "^1.0.7",
"@safe-global/safe-apps-react-sdk": "^4.7.1",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-menubar": "^1.1.1",
"@radix-ui/react-navigation-menu": "^1.2.0",
"@radix-ui/react-popover": "^1.1.1",
"@radix-ui/react-progress": "^1.1.0",
"@radix-ui/react-radio-group": "^1.2.0",
"@radix-ui/react-scroll-area": "^1.1.0",
"@radix-ui/react-select": "^2.1.1",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slider": "^1.2.0",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-switch": "^1.1.0",
"@radix-ui/react-tabs": "^1.1.0",
"@radix-ui/react-toast": "^1.2.1",
"@radix-ui/react-toggle": "^1.1.0",
"@radix-ui/react-toggle-group": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.2",
"@safe-global/safe-apps-react-sdk": "^4.7.2",
"@safe-global/safe-apps-sdk": "^9.0.0",
"@safe-global/safe-gateway-typescript-sdk": "^3.18.0",
"@testing-library/jest-dom": "^6.4.2",
"@wagmi/core": "^2.6.5",
"@tanstack/react-query": "^5.50.1",
"@testing-library/jest-dom": "^6.4.6",
"@wagmi/core": "^2.11.6",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
"clsx": "^2.1.1",
"cmdk": "^0.2.1",
"embla-carousel-react": "8.0.0-rc22",
"embla-carousel-react": "8.1.6",
"gql": "^1.1.2",
"graphql-codegen-plugin-typescript-swr": "^0.8.5",
"graphql-request": "6.1.0",
"graphql-tag": "^2.12.6",
"jest-environment-jsdom": "^29.7.0",
"next": "14.1.0",
"next": "14.2.4",
"next-themes": "^0.2.1",
"npm-run-all": "^4.1.5",
"prettier": "^3.2.5",
"parse-prometheus-text-format": "^1.1.1",
"react": "^18.2.0",
"react-day-picker": "^8.10.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.50.1",
"react-hook-form": "^7.52.0",
"react-query": "^3.39.3",
"react-resizable-panels": "^2.0.9",
"reactflow": "^11.10.4",
"sonner": "^1.4.0",
"sonner": "^1.5.0",
"swr": "^2.2.5",
"tailwind-merge": "^2.2.1",
"tailwind-merge": "^2.3.0",
"tailwindcss-animate": "^1.0.7",
"ts-jest": "^29.1.2",
"vaul": "^0.9.0",
"ts-jest": "^29.1.5",
"vaul": "^0.9.1",
"viem": "^2.7.9",
"vocs": "1.0.0-alpha.38",
"zod": "^3.22.4"
"vocs": "1.0.0-alpha.52",
"zod": "^3.23.8"
},
"devDependencies": {
"@graphql-codegen/cli": "5.0.0",
"@graphql-codegen/typescript-graphql-request": "6.1.0",
"@next/eslint-plugin-next": "^14.1.0",
"@types/dagre": "^0.7.52",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.19",
"@types/react": "^18.2.55",
"@types/react-dom": "^18.2.19",
"@types/node": "^20.14.10",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"autoprefixer": "^10.4.17",
"autoprefixer": "^10.4.19",
"eslint": "^8.56.0",
"eslint-config-next": "14.1.0",
"eslint-config-next": "14.2.4",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-compat": "latest",
Expand All @@ -112,14 +114,14 @@
"eslint-plugin-prettier": "latest",
"eslint-plugin-react-hooks": "latest",
"eslint-plugin-simple-import-sort": "latest",
"eslint-plugin-tailwindcss": "^3.14.2",
"eslint-plugin-tailwindcss": "^3.17.4",
"jest": "^29.7.0",
"postcss": "^8.4.35",
"prettier": "^3.1.1",
"prettier-plugin-tailwindcss": "^0.5.11",
"tailwind-scrollbar": "^3.1.0",
"tailwindcss": "^3.4.1",
"typescript": "^5.4.2"
"tailwindcss": "^3.4.4",
"typescript": "^5.5.3"
},
"pnpm": {
"overrides": {
Expand Down
Loading

0 comments on commit 4211877

Please sign in to comment.