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

Update AutomanV4 for Zap to/from tokenC #402

Open
wants to merge 52 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
f3eaaa2
added decreaseLiquiditySingle
tommyzhao451 Jan 8, 2025
e6f8da1
Merge branch 'main' into decreaseLiquiditySingle
tommyzhao451 Jan 8, 2025
04c9076
fix calculation and add more debug
tommyzhao451 Jan 8, 2025
54fa8c8
Merge branch 'main' into decreaseLiquiditySingle
tommyzhao451 Jan 8, 2025
eb7e592
fix test cases and liquidity math
tommyzhao451 Jan 9, 2025
efa88d4
added solver to decreaseLiquiditySingle
tommyzhao451 Jan 10, 2025
a721e12
enable solvers for decreaseLiquiditySingle
tommyzhao451 Jan 13, 2025
7915243
clean up swapAmount because some swaps expected to fail after removin…
tommyzhao451 Jan 14, 2025
aa7975e
Merge branch 'main' into decreaseLiquiditySingle
tommyzhao451 Jan 14, 2025
2ee0e57
version
tommyzhao451 Jan 14, 2025
ce6bed5
update comments
tommyzhao451 Jan 14, 2025
5c7b74d
Merge branch 'main' into decreaseLiquiditySingle
tommyzhao451 Jan 15, 2025
6dc7b52
version
tommyzhao451 Jan 15, 2025
36811be
version
tommyzhao451 Jan 15, 2025
ab9266b
add automanV4 alpha
tommyzhao451 Jan 15, 2025
093a032
update automan for V4 (only arbitrum deployed)
tommyzhao451 Jan 15, 2025
e90e66e
large update for automanV4
tommyzhao451 Jan 21, 2025
a83f3fa
version
tommyzhao451 Jan 21, 2025
fcbbed8
reverted getAutomanDecreaseLiquidityCalldata for backend
tommyzhao451 Jan 22, 2025
123b4ef
add permit
tommyzhao451 Jan 22, 2025
4df95ae
update permission
tommyzhao451 Jan 22, 2025
2bd359a
new automanV4 deployment
tommyzhao451 Jan 25, 2025
fa0f240
version
tommyzhao451 Jan 25, 2025
c79213c
Merge branch 'main' into automanV4
tommyzhao451 Jan 25, 2025
cd30243
deploy slipstreamAutomanV4 to base
tommyzhao451 Jan 25, 2025
f779c57
fix some test cases, stash
tommyzhao451 Jan 27, 2025
276bb46
fix test cases
tommyzhao451 Jan 27, 2025
28970e9
update endpoints
tommyzhao451 Jan 27, 2025
6f6ab2f
lint
tommyzhao451 Jan 27, 2025
e84eee0
Merge branch 'fixTests' into automanV4
tommyzhao451 Jan 27, 2025
e5f1aff
consistently show token symbol and name for test cases
tommyzhao451 Jan 27, 2025
3b9cc08
Merge branch 'fixTests2' into automanV4
tommyzhao451 Jan 27, 2025
26d39db
more migrating to automanV4 and fixing test cases
tommyzhao451 Jan 27, 2025
87bb1b6
Merge branch 'main' into fixTests2
tommyzhao451 Jan 27, 2025
b5973d7
fix more issues with tokenNameAndSymbol
tommyzhao451 Jan 27, 2025
d542af4
Merge branch 'fixTests2' into automanV4
tommyzhao451 Jan 27, 2025
3877235
fix more test cases
tommyzhao451 Jan 27, 2025
afd9653
more fixes
tommyzhao451 Jan 27, 2025
377c589
Merge branch 'fixTests2' into automanV4
tommyzhao451 Jan 27, 2025
1540d58
some refactoring and some fixing test cases
tommyzhao451 Jan 28, 2025
2d428d8
fix more test cases
tommyzhao451 Jan 28, 2025
5cc66e3
version
tommyzhao451 Jan 28, 2025
36b7c5e
Merge branch 'main' into automanV4
tommyzhao451 Jan 28, 2025
4d30ab4
stash before merging large refactor
tommyzhao451 Feb 1, 2025
2fc2b2f
Merge branch 'main' into automanV4
tommyzhao451 Feb 1, 2025
acf2f34
fix test
tommyzhao451 Feb 1, 2025
a9fa665
merge rebalanceBackend
tommyzhao451 Feb 2, 2025
3a817dd
fix tests
tommyzhao451 Feb 4, 2025
136effc
Merge branch 'main' into automanV4b
tommyzhao451 Feb 4, 2025
b7d2c2f
add automanV4 typechain
tommyzhao451 Feb 7, 2025
7b9afe2
Merge branch 'automanV4typechain' into automanV4b
tommyzhao451 Feb 7, 2025
8f8490b
update chains address
tommyzhao451 Feb 7, 2025
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
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Hardhat typechain generated code
typechain-types/
typechain-typesV3/
typechain-typesV4/
typechain-typesMMVault/

# Jest coverage report
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ success Unregistered "@aperture_finance/uniswap-v3-automation-sdk".

- **V2**: Custom Solver
- **V3**: Migrate from feeBips to feeAmount
- **V4**: Advanced automan features required for DecreaseLiquiditySingle

## Contributing

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aperture_finance/uniswap-v3-automation-sdk",
"version": "3.14.8doubleSolvere",
"version": "3.15.0automanV4a",
"description": "SDK for Aperture's CLMM automation platform",
"author": "Aperture Finance <engineering@aperture.finance>",
"license": "MIT",
Expand All @@ -11,6 +11,7 @@
"scripts": {
"build": "tsc --build && tsc-alias",
"clean": "tsc --build --clean",
"compile": "tsc --build && tsc-alias",
"test": "yarn test:jest && yarn test:hardhat",
"test:jest": "jest",
"test:hardhat": "npx hardhat test",
Expand Down
34 changes: 17 additions & 17 deletions src/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export interface AmmInfo {
optimalSwapRouter?: Address;
// Aperture's Automan contract address.
apertureAutoman: Address;
apertureAutomanV3: Address;
apertureAutomanV4: Address;
// The subgraph URL for the AMM. Currently unset for all AMMs as there are no public, free endpoints.
subgraph_url?: string;
}
Expand Down Expand Up @@ -108,7 +108,7 @@ const CHAIN_ID_TO_INFO: {
apertureAutoman: getAddress(
'0x00000000Ede6d8D217c60f93191C060747324bca',
),
apertureAutomanV3: getAddress(
apertureAutomanV4: getAddress(
'0x00000070ee937917c1d9bD91729ce1Dd9A77d8e3',
),
},
Expand All @@ -125,7 +125,7 @@ const CHAIN_ID_TO_INFO: {
apertureAutoman: getAddress(
'0x000000EEd287174A06550eabE6A00074255CaB34',
),
apertureAutomanV3: getAddress(
apertureAutomanV4: getAddress(
'0x00000076a5FEfF94a54834fe1b2803a6Da672e03',
),
},
Expand Down Expand Up @@ -161,8 +161,8 @@ const CHAIN_ID_TO_INFO: {
apertureAutoman: getAddress(
'0x00000000Ede6d8D217c60f93191C060747324bca',
),
apertureAutomanV3: getAddress(
'0x00000070ee937917c1d9bD91729ce1Dd9A77d8e3',
apertureAutomanV4: getAddress(
'0x00000054D9fBb1cEF6E7d3CD53df50977801C6f4',
),
},
},
Expand Down Expand Up @@ -197,7 +197,7 @@ const CHAIN_ID_TO_INFO: {
apertureAutoman: getAddress(
'0x0000000002F4Dd78bA85fE4B662983816c9Ae95F',
),
apertureAutomanV3: getAddress(
apertureAutomanV4: getAddress(
'0x00000070ee937917c1d9bD91729ce1Dd9A77d8e3',
),
},
Expand Down Expand Up @@ -233,7 +233,7 @@ const CHAIN_ID_TO_INFO: {
apertureAutoman: getAddress(
'0x0000000002F4Dd78bA85fE4B662983816c9Ae95F',
),
apertureAutomanV3: getAddress(
apertureAutomanV4: getAddress(
'0x00000070ee937917c1d9bD91729ce1Dd9A77d8e3',
),
},
Expand All @@ -252,7 +252,7 @@ const CHAIN_ID_TO_INFO: {
apertureAutoman: getAddress(
'0x000000A117EDD4AA34C39f87eFa66A521c590DA1',
),
apertureAutomanV3: getAddress(
apertureAutomanV4: getAddress(
'0x0000003d82D9fb11e644B84195218DfD3aeC3f73',
),
},
Expand Down Expand Up @@ -288,7 +288,7 @@ const CHAIN_ID_TO_INFO: {
apertureAutoman: getAddress(
'0x000000000580f20d53f6d2eC56d12A5Fa75Ac8cF',
),
apertureAutomanV3: getAddress(
apertureAutomanV4: getAddress(
'0x000000E2F3Dd82130669b730Bdf170D12DF35233',
),
},
Expand All @@ -305,7 +305,7 @@ const CHAIN_ID_TO_INFO: {
apertureAutoman: getAddress(
'0x000000EEd287174A06550eabE6A00074255CaB34',
),
apertureAutomanV3: getAddress(
apertureAutomanV4: getAddress(
'0x00000076a5FEfF94a54834fe1b2803a6Da672e03',
),
},
Expand Down Expand Up @@ -341,7 +341,7 @@ const CHAIN_ID_TO_INFO: {
apertureAutoman: getAddress(
'0x00000000EDb4489cB49FE07246f39345c9f838cD',
),
apertureAutomanV3: getAddress(
apertureAutomanV4: getAddress(
'0x000000C51119E2bDE2419C5e6fD273a81B79A8E3',
),
},
Expand All @@ -360,8 +360,8 @@ const CHAIN_ID_TO_INFO: {
apertureAutoman: getAddress(
'0x00000000C733A397F38271c2Eb4CA56193b769Cb',
),
apertureAutomanV3: getAddress(
'0x000000ca99cf8E1E53B4b7999180Db3e1D032333',
apertureAutomanV4: getAddress(
'0x00000063e8cA29E95233D00DAF1A51588b9911c4',
),
},
},
Expand Down Expand Up @@ -396,7 +396,7 @@ const CHAIN_ID_TO_INFO: {
apertureAutoman: getAddress(
'0x00000000035daa51254bEc3dE4FC1Cd277b35705',
),
apertureAutomanV3: getAddress(
apertureAutomanV4: getAddress(
'0x00000075Cd3dAd5805699d0E1C5734e27B3264e3',
),
},
Expand Down Expand Up @@ -432,7 +432,7 @@ const CHAIN_ID_TO_INFO: {
apertureAutoman: getAddress(
'0x0000000004276d0052eFdBA3E65a6f87fd55C5B7',
),
apertureAutomanV3: getAddress(
apertureAutomanV4: getAddress(
'0x000000bf0E089A0991baB3CD0E111213c71a5aD3',
),
},
Expand Down Expand Up @@ -469,7 +469,7 @@ const CHAIN_ID_TO_INFO: {
apertureAutoman: getAddress(
'0x00000000c04A561724F4Ea1181cA6E2E74E70FC1',
),
apertureAutomanV3: getAddress(
apertureAutomanV4: getAddress(
'0x0000000000000000000000000000000000000000',
),
},
Expand Down Expand Up @@ -504,7 +504,7 @@ const CHAIN_ID_TO_INFO: {
apertureAutoman: getAddress(
'0x000000001e433b4a86F252B54D2151Aa21ABB1C2',
),
apertureAutomanV3: getAddress(
apertureAutomanV4: getAddress(
'0x00000027bC53f021F3564180f347425eDAA20883',
),
},
Expand Down
42 changes: 21 additions & 21 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import {
Automan__factory as AutomanV3__factory,
IPCSV3Automan__factory as IPCSV3AutomanV3__factory,
ISlipStreamAutoman__factory as ISlipStreamAutomanV3__factory,
IUniV3Automan__factory as IUniV3AutomanV3__factory,
PCSV3Automan as PCSV3AutomanV3,
PCSV3Automan__factory as PCSV3AutomanV3__factory,
SlipStreamAutoman as SlipStreamAutomanV3,
SlipStreamAutoman__factory as SlipStreamAutomanV3__factory,
UniV3Automan as UniV3AutomanV3,
UniV3Automan__factory as UniV3AutomanV3__factory,
} from './typechain-typesV3';
Automan__factory as AutomanV4__factory,
IPCSV3Automan__factory as IPCSV3AutomanV4__factory,
ISlipStreamAutoman__factory as ISlipStreamAutomanV4__factory,
IUniV3Automan__factory as IUniV3AutomanV4__factory,
PCSV3Automan as PCSV3AutomanV4,
PCSV3Automan__factory as PCSV3AutomanV4__factory,
SlipStreamAutoman as SlipStreamAutomanV4,
SlipStreamAutoman__factory as SlipStreamAutomanV4__factory,
UniV3Automan as UniV3AutomanV4,
UniV3Automan__factory as UniV3AutomanV4__factory,
} from './typechain-typesV4';

export * from './automan_client';
export * from './constants';
Expand All @@ -27,16 +27,16 @@ export * from './ioc';
export * from './logger';
export * from './data';
export {
AutomanV3__factory,
UniV3AutomanV3,
PCSV3AutomanV3,
SlipStreamAutomanV3,
IPCSV3AutomanV3__factory,
ISlipStreamAutomanV3__factory,
IUniV3AutomanV3__factory,
PCSV3AutomanV3__factory,
SlipStreamAutomanV3__factory,
UniV3AutomanV3__factory,
AutomanV4__factory,
UniV3AutomanV4,
PCSV3AutomanV4,
SlipStreamAutomanV4,
IPCSV3AutomanV4__factory,
ISlipStreamAutomanV4__factory,
IUniV3AutomanV4__factory,
PCSV3AutomanV4__factory,
SlipStreamAutomanV4__factory,
UniV3AutomanV4__factory,
};
export {
ApertureMMVault,
Expand Down
5 changes: 5 additions & 0 deletions src/typechain-typesV4/@aperture_finance/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import type * as uniV3Lib from "./uni-v3-lib";
export type { uniV3Lib };
5 changes: 5 additions & 0 deletions src/typechain-typesV4/@aperture_finance/uni-v3-lib/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import type * as src from "./src";
export type { src };
55 changes: 55 additions & 0 deletions src/typechain-typesV4/@aperture_finance/uni-v3-lib/src/FullMath.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import type { BaseContract, Signer, utils } from "ethers";

import type { Listener, Provider } from "@ethersproject/providers";
import type {
TypedEventFilter,
TypedEvent,
TypedListener,
OnEvent,
} from "../../../common";

export interface FullMathInterface extends utils.Interface {
functions: {};

events: {};
}

export interface FullMath extends BaseContract {
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;

interface: FullMathInterface;

queryFilter<TEvent extends TypedEvent>(
event: TypedEventFilter<TEvent>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TEvent>>;

listeners<TEvent extends TypedEvent>(
eventFilter?: TypedEventFilter<TEvent>
): Array<TypedListener<TEvent>>;
listeners(eventName?: string): Array<Listener>;
removeAllListeners<TEvent extends TypedEvent>(
eventFilter: TypedEventFilter<TEvent>
): this;
removeAllListeners(eventName?: string): this;
off: OnEvent<this>;
on: OnEvent<this>;
once: OnEvent<this>;
removeListener: OnEvent<this>;

functions: {};

callStatic: {};

filters: {};

estimateGas: {};

populateTransaction: {};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import type * as interfaces from "./interfaces";
export type { interfaces };
export type { FullMath } from "./FullMath";
Loading