Skip to content

Commit 361435e

Browse files
Merge pull request #22 from olujimiAdebakin/feature/AFPU_MODEL
Executive Summary This PR fundamentally redesigns the funding rate mechanism by implementing the Accumulated Funding Per Unit (AFPU) model. This architectural change eliminates per-trader iteration, reducing gas costs from O(n) to O(1) and enabling the protocol to scale from hundreds to millions of active positions. Key Metrics: Gas Reduction: 99% reduction at scale (from ~10M to ~50K gas for 1,000 traders) Scalability: Removes theoretical limit on concurrent positions Precision: Maintains per-second funding accuracy Standard: Adopts battle-tested model used by dYdX, GMX, and other leading protocols
2 parents fd34343 + 321b8f8 commit 361435e

23 files changed

Lines changed: 9056 additions & 1398 deletions

.gitattributes

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Language overrides
2+
*.sol linguist-language=Solidity
3+
*.js linguist-language=JavaScript
4+
*.ts linguist-language=TypeScript
5+
*.md linguist-language=Markdown
6+
7+
# Ignore vendor/third-party code from detection
8+
vendor/** linguist-vendored
9+
node_modules/** linguist-vendored
10+
test/** linguist-documentation

0 commit comments

Comments
 (0)