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

More examples #2

Open
wants to merge 6 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
36 changes: 36 additions & 0 deletions .github/workflows/ci-pr-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CPI example

on:
pull_request:
branches:
- main

jobs:
program_changed_files:
runs-on: ubuntu-20.04
outputs:
program: ${{steps.changed-files-specific.outputs.any_changed}}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get specific changed files
id: changed-files-specific
uses: tj-actions/changed-files@v18.6
with:
files: |
programs/cpi-example

cpi_example_test:
runs-on: ubuntu-20.04
needs: program_changed_files
if: needs.program_changed_files.outputs.program == 'true'
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.76
override: true
- uses: Swatinem/rust-cache@v2
- run: cargo test -- --nocapture
shell: bash
32 changes: 29 additions & 3 deletions Cargo.lock

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

5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Meteora-CPI-examples

The repository containing examples for CPI (Cross-Program Invocation) to swap at [DLMM](https://github.com/meteoraAg/dlmm-sdk) and [Dynamic AMM](https://github.com/mercurial-finance/mercurial-dynamic-amm-sdk) programs.
The repository containing examples for CPI (Cross-Program Invocation) to [DLMM](https://github.com/meteoraAg/dlmm-sdk) and [Dynamic AMM](https://github.com/mercurial-finance/mercurial-dynamic-amm-sdk) programs.

Disclaimer: This repository only serves as examples and is not intended for production use.

Expand All @@ -18,6 +18,9 @@ Disclaimer: This repository only serves as examples and is not intended for prod
- [CPI to Dynamic AMM initialize pool example](programs/cpi-example/src/instructions/dynamic_amm_cpi/initialize_customizable_permissionless_pool.rs)
- [CPI to Dynamic AMM initialize pool with config example](programs/cpi-example/src/instructions/dynamic_amm_cpi/initialize_permissionless_pool_with_config.rs)

- [CPI to Dynamic AMM lock liquidity example](programs/cpi-example/src/instructions/dynamic_amm_cpi/lock_liquidity.rs)
- [CPI to Dynamic AMM claim fee example](programs/cpi-example/src/instructions/dynamic_amm_cpi/claim_fee.rs)

- [CPI to M3m3 initialize vault example](programs/cpi-example/src/instructions/m3m3_cpi/initialize_vault.rs)

- [Tests](programs/cpi-example/tests/)
Expand Down
9 changes: 6 additions & 3 deletions programs/cpi-example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,20 @@ dlmm = { git = "https://github.com/MeteoraAg/dlmm-sdk/", package = "lb_clmm", re
] }
dynamic-amm = { git = "https://github.com/mercurial-finance/mercurial-dynamic-amm-sdk", features = [
"cpi",
], rev = "ae46f2a44edbd8231467effd530c1eeecc231a1b" }
m3m3 = { git = "https://github.com/meteoraAg/stake-for-fee-sdk", package = "stake_for_fee_interface", rev = "796ed09b500a92c36927915d22cce28ef78b2a8d" }
], rev = "726c425a439d1458a4c82abe5e8ae927aede9089", package = "dynamic-amm" }
dynamic-amm-common = { git = "https://github.com/mercurial-finance/mercurial-dynamic-amm-sdk", rev = "726c425a439d1458a4c82abe5e8ae927aede9089", package = "common" }
m3m3 = { git = "https://github.com/meteoraAg/stake-for-fee-sdk", package = "stake_for_fee_interface", rev = "60b1d2e8e3629e1c99377843fb377665247e82b1" }
m3m3-common = { git = "https://github.com/meteoraAg/stake-for-fee-sdk", rev = "60b1d2e8e3629e1c99377843fb377665247e82b1", package = "common" }

[dev-dependencies]
solana-program-test = "1.16.0"
solana-sdk = "1.16.0"
dynamic-vault = { git = "https://github.com/mercurial-finance/mercurial-dynamic-amm-sdk", features = [
"cpi",
], rev = "ae46f2a44edbd8231467effd530c1eeecc231a1b" }
], rev = "726c425a439d1458a4c82abe5e8ae927aede9089" }
bytemuck = { version = "1.13.1", features = ["derive", "min_const_generics"] }
assert_matches = "1.5.0"
solana-client = "1.16.0"
solana-account-decoder = "1.16.0"
bincode = "1.3.3"
spl-associated-token-account = "2.2.0"
Loading
Loading