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(camelot-v3): Camelot V3 DEX integration. #20

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
58 changes: 58 additions & 0 deletions projects/camelot-v3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# camelot-v3

Camelot V3 DEX is a decentralized exchange built on the Arbitrum network, enabling users to swap tokens and manage liquidity.
It offers a flexible Automated Market Maker (AMM) model, and supports customizable liquidity provisioning.

## Supported Networks

- ARBITRUM

## Common Tasks

1. Basic Operations
- "Swap 100 USDT to ETH in @camelot-v3 on Arbitrum network"
- "Swap 100 USDT to ETH in @camelot-v3 while receiving at least 0.1 ETH on Arbitrum network"
- "Swap 100 USDT to ETH in @camelot-v3 and sent them to 0x33128fA08f5E0545f4714434b53bDb5E98F62474 on Arbitrum network"

- "Swap USDT to exactly 0.1 ETH in @camelot-v3 on Arbitrum network"
- "Swap USDT to exactly 0.1 ETH in @camelot-v3 while paying at most 100 USDT on Arbitrum network"
- "Swap USDT to exactly 0.1 ETH in @camelot-v3 and sent them to 0x33128fA08f5E0545f4714434b53bDb5E98F62474 on Arbitrum network"

- "Add 100 USDT and 0.1 ETH liquidity in @camelot-v3 on Arbitrum network"
- "Add 100 USDT and 0.1 ETH liquidity in @camelot-v3 while providing at least 90 USDT and 0.09 ETH on Arbitrum network"
- "Add 100 USDT and 0.1 ETH liquidity in @camelot-v3 and sent the position NFT to 0x0419959C9ffF74FEaC47e51D5869fabcA61FFF15 on Arbitrum network"
- "Add 100 USDT and 0.1 ETH liquidity between price range 3150.12 USDT/ETH and 3793.65 USDT/ETH in @camelot-v3 on Arbitrum network"
- "Add 100 USDT and 0.1 ETH liquidity between price range -20% and +20% from current price in @camelot-v3 on Arbitrum network"
- "Place a limit order to swap 0.1 ETH to USDT at price 3562.93 USDT/ETH in @camelot-v3 on Arbitrum network"
- "Place a limit order to DCA swap 0.1 ETH to USDT between price range 3150.12 USDT/ETH and 3793.65 USDT/ETH in @camelot-v3 on Arbitrum network"

- "Increase liquidity in ETH/USDT pool by 0.1 ETH and 100 USDT in @camelot-v3 on Arbitrum network"
- "Increase liquidity in ETH/USDT pool by 0.1 ETH and 100 USDT in @camelot-v3 while providing at least 0.09 ETH and 90 USDT on Arbitrum network"
- "Increase liquidity in ETH/USDT pool where tokenId is 123456 by 0.1ETH and 100 USDT in @camelot-v3 on Arbitrum network"

- "Decrease liquidity in ETH/USDT pool by 10% in @camelot-v3 on Arbitrum network"
- "Decrease liquidity in ETH/USDT pool by 10% in @camelot-v3 while receiving at least 0.1 ETH and 100 USDT on Arbitrum network"
- "Decrease liquidity in ETH/USDT pool where tokenId is 123456 by 10% in @camelot-v3 on Arbitrum network"

- "Collect fees from ETH/USDT pool in @camelot-v3 on Arbitrum network"
- "Collect fees from ETH/USDT pool and sent them to 0x33128fA08f5E0545f4714434b53bDb5E98F62474 on Arbitrum network"
- "Collect 50% of fees from ETH/USDT pool in @camelot-v3 on Arbitrum network"
- "Collect 0.05 ETH and 25 USDT fees from ETH/USDT pool in @camelot-v3 on Arbitrum network"
- "Collect fees from ETH/USDT pool in @camelot-v3 where tokenId is 123456 on Arbitrum network"

2. Information Queries
- "Get my LP position in @camelot-v3 on Arbitrum network"
- "Quote 100 USDT to ETH in @camelot-v3 on Arbitrum network"
- "Quote USDT to exactly 0.1 ETH in @camelot-v3 on Arbitrum network"

## Available Functions

- **Swap**: Swap tokens on the DEX.
- **Add Liquidity**: Add liquidity to the DEX.
- **Manage Liquidity**: Increase / Decrease / Remove liquidity on the DEX.

## Installation

```bash
yarn add @heyanon/camelot-v3
```
177 changes: 177 additions & 0 deletions projects/camelot-v3/abis/algebraFactoryAbi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
export const algebraFactoryAbi = [
{
inputs: [
{ internalType: 'address', name: '_poolDeployer', type: 'address' },
{ internalType: 'address', name: '_vaultAddress', type: 'address' },
],
stateMutability: 'nonpayable',
type: 'constructor',
},
{
anonymous: false,
inputs: [{ indexed: false, internalType: 'uint8', name: 'newDefaultCommunityFee', type: 'uint8' }],
name: 'DefaultCommunityFee',
type: 'event',
},
{
anonymous: false,
inputs: [{ indexed: true, internalType: 'address', name: 'newFarmingAddress', type: 'address' }],
name: 'FarmingAddress',
type: 'event',
},
{
anonymous: false,
inputs: [
{ indexed: false, internalType: 'uint16', name: 'alpha1', type: 'uint16' },
{ indexed: false, internalType: 'uint16', name: 'alpha2', type: 'uint16' },
{ indexed: false, internalType: 'uint32', name: 'beta1', type: 'uint32' },
{ indexed: false, internalType: 'uint32', name: 'beta2', type: 'uint32' },
{ indexed: false, internalType: 'uint16', name: 'gamma1', type: 'uint16' },
{ indexed: false, internalType: 'uint16', name: 'gamma2', type: 'uint16' },
{ indexed: false, internalType: 'uint32', name: 'volumeBeta', type: 'uint32' },
{ indexed: false, internalType: 'uint16', name: 'volumeGamma', type: 'uint16' },
{ indexed: false, internalType: 'uint16', name: 'baseFee', type: 'uint16' },
],
name: 'FeeConfiguration',
type: 'event',
},
{
anonymous: false,
inputs: [{ indexed: true, internalType: 'address', name: 'newOwner', type: 'address' }],
name: 'Owner',
type: 'event',
},
{
anonymous: false,
inputs: [
{ indexed: true, internalType: 'address', name: 'token0', type: 'address' },
{ indexed: true, internalType: 'address', name: 'token1', type: 'address' },
{ indexed: false, internalType: 'address', name: 'pool', type: 'address' },
],
name: 'Pool',
type: 'event',
},
{
anonymous: false,
inputs: [{ indexed: true, internalType: 'address', name: 'newVaultAddress', type: 'address' }],
name: 'VaultAddress',
type: 'event',
},
{
inputs: [],
name: 'baseFeeConfiguration',
outputs: [
{ internalType: 'uint16', name: 'alpha1', type: 'uint16' },
{ internalType: 'uint16', name: 'alpha2', type: 'uint16' },
{ internalType: 'uint32', name: 'beta1', type: 'uint32' },
{ internalType: 'uint32', name: 'beta2', type: 'uint32' },
{ internalType: 'uint16', name: 'gamma1', type: 'uint16' },
{ internalType: 'uint16', name: 'gamma2', type: 'uint16' },
{ internalType: 'uint32', name: 'volumeBeta', type: 'uint32' },
{ internalType: 'uint16', name: 'volumeGamma', type: 'uint16' },
{ internalType: 'uint16', name: 'baseFee', type: 'uint16' },
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'address', name: 'tokenA', type: 'address' },
{ internalType: 'address', name: 'tokenB', type: 'address' },
],
name: 'createPool',
outputs: [{ internalType: 'address', name: 'pool', type: 'address' }],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [],
name: 'defaultCommunityFee',
outputs: [{ internalType: 'uint8', name: '', type: 'uint8' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'farmingAddress',
outputs: [{ internalType: 'address', name: '', type: 'address' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'owner',
outputs: [{ internalType: 'address', name: '', type: 'address' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'address', name: '', type: 'address' },
{ internalType: 'address', name: '', type: 'address' },
],
name: 'poolByPair',
outputs: [{ internalType: 'address', name: '', type: 'address' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'poolDeployer',
outputs: [{ internalType: 'address', name: '', type: 'address' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'uint16', name: 'alpha1', type: 'uint16' },
{ internalType: 'uint16', name: 'alpha2', type: 'uint16' },
{ internalType: 'uint32', name: 'beta1', type: 'uint32' },
{ internalType: 'uint32', name: 'beta2', type: 'uint32' },
{ internalType: 'uint16', name: 'gamma1', type: 'uint16' },
{ internalType: 'uint16', name: 'gamma2', type: 'uint16' },
{ internalType: 'uint32', name: 'volumeBeta', type: 'uint32' },
{ internalType: 'uint16', name: 'volumeGamma', type: 'uint16' },
{ internalType: 'uint16', name: 'baseFee', type: 'uint16' },
],
name: 'setBaseFeeConfiguration',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [{ internalType: 'uint8', name: 'newDefaultCommunityFee', type: 'uint8' }],
name: 'setDefaultCommunityFee',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [{ internalType: 'address', name: '_farmingAddress', type: 'address' }],
name: 'setFarmingAddress',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [{ internalType: 'address', name: '_owner', type: 'address' }],
name: 'setOwner',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [{ internalType: 'address', name: '_vaultAddress', type: 'address' }],
name: 'setVaultAddress',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [],
name: 'vaultAddress',
outputs: [{ internalType: 'address', name: '', type: 'address' }],
stateMutability: 'view',
type: 'function',
},
] as const;
Loading