Skip to content

Commit f79e7d5

Browse files
authored
Merge branch 'main' into claude/asset-leasing-skill-audit-lqSbo
2 parents f93f93d + b192861 commit f79e7d5

92 files changed

Lines changed: 13037 additions & 979 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,4 @@ node_modules/
2222

2323
/target
2424
deploy
25-
.claude
26-
!.claude/SKILL.md
27-
!.claude/RUST.md
28-
!.claude/TYPESCRIPT.md
25+
.claude

Cargo.lock

Lines changed: 43 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ members = [
4848
"basics/transfer-sol/anchor/programs/*",
4949
"basics/transfer-sol/asm",
5050

51+
# defi
52+
"defi/vault-strategy/anchor/programs/vault-strategy",
53+
"defi/vault-strategy/anchor/programs/mock-swap-router",
54+
5155
# tokens
5256
"tokens/token-extensions/mint-close-authority/native/program",
5357
"tokens/token-extensions/non-transferable/native/program",

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ Directional token lending with token collateral, per-second lease fees, and Pyth
2929

3030
[⚓ Anchor](./defi/asset-leasing/anchor)
3131

32+
### Central Limit Order Book
33+
34+
Order-book exchange — users post limit bids and asks at chosen prices, tokens are locked in program vaults, and orders cross against the opposing side using price-time priority. Fees route to a dedicated fee vault, maker/taker proceeds land in unsettled balances, and funds are withdrawn via `settle_funds`. A minimal teaching example of the mechanics behind Openbook and Phoenix.
35+
36+
[⚓ Anchor](./defi/order-book/anchor)
37+
3238
### Escrow
3339

3440
Peer-to-peer OTC trade — one user deposits token A and specifies how much token B they want. A counterparty fulfills the offer and both sides receive their tokens atomically.
@@ -47,6 +53,12 @@ Read offchain price data [onchain](https://solana.com/docs/terminology#onchain)
4753

4854
[⚓ Anchor](./oracles/pyth/anchor) [💫 Quasar](./oracles/pyth/quasar)
4955

56+
### Vault Strategy
57+
58+
Manager-run investment vault — deposit USDC, manager allocates across a basket of assets (TSLAx, NVDAx), withdraw proportional in-kind assets. Demonstrates share minting, NAV-based pricing, management fee accrual, and CPI to a swap router.
59+
60+
[⚓ Anchor](./defi/vault-strategy/anchor)
61+
5062
## Basics
5163

5264
### Hello Solana

defi/order-book/anchor/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.anchor
2+
.DS_Store
3+
target
4+
**/*.rs.bk
5+
node_modules
6+
test-ledger
7+
.yarn

defi/order-book/anchor/Anchor.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[toolchain]
2+
# Pin Solana to the version used across the repo's Anchor 1.0 examples so the
3+
# bundled test validator and BPF toolchain stay in lock-step.
4+
solana_version = "3.1.8"
5+
6+
[features]
7+
resolution = true
8+
skip-lint = false
9+
10+
[programs.localnet]
11+
order_book = "C69UJ8irfmHq5ysyLek7FKApHR86FBeupiz4JnoyPzzx"
12+
13+
[provider]
14+
cluster = "Localnet"
15+
wallet = "~/.config/solana/id.json"
16+
17+
[scripts]
18+
# LiteSVM Rust tests live under `programs/order-book/tests/` and include the built
19+
# `.so` via `include_bytes!`, so a fresh `anchor build` must run first.
20+
test = "cargo test"

defi/order-book/anchor/Cargo.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[workspace]
2+
members = ["programs/*"]
3+
resolver = "2"
4+
5+
[profile.release]
6+
overflow-checks = true
7+
lto = "fat"
8+
codegen-units = 1
9+
10+
[profile.release.build-override]
11+
opt-level = 3
12+
incremental = false
13+
codegen-units = 1

0 commit comments

Comments
 (0)