마진 풀
MarginPool은 특정 asset에 대한 liquidity를 관리하는 shared object로, lender가 asset을 공급하고 margin trader가 이를 차입할 수 있게 한다. 각 margin pool은 supply와 borrow position을 추적하고, 시간이 지남에 따라 interest를 누적하며, 시스템 건전성을 유지하기 위해 risk parameter를 강제한다.
margin pool은 supplier가 전체 supply에서 자신의 비중을 나타내는 share를 받는 shares 기반 accounting 시스템을 사용한다. interest는 연속적으로 누적되어 시간이 지남에 따라 이러한 share의 가치를 증가시킨다. borrower는 자신이 사용하는 특정 DeepBook trading pool이 활성화된 pool에서만 차입할 수 있다.
API
다음은 MarginPool이 노출하는 서로 다른 public 함수이다.
Mint a SupplierCap
margin pool에서 supply와 withdraw에 사용할 수 있는 새 SupplierCap을 생성한다. 하나의 SupplierCap은 여러 margin pool에서 사용할 수 있다.
packages/deepbook_margin/sources/margin_pool.move. You probably need to run `pnpm prebuild` and restart the site.Supply liquidity
interest를 얻기 위해 margin pool에 asset을 공급한다. 이 작업 이후 supplier가 소유한 총 supply share를 반환한다.
packages/deepbook_margin/sources/margin_pool.move. You probably need to run `pnpm prebuild` and restart the site.Withdraw liquidity
margin pool에서 공급된 asset을 인출한다. 정확한 amount를 지정하거나 사용 가능한 모든 share를 인출할 수 있다.
packages/deepbook_margin/sources/margin_pool.move. You probably need to run `pnpm prebuild` and restart the site.Read endpoints
packages/deepbook_margin/sources/margin_pool.move. You probably need to run `pnpm prebuild` and restart the site.Events
MarginPoolCreated
새 margin pool이 생성될 때 발생한다.
packages/deepbook_margin/sources/margin_pool.move. You probably need to run `pnpm prebuild` and restart the site.DeepbookPoolUpdated
DeepBook pool이 lending에 대해 활성화 또는 비활성화될 때 발생한다.
packages/deepbook_margin/sources/margin_pool.move. You probably need to run `pnpm prebuild` and restart the site.InterestParamsUpdated
interest rate parameter가 업데이트될 때 발생한다.
packages/deepbook_margin/sources/margin_pool.move. You probably need to run `pnpm prebuild` and restart the site.MarginPoolConfigUpdated
margin pool 구성이 업데이트될 때 발생한다.
packages/deepbook_margin/sources/margin_pool.move. You probably need to run `pnpm prebuild` and restart the site.SupplierCapMinted
새 supplier cap이 mint될 때 발생한다.
packages/deepbook_margin/sources/margin_pool.move. You probably need to run `pnpm prebuild` and restart the site.AssetSupplied
asset이 margin pool에 supply될 때 발생한다.
packages/deepbook_margin/sources/margin_pool.move. You probably need to run `pnpm prebuild` and restart the site.AssetWithdrawn
asset이 margin pool에서 인출될 때 발생한다.
packages/deepbook_margin/sources/margin_pool.move. You probably need to run `pnpm prebuild` and restart the site.MaintainerFeesWithdrawn
maintainer fee가 인출될 때 발생한다.
packages/deepbook_margin/sources/margin_pool.move. You probably need to run `pnpm prebuild` and restart the site.ProtocolFeesWithdrawn
protocol fee가 인출될 때 발생한다.
packages/deepbook_margin/sources/margin_pool.move. You probably need to run `pnpm prebuild` and restart the site.ProtocolFeesIncreased
interest payment로부터 protocol fee가 누적될 때 발생한다.
packages/deepbook_margin/sources/margin_pool/protocol_fees.move. You probably need to run `pnpm prebuild` and restart the site.