Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
8b434d7
feat(margin-sdk): scaffold the @uniswap/margin-sdk package
ccashwell Jul 23, 2026
738b3d7
feat(margin-sdk): add chains, addresses, struct mirrors, and verified…
ccashwell Jul 23, 2026
3310c4b
feat(margin-sdk): add account derivation, market helpers, and sizing …
ccashwell Jul 23, 2026
659f7c2
feat(margin-sdk): add entry-point encoders and the execute-plan builder
ccashwell Jul 23, 2026
d4afa03
feat(margin-sdk): add read layer, package exports, docs, and changeset
ccashwell Jul 23, 2026
bfd12c6
feat(margin-sdk): add end-to-end demo flows against the live mainnet …
ccashwell Jul 23, 2026
2525cb7
feat(margin-sdk): harden encoder and planner inputs
ccashwell Jul 24, 2026
c0b7bd6
test(margin-sdk): cover the read layer and fund-authorization encoders
ccashwell Jul 24, 2026
a9f2c48
fix(margin-sdk): make the published package load under native Node (C…
ccashwell Jul 24, 2026
0be65be
feat(margin-sdk): run the anvil-fork demo suite in CI behind FORK_URL
ccashwell Jul 24, 2026
205a650
feat(margin-sdk): add an ABI drift gate against the v4-periphery source
ccashwell Jul 24, 2026
7797ffd
chore(margin-sdk): keep the initial release a 0.0.x pre-release
ccashwell Jul 24, 2026
5f6fa69
fix(margin-sdk): tolerate per-block interest accrual in a demo assertion
ccashwell Jul 24, 2026
ea15606
feat(margin-sdk): replace hand-written ABIs with forge-generated bind…
ccashwell Jul 24, 2026
7d5d56d
feat(margin-sdk): exercise the browser target in the package check
ccashwell Jul 24, 2026
e3da418
ci(margin-sdk): verify the ABI bindings against the pinned v4-periphe…
ccashwell Jul 24, 2026
efc8670
feat(margin-sdk): add collateral withdrawal and the IMarginAccount es…
Ayoakala Aug 3, 2026
b2519f8
Merge branch 'main' into feat/margin-sdk
Ayoakala Aug 3, 2026
7f1e8d6
Merge branch 'main' into feat/margin-sdk
Ayoakala Aug 4, 2026
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
5 changes: 5 additions & 0 deletions .changeset/margin-sdk-initial-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@uniswap/margin-sdk': minor
---

Initial release of the margin trading SDK for the Uniswap v4 margin periphery (MarginRouter + Morpho Blue / Aave v3 / Aave v4 lending adapters): entry-point encoders and write descriptors (increase/decrease/close/addCollateral/execute/multicall/permit), offchain MarginAccount address derivation (Solady CWIA, verified against the live mainnet router), decimal-aware leverage/LTV/health sizing math, a validated `execute`-plan builder over the v4 routing + margin action set, venue-agnostic read descriptors, and the mainnet deployment address registry.
34 changes: 27 additions & 7 deletions bun.lock

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

16 changes: 16 additions & 0 deletions sdks/margin-sdk/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
extends: ['plugin:@typescript-eslint/recommended', 'plugin:import/typescript', 'prettier'],
plugins: ['@typescript-eslint', 'import'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
'import/order': ['error', { 'newlines-between': 'always', alphabetize: { order: 'asc' } }],
},
ignorePatterns: ['dist', 'node_modules'],
}
24 changes: 24 additions & 0 deletions sdks/margin-sdk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Dependencies
node_modules/

# Build output
dist/
build/

# Coverage
coverage/

# Cache
.cache/
.turbo/

# IDE
.idea/
.vscode/

# Logs
*.log
npm-debug.log*

# OS
.DS_Store
Loading
Loading