Skip to content

Commit

Permalink
remove unused file
Browse files Browse the repository at this point in the history
  • Loading branch information
scobru committed Jun 9, 2024
1 parent 61113ea commit 95d995f
Show file tree
Hide file tree
Showing 17 changed files with 448 additions and 4,285 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: telegram message
on: [push]
jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:
- name: send telegram message on push
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
${{ github.actor }} created commit:
Commit message: ${{ github.event.commits[0].message }}
Repository: ${{ github.repository }}
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}
16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@
"version": "2.6.0",
"description": "Uniswap v3 rebalance and forecast CLI tool",
"files": [
"dist"
"dist",
"src"
],
"scripts": {
"ts-node": "ts-node",
"build": "npx tsc",
"rebalance": "npx ts-node src/core/strategies/rebalance/rebalance.ts",
"rebalanceV2": "npx ts-node src/core/strategies/rebalanceV2/rebalance.ts",
"invest": "npx ts-node src/core/strategies/investor/investor.ts",
"dca": "npx ts-node src/core/dca.ts",
"pumpOrDump": "npx ts-node src/strategies/pumpOrDump/pumpOrDump.ts",
"rebalance": "npx ts-node src/core/strategies/rebalance/main.ts",
"rebalanceV2": "npx ts-node src/core/strategies/rebalanceV2/main.ts",
"format": "npx prettier --write . --ignore-path .gitignore",
"check-types": "tsc --noEmit --incremental",
"dev": "tsc --watch",
Expand Down Expand Up @@ -41,13 +39,13 @@
"@tensorflow/tfjs": "^4.15.0",
"@types/node": "^20.10.5",
"@uniswap/permit2-sdk": "^1.2.0",
"@uniswap/router-sdk": "1.7.1",
"@uniswap/router-sdk": "^1.9.2",
"@uniswap/sdk": "^3.0.3",
"@uniswap/sdk-core": "^4.0.10",
"@uniswap/smart-order-router": "3.19.3",
"@uniswap/smart-order-router": "^3.34.0",
"asciichart": "^1.5.25",
"axios": "^1.6.5",
"baluni-contracts": "^2.6.5",
"baluni-contracts": "^2.7.0",
"bignumber.js": "^9.1.2",
"chakl": "^0.0.1-security",
"cli-chart": "^0.3.1",
Expand Down
18 changes: 10 additions & 8 deletions src/api/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ import {
OracleConfig,
} from './types/constants'

import deployedContracts from 'baluni-contracts/deployments/deployedContracts.json'

export const BASEURL = 'https://baluni-api.scobrudot.dev'

export const INFRA: InfraConfig = {
'137': {
ROUTER: '0x9c83FD0B44746a9247Fa784428E3F7fa751fD037',
REBALANCER: '0xF937Eb340340fd3A5b12B20040C9ECEd7afC597D',
FACTORY: '0xBef7F9CdfAca0c98B6eB84b2eefd4Cd6D3056BD9',
POOLREGISTRY: '0x82D45Fd07c3774b3BfF55376163E0404Bdb606b7',
POOLPERIPHERY: '0xFB1C414c94b8353cf7707f3574DD562A330b1e46',
REGISTRY: '0x07A6285533b08bC8Cb08Afd468894C7689CE0489',
SWAPPER: '0xD6Bc81a8286f8418FF16C8ae7C966FaA55686f09',
ORACLE: '0x92d88f6Fbbda97437bE528BedC4C2bE6103C39f3',
ROUTER: deployedContracts[137].BaluniV1Router,
REBALANCER: deployedContracts[137].BaluniV1Rebalance,
FACTORY: deployedContracts[137].BaluniV1AgentFactory,
POOLREGISTRY: deployedContracts[137].BaluniV1PoolRegistry,
POOLPERIPHERY: deployedContracts[137].BaluniV1PoolPeriphery,
REGISTRY: deployedContracts[137].BaluniV1Registry,
SWAPPER: deployedContracts[137].BaluniV1Swapper,
ORACLE: deployedContracts[137].BaluniV1Oracle,
},
}

Expand Down
2 changes: 1 addition & 1 deletion src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import RegistryABI from 'baluni-contracts/artifacts/contracts/registry/BaluniV1R
import OffChainOracleAbi from './abis/1inch/OffChainOracle.json'
export { RouterABI, AgentABI, OffChainOracleAbi, RegistryABI }
export { buildSwapOdos } from './odos'
export { buildSwapUniswap, buildSwap } from './uniswap'
export { buildSwapUniswap } from './uniswap'
export {
depositToYearn,
depositToYearnBatched,
Expand Down
27 changes: 15 additions & 12 deletions src/api/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
NETWORKS,
TOKENS_URL,
} from './constants'
import { buildSwap } from './uniswap'
import { buildSwapUniswap } from './uniswap'
import { ethers } from 'ethers'
import { depositToYearn, redeemFromYearn } from './yearn/vault'
import { fetchTokenAddressByName } from './utils/uniswap/fetchToken'
Expand Down Expand Up @@ -207,22 +207,25 @@ app.get(
new ethers.providers.JsonRpcProvider(NETWORKS[chainId])
)

const swapResult = await buildSwap(
wallet,
address,
tokenAAddress!,
tokenBAddress!,
Boolean(reverse),
'uni-v3',
chainId,
amount,
Number(slippage)
)
const swapResult = await buildSwapUniswap([
{
wallet,
address,
token0: tokenAAddress!,
token1: tokenBAddress!,
reverse: Boolean(reverse),
protocol: 'uni-v3',
chainId,
amount,
slippage: Number(slippage),
},
])

console.log('Swap result:', swapResult)

res.json({
Approvals: swapResult.Approvals,
ApprovalsAgent: swapResult.ApprovalsAgent,
Calldatas: swapResult.Calldatas,
TokensReturn: swapResult.TokensReturn,
})
Expand Down
Loading

0 comments on commit 95d995f

Please sign in to comment.