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/conc babydegen #65

Merged
merged 84 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
5a10133
update aea-config.yaml and service.yaml for babydegen
gauravlochab Oct 18, 2024
c022bdf
feat: Add ABCI skills from babydegen to optimus
gauravlochab Oct 18, 2024
50e81af
feat: updating packages.json
gauravlochab Oct 18, 2024
7d20b21
chore: Update aea-config.yaml
gauravlochab Oct 18, 2024
c1df2c4
feat: Update agent_transition environment variable in config files
gauravlochab Oct 22, 2024
6a9596f
feat: Update agent_transition environment variable in config files
gauravlochab Oct 22, 2024
817c6d3
chore: Update dependencies and packages
gauravlochab Oct 22, 2024
cc51ef5
chore: update .gitigonre and .git modules
gauravlochab Oct 22, 2024
f715130
feat: merge dialogues and resolving import errors
gauravlochab Oct 22, 2024
839c7d5
chore: Update event values in LiquidityTraderAbciApp and event values…
gauravlochab Oct 22, 2024
c83ab5d
chore: remove skills
gauravlochab Oct 22, 2024
4100171
chore: Remove unused ABCI skills
gauravlochab Oct 22, 2024
c777f1c
chore: Update agent_transition environment variable in config files
gauravlochab Oct 22, 2024
762854c
chore: changes in rounds , behaviours and merge conflit resolution
gauravlochab Oct 24, 2024
6875318
chore: Update packages
gauravlochab Oct 24, 2024
73c5f54
chore: Update pakacges
gauravlochab Oct 24, 2024
4833655
chore: Update config files
gauravlochab Oct 24, 2024
333f99f
chore: added round changes
gauravlochab Oct 25, 2024
6046f45
chore: Update to Voting Round
gauravlochab Oct 25, 2024
e327467
Merge branch 'main' into feat/conc-fsm-babydegen
gauravlochab Oct 25, 2024
977aa52
chore: update skills yaml in optimus
gauravlochab Oct 28, 2024
b78410f
Merge commit 'e327467f422ce1136a7a7d9257abce343f0c9930' into feat/con…
gauravlochab Oct 28, 2024
dc86dad
chore: Add third-party submodules for balpy and multicaller
gauravlochab Oct 28, 2024
31ec213
chore: Update .gitignore
gauravlochab Oct 28, 2024
688ada8
chore: Update paths in agent config
gauravlochab Oct 28, 2024
e8d21f8
chore: Update balpy and open-multicaller dependencies
gauravlochab Oct 29, 2024
c34d5e9
chore: Update connection in packages
gauravlochab Oct 29, 2024
6acdc31
chore: Update pakages
gauravlochab Oct 29, 2024
64fba89
chore: Remove third-party submodules for balpy and multicaller
gauravlochab Oct 29, 2024
52baec4
chore: updating toml and tox.ini for ci issues
gauravlochab Oct 29, 2024
5215ad1
chore: Update tox.ini to handle unknown packages
gauravlochab Oct 29, 2024
7249b9a
chore: Update dependencies & fsm specs
gauravlochab Oct 29, 2024
b7a6969
chore: Update dependencies
gauravlochab Oct 29, 2024
1e02d69
chore: resolving for linters
gauravlochab Oct 29, 2024
a89cf25
chore: Update packages
gauravlochab Oct 29, 2024
53a17fa
chore: Ignore mypy errors for eightballer package
gauravlochab Oct 29, 2024
d21eed6
chore: Update service.yaml file with new parameters and values
gauravlochab Oct 29, 2024
f4b2a80
chore: Update agent and service configurations
gauravlochab Oct 29, 2024
9da59d8
chore: Update aea-config-replace.py to include new environment variables
gauravlochab Oct 29, 2024
56d8dab
chore: Update service.yaml file with new parameters and values
gauravlochab Oct 29, 2024
3e0c83c
chore: resolving ci checks
gauravlochab Oct 29, 2024
fce018d
chore: add default flag and readme for merge
gauravlochab Oct 30, 2024
f3fe392
chore: Update merge_readme
gauravlochab Oct 30, 2024
092df98
fix:removing merge conflict
gauravlochab Nov 19, 2024
01d47fa
fix: remove leakes and ci issues
gauravlochab Nov 19, 2024
fefd9cf
chore: Update hashes
gauravlochab Nov 19, 2024
d9c83c9
chore: refactoring code for requested changes
gauravlochab Nov 21, 2024
5fde316
chore: removed events
gauravlochab Nov 21, 2024
efc8fc9
fix: removing ci issues
gauravlochab Nov 21, 2024
c1e10ad
chore: update rounds and CI issues
gauravlochab Nov 21, 2024
3395f3a
fix: remove RPCs and file path
gauravlochab Nov 21, 2024
170df37
adding workflow to push docker images
gauravlochab Nov 26, 2024
20ad444
update hashes
gauravlochab Nov 26, 2024
92180ec
chore:update packages
gauravlochab Nov 26, 2024
6a16c42
fix:balpy params in service.yaml
gauravlochab Nov 26, 2024
ce623e9
chore:sync packages
gauravlochab Nov 26, 2024
9964d4e
chore: sync packages
gauravlochab Nov 26, 2024
e20f3ae
fix:removing participant address
gauravlochab Nov 27, 2024
4c65ca0
Merge remote-tracking branch 'origin/main' into feat/conc-babydegen
gauravlochab Jan 10, 2025
9632e45
chore: Update dependencies and trading strategy parameters
gauravlochab Jan 10, 2025
8136f77
fix: add none event and trading strategy parameters
gauravlochab Jan 10, 2025
066b9a8
fix: handle missing callback for nonce in IpfsHandler
gauravlochab Jan 10, 2025
817b245
fix: the liquidity trader abci's custom IPFS interactions
Adamantios Jan 17, 2025
275836b
fix: update the hashes for strategy
gauravlochab Jan 21, 2025
9d24553
fix: resolve merge conflict for babydegen and main
gauravlochab Jan 21, 2025
9116860
fix: update hashes
gauravlochab Jan 21, 2025
b140731
fix: add multisend batch size param and update hashes
gauravlochab Jan 21, 2025
8523fc9
fix: update hashes and strategy configuration
gauravlochab Jan 21, 2025
2bef2c5
fix: update hashes and strategy configuration
gauravlochab Jan 21, 2025
eac594a
fix: update hashes and configuration paths
gauravlochab Jan 21, 2025
13cb5f8
fix: update ledger_ids in service.yaml
gauravlochab Jan 21, 2025
78d8b31
fix: ci issues for the merge
gauravlochab Jan 21, 2025
41003cb
fix: update hashes and configuration paths
gauravlochab Jan 22, 2025
aec3bb5
feat: add market data from dcxt for babydegen
gauravlochab Feb 6, 2025
30354a8
fix: update open-balpy and aea changes for dcxt
gauravlochab Feb 6, 2025
9cf0c14
fix: adding strategy from babydegen
gauravlochab Feb 6, 2025
a5e5dae
feat: add portfolio data
DIvyaNautiyal07 Feb 7, 2025
7d5a1e3
Merge remote-tracking branch 'origin/main' into feat/conc-babydegen
DIvyaNautiyal07 Feb 7, 2025
a4c7d72
fix: update gitignore
DIvyaNautiyal07 Feb 7, 2025
cec16c0
feat: add support for babydegen opportunities
DIvyaNautiyal07 Feb 7, 2025
db7014b
chore: update packages
DIvyaNautiyal07 Feb 7, 2025
43fdde1
Merge remote-tracking branch 'origin/main' into feat/conc-babydegen
DIvyaNautiyal07 Feb 7, 2025
d21ad5b
chore: update packages
DIvyaNautiyal07 Feb 7, 2025
8c2e5be
fix: resolve bandit issue
DIvyaNautiyal07 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
104 changes: 104 additions & 0 deletions .github/workflows/publish_docker_images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Temporary Push Docker Images

on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to build from'
required: true
default: 'main'
push:
tags:
- 'dev.*'
pull_request:
branches:
- main

jobs:
publish-packages:
name: Push Packages
runs-on: ubuntu-20.04
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-versions }}
- uses: addnab/docker-run-action@v3
with:
image: valory/open-autonomy-user:latest
options: -v ${{ github.workspace }}:/work
run: |
echo "Pushing Packages"
cd /work
export AUTHOR=$(grep 'service' packages/packages.json | awk -F/ '{print $2}' | head -1)
autonomy init --reset --author $AUTHOR --ipfs --remote
autonomy push-all
publish-images:
name: Publish Docker Images
runs-on: ubuntu-20.04
needs:
- "publish-packages"
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.10"]
env:
DOCKER_USER: ${{secrets.DOCKER_USER}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up tag and vars
uses: addnab/docker-run-action@v3
with:
image: valory/open-autonomy-user:latest
options: -v ${{ github.workspace }}:/work
run: |
echo "Setting Tag Images"
cd /work
apt-get update && apt-get install git -y || exit 1
git config --global --add safe.directory /work
export TAG=$(git describe --exact-match --tags $(git rev-parse HEAD)) || exit 1
if [ $? -eq 0 ]; then
export TAG=`echo $TAG | sed 's/^v//'`
else
echo "You are not on a tagged branch"
exit 1
fi
echo VERSION=$TAG> env.sh
echo AUTHOR=$(grep 'service/' packages/packages.json | awk -F/ '{print $2}' | head -1) >> env.sh
echo SERVICE=$(grep 'service/' packages/packages.json | awk -F/ '{print $3}' | head -1) >> env.sh
echo AGENT=$(grep 'agent/' packages/packages.json | awk -F/ '{print $3}' | head -1) >> env.sh
echo DEFAULT_IMAGE_TAG=$(cat packages/packages.json | grep agent/ | awk -F: '{print $2}' | tr -d '", ' | head -n 1) >> env.sh
cat env.sh
- uses: addnab/docker-run-action@v3
name: Build Images
with:
image: valory/open-autonomy-user:latest
options: -v ${{ github.workspace }}:/work
shell: bash
run: |
echo "Building Docker Images"
cd /work
source env.sh || exit 1
echo "Building images for $AUTHOR for service $SERVICE"
autonomy init --reset --author $AUTHOR --ipfs --remote
autonomy fetch $AUTHOR/$SERVICE --service --local || exit 1
cd $SERVICE || exit 1
autonomy build-image || exit 1
autonomy build-image --version $VERSION || exit 1
- name: Docker login
run: |
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin
- name: Docker Push
run: |
source env.sh
echo "Pushing $DOCKER_USER/oar-$AGENT:$VERSION"
echo "Pushing $DOCKER_USER/oar-$AGENT:$DEFAULT_IMAGE_TAG"
docker push $DOCKER_USER/oar-$AGENT:$VERSION
docker push $DOCKER_USER/oar-$AGENT:$DEFAULT_IMAGE_TAG
52 changes: 51 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ packages/valory/contracts/multisend
packages/valory/contracts/service_registry
packages/valory/services/*
packages/valory/protocols/*
packages/valory/skills/*

!packages/valory/agents/optimus
!packages/valory/services/optimus
Expand All @@ -35,4 +34,55 @@ keys.json
ethereum_private_key.txt
__pycache__/
.env

.nix-venv
.certs
multisig_address
multisig_vault
*/keys.json
*private_key.txt*
packages/fetchai/
packages/open_aea/

packages/valory/skills/abstract_abci/
packages/valory/skills/abstract_round_abci/
packages/valory/skills/registration_abci/
packages/valory/skills/reset_pause_abci/
packages/valory/skills/transaction_settlement_abci/
packages/valory/skills/termination_abci/
packages/valory/skills/ipfs_package_downloader/
packages/valory/skills/market_data_fetcher_abci/
packages/valory/skills/portfolio_tracker_abci/
packages/valory/skills/strategy_evaluator_abci/
packages/valory/skills/trader_decision_maker_abci
packages/valory/customs/trend_following_strategy

packages/valory/protocols/*

.idea
**/__pycache__/
*.DS_Store

.mypy_cache
/.tox/

keys.json
leak_report

agent/
solana_trader_service/

./solana_trader/

packages/valory/skills/transaction_settlement_abci/

solana_trader/
!/packages/valory/agents/solana_trader/
!/packages/valory/services/solana_trader/

node_modules/
.env

packages/open_aea/protocols/signing
packages/eightballer/*
test_gas_costs.json
3 changes: 3 additions & 0 deletions .gitleaksignore
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ c022bdff65530d1dc6a037b3d173e3989a51daec:packages/valory/skills/reset_pause_abci
c022bdff65530d1dc6a037b3d173e3989a51daec:packages/valory/skills/strategy_evaluator_abci/skill.yaml:generic-api-key:101
c022bdff65530d1dc6a037b3d173e3989a51daec:packages/valory/skills/trader_decision_maker_abci/skill.yaml:generic-api-key:76
c022bdff65530d1dc6a037b3d173e3989a51daec:packages/valory/skills/transaction_settlement_abci/skill.yaml:generic-api-key:93
34591764415f2fbc959e41feb4b7aaef733285aa:packages/valory/services/optimus_pearl/service.yaml:generic-api-key:44
70f1bad61ecef39d2004e54b7ca396ebaaaa5531:packages/valory/contracts/staking_token/contract.yaml:generic-api-key:10
62bdc4f7ebebea4695e415915e773fd680baeb26:packages/valory/contracts/staking_token/contract.yaml:generic-api-key:10
9facfc7d521059db3121a88593230520c0108379:liquidityRiskAssesmentScript/uniswap_top1000_pool_liquidity_data.py:generic-api-key:5
9facfc7d521059db3121a88593230520c0108379:liquidityRiskAssesmentScript/uniswap_per_pool_liquidity_data.py:generic-api-key:117
Expand Down Expand Up @@ -311,6 +313,7 @@ cc5bde9d62ea96c13e43eb119f7f59075b040a69:packages/valory/contracts/staking_token
ef0373adb2f8798b63bb0c00d146fa4eaa70a579:packages/valory/contracts/staking_token/contract.yaml:generic-api-key:10
fe1e5cf86d167b698b3df9d600a4c26f0cc45bae:packages/valory/contracts/staking_token/contract.yaml:generic-api-key:10
f5eed62a1572bbea8452a5f50e1b65e16063c535:packages/valory/contracts/staking_token/contract.yaml:generic-api-key:10
a52f7509a88af2f6c1639af36fae9ab83fdeb6bd:packages/valory/contracts/staking_token/contract.yaml:generic-api-key:10
c379f8caf26cb073b97d4e32c4e0b59cedbe0316:packages/valory/contracts/staking_token/contract.yaml:generic-api-key:10
a52f7509a88af2f6c1639af36fae9ab83fdeb6bd:packages/valory/contracts/staking_token/contract.yaml:generic-api-key:10
eceac088cd3b7eec763cde770671a63b9486c246:packages/valory/contracts/staking_token/contract.yaml:generic-api-key:10
Expand Down
179 changes: 179 additions & 0 deletions Merge_Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
# Run Your Own Agent

This guide will help you set up and run your own agent, either **Optimus** or **BabyDegen**. Follow the steps below to get started.

---

## Table of Contents

1. [Get the Code](#1-get-the-code)
2. [Set Up the Virtual Environment](#2-set-up-the-virtual-environment)
3. [Synchronize Packages](#3-synchronize-packages)
4. [Prepare the Data](#4-prepare-the-data)
5. [Configure for Optimus](#5-configure-for-optimus)
6. [Configure for BabyDegen](#6-configure-for-babydegen)
7. [Run the Agent](#7-run-the-agent)

---

## 1. Get the Code

Clone the repository from GitHub:

```bash
git clone https://github.com/valory-xyz/optimus.git
```

---

## 2. Set Up the Virtual Environment

Navigate to the project directory and install the required dependencies using `poetry`:

```bash
cd optimus
poetry install
poetry shell
```

---

## 3. Synchronize Packages

Synchronize the necessary packages:

```bash
autonomy packages sync --update-packages
```

---

## 4. Prepare the Data

### Generate Wallet Keys

Create a `keys.json` file containing wallet addresses and private keys for four agents:

```bash
autonomy generate-key ethereum -n 1
```

### Create Ethereum Private Key File

Extract one of the private keys from `keys.json` and save it in a file named `ethereum_private_key.txt`. Ensure there's **no newline at the end of the file**.

---

## 5. Configure for Optimus

If you want to run the **Optimus** agent, follow these steps:

### a. Deploy Safe Contracts

Deploy [Safe](https://safe.global/) contracts on the following networks:

- Ethereum Mainnet
- Optimism
- Base

### b. Fund Your Safe and Agent Addresses

- **Safe Addresses**:
- Deposit **ETH** and **USDC** into your Safe address on **Ethereum Mainnet**.
- **Agent Addresses**:
- Deposit **ETH** into your agent addresses on all networks (Ethereum Mainnet, Optimism, Base) to cover gas fees.

### c. Obtain API Keys

- **Tenderly**:
- Access Key
- Account Slug
- Project Slug
- Get them from your [Tenderly Dashboard](https://dashboard.tenderly.co/) under **Settings**.
- **CoinGecko**:
- API Key
- Obtain it from your account's [Developer Dashboard](https://www.coingecko.com/account/dashboard).

### d. Create a `.env` File

Instead of exporting environment variables, create a `.env` file in your project directory and add the following configurations. Replace placeholder values with your actual data:

```dotenv
PYTHONWARNINGS="ignore"
ALL_PARTICIPANTS=["YOUR_AGENT_ADDRESS"]
SAFE_CONTRACT_ADDRESSES='{
"ethereum": "YOUR_SAFE_ADDRESS_ON_ETHEREUM",
"optimism": "YOUR_SAFE_ADDRESS_ON_OPTIMISM",
"base": "YOUR_SAFE_ADDRESS_ON_BASE"
}'
ETHEREUM_LEDGER_RPC=YOUR_ETHEREUM_RPC_URL
OPTIMISM_LEDGER_RPC=YOUR_OPTIMISM_RPC_URL
BASE_LEDGER_RPC=YOUR_BASE_RPC_URL
MODE_LEDGER_RPC=
SLIPPAGE_FOR_SWAP=0.09
TENDERLY_ACCESS_KEY=YOUR_TENDERLY_ACCESS_KEY
TENDERLY_ACCOUNT_SLUG=YOUR_TENDERLY_ACCOUNT_SLUG
TENDERLY_PROJECT_SLUG=YOUR_TENDERLY_PROJECT_SLUG
COINGECKO_API_KEY=YOUR_COINGECKO_API_KEY
ALLOWED_CHAINS=["optimism","base"]
```

---

## 6. Configure for BabyDegen

If you prefer to run the **BabyDegen** agent, follow these additional steps:

### a. Set the AGENT_TRANSITION Flag

Set the `AGENT_TRANSITION` flag to `true` in your `.env` file:

```dotenv
AGENT_TRANSITION=true
```

### b. Update Safe Address and Participants

Replace placeholders with your actual Safe address and agent address:

```dotenv
SAFE_ADDRESS="YOUR_SAFE_ADDRESS"
ALL_PARTICIPANTS=["YOUR_AGENT_ADDRESS"]
```

### c. Fund the Safe Account

Deposit the following tokens into your Safe account, depending on the network:

```python
LEDGER_TO_TOKEN_LIST = {
SupportedLedgers.ETHEREUM: [
"0x0001a500a6b18995b03f44bb040a5ffc28e45cb0", # Token A on Ethereum
"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", # USDC on Ethereum
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", # WETH on Ethereum
],
SupportedLedgers.OPTIMISM: [
"0x4200000000000000000000000000000000000006", # WETH on Optimism
"0x0b2c639c533813f4aa9d7837caf62653d097ff85", # Token B on Optimism
"0xda10009cbd5d07dd0cecc66161fc93d7c9000da1", # DAI on Optimism
],
SupportedLedgers.BASE: [
"0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca", # Token C on Base
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", # Token D on Base
],
}
```

### d. Fund the Agent Address

Ensure your agent address has enough native tokens to cover gas fees on your chosen network.

---

## 7. Run the Agent

After completing the setup for either **Optimus** or **BabyDegen**, run the agent using the provided script:

```bash
bash run_agent.sh
```
Loading
Loading