Move.

Допис

Діліться своїми знаннями.

acher.
Aug 26, 2025
Обговорення

Optimizing Shared Objects in DeFi Protocols

Shared objects are essential for liquidity pools and AMMs, but they often become hotspots. Have you found good ways to reduce contention? Do you use sharding, secondary owned objects, or off-chain batching to keep throughput high?

  • Move CLI
  • Move
  • Smart Contract
  • Move Bug
1
1
Поділитися
Коментарі
.

Відповіді

1
shamueely.
Aug 26 2025, 23:18

In Move-based DeFi protocols on Sui, you reduce contention on shared objects by minimizing direct writes to hotspots and structuring your design to allow parallel execution. One approach is sharding shared state into multiple smaller owned objects, so different transactions can interact with separate shards without conflicts. Another strategy is using secondary owned objects that track user-specific balances or positions, only aggregating to the main pool periodically. Off-chain batching can also help: you collect multiple operations off-chain and commit them in a single transaction to reduce the number of writes to the shared object. Move’s resource safety ensures you can’t accidentally duplicate assets during these optimizations, while Sui’s parallel execution handles non-conflicting transactions efficiently. These patterns help liquidity pools and AMMs scale without bottlenecks. You can read more here: Sui Shared Objects.

// Example: splitting a pool into shards
resource struct LiquidityShard has key {
    balances: table<address, u64>,
}

1
Коментарі
.

Ви знаєте відповідь?

Будь ласка, увійдіть та поділіться нею.

Move is an executable bytecode language used to implement custom transactions and smart contracts.

244Пости542Відповіді
Sui.X.Peera.

Зароби свою частку з 1000 Sui

Заробляй бали репутації та отримуй винагороди за допомогу в розвитку спільноти Sui.

Кампанія винагородВересень