Skip to content

Commit

Permalink
Merge branch 'main' into feat/switchboard-feed-simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
gesarki authored Jan 29, 2025
2 parents 7233d2d + 76e7400 commit f66ebc2
Show file tree
Hide file tree
Showing 16 changed files with 1,230 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ JUPITER_FEE_BPS=
FLASH_PRIVILEGE= referral | nft | none
FLEXLEND_API_KEY=
HELIUS_API_KEY=
ETHEREUM_PRIVATE_KEY=
ALLORA_API_KEY=
ALLORA_API_URL=
ALLORA_NETWORK= testnet | mainnet
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,21 @@ const value = await agent.simulateSwitchboardFeed(
"9wcBMATS8bGLQ2UcRuYjsRAD7TPqB1CMhqfueBx78Uj2", // TRUMP/USD
"http://crossbar.switchboard.xyz");;
console.log("Simulation resulted in the following value:", value);

### Cross-Chain Swap

```typescript
import { PublicKey } from "@solana/web3.js";
const signature = await agent.swap(
amount: "10",
fromChain: "bsc",
fromToken: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
toChain: "solana",
toToken: "0x0000000000000000000000000000000000000000",
dstAddr: "0xc2d3024d64f27d85e05c40056674Fd18772dd922",
);
```

## Examples
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"@langchain/openai": "^0.3.16",
"@lightprotocol/compressed-token": "^0.17.1",
"@lightprotocol/stateless.js": "^0.17.1",
"@mayanfinance/swap-sdk": "^9.8.0",
"@mercurial-finance/dynamic-amm-sdk": "^1.1.19",
"@metaplex-foundation/digital-asset-standard-api": "^1.0.4",
"@metaplex-foundation/mpl-core": "^1.1.1",
Expand All @@ -55,6 +56,7 @@
"@meteora-ag/alpha-vault": "^1.1.7",
"@meteora-ag/dlmm": "^1.3.0",
"@onsol/tldparser": "^0.6.7",
"@openzeppelin/contracts": "^5.2.0",
"@orca-so/common-sdk": "0.6.4",
"@orca-so/whirlpools-sdk": "^0.13.12",
"@pythnetwork/hermes-client": "^1.3.0",
Expand All @@ -72,6 +74,7 @@
"chai": "^5.1.2",
"decimal.js": "^10.4.3",
"dotenv": "^16.4.7",
"ethers": "^6.13.5",
"flash-sdk": "^2.24.3",
"form-data": "^4.0.1",
"langchain": "^0.3.8",
Expand Down
100 changes: 100 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ import getAssetsByAuthorityAction from "./metaplex/getAssetsByAuthority";
import getAssetsByCreatorAction from "./metaplex/getAssetsByCreator";
import getInfoAction from "./agent/get_info";
import switchboardSimulateFeedAction from "./switchboard/simulate_feed";
import swapAction from "./mayan/swap";
import getPriceInferenceAction from "./allora/getPriceInference";
import getAllTopicsAction from "./allora/getAllTopics";
import getInferenceByTopicIdAction from "./allora/getInferenceByTopicId";
Expand All @@ -85,6 +86,7 @@ import createOrcaCLMMAction from "./orca/createOrcaCLMM";
import fetchOrcaPositionsAction from "./orca/fetchOrcaPositions";
import openOrcaCenteredPositionWithLiquidityAction from "./orca/openOrcaCenteredPositionWithLiquidity";
import openOrcaSingleSidedPositionAction from "./orca/openOrcaSingleSidedPosition";

export const ACTIONS = {
GET_INFO_ACTION: getInfoAction,
WALLET_ADDRESS_ACTION: getWalletAddressAction,
Expand Down Expand Up @@ -173,6 +175,7 @@ export const ACTIONS = {
GET_ASSETS_BY_AUTHORITY_ACTION: getAssetsByAuthorityAction,
SWITCHBOARD_FEED_ACTION: switchboardSimulateFeedAction,
GET_ASSETS_BY_CREATOR_ACTION: getAssetsByCreatorAction,
SWAP_ACTION: swapAction,
GET_PRICE_INFERENCE_ACTION: getPriceInferenceAction,
GET_ALL_TOPICS_ACTION: getAllTopicsAction,
GET_INFERENCE_BY_TOPIC_ID_ACTION: getInferenceByTopicIdAction,
Expand Down
Loading

0 comments on commit f66ebc2

Please sign in to comment.