caelum0x 23aa97161c Complete Workshop 2 custom adaptor: all 9 TODOs filled, Anchor test added
Completed custom_adaptor_completed/src/lib.rs (from workshop template):
- TODO_1: Initialize remaining accounts (market, mints, ATAs, programs)
- TODO_2: CPI initialize_market_and_user
- TODO_3: Deposit remaining accounts
- TODO_4: CPI deposit_market + account reload
- TODO_5: Calculate holdings (cToken → liquidity conversion)
- TODO_6: Withdraw remaining accounts (same as deposit)
- TODO_7: Convert liquidity amount → cToken amount for redemption
- TODO_8: CPI withdraw_market + account reload
- TODO_9: Calculate updated holdings

Added tests/custom-adaptor.test.ts:
- Initialize test with correct remaining account ordering
- Deposit test with cToken receipt verification
- Withdraw test with liquidity token recovery
- Account ordering validation test (workshop key lesson)

Now have 6 Anchor programs in programs/:
- driftbear_custom_adaptor (deployed devnet)
- custom_adaptor_completed (workshop 2 solution)
- ctoken_market_program (deployed devnet)
- mock_ctoken_market (deployed devnet)
- drift_vaults (reference)
- raydium_clmm (reference)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 17:41:10 +03:00

23 lines
576 B
TOML

[package]
name = "custom-adaptor-completed"
version = "0.1.0"
description = "Completed custom adaptor for Ranger Earn vaults (Workshop 2)"
edition = "2021"
[lib]
crate-type = ["cdylib", "lib"]
name = "custom_adaptor_program"
[features]
default = []
cpi = ["no-entrypoint"]
no-entrypoint = []
no-idl = []
no-log-ix-name = []
idl-build = ["anchor-lang/idl-build", "anchor-spl/idl-build"]
[dependencies]
anchor-lang = { version = "0.31.1", features = ["init-if-needed"] }
anchor-spl = "0.31.1"
ctoken-market-program = { path = "../ctoken_market_program", features = ["cpi"] }