Depositing
Any PartyB can deposit pledge collateral in any ERC20 token. Amounts are in the token's native decimals.
pledgeFacet.depositPledge(tokenAddress, amount);
Withdrawing
Withdrawal follows a two-step request-approval flow to prevent rug-pulls:
// 1. PartyB requests withdrawal
pledgeFacet.requestPledgeWithdraw(tokenAddress, amount, recipientAddress);
// 2. Admin approves withdrawal (requires PARTY_B_MANAGER_ROLE)
pledgeFacet.acceptPledgeWithdraw(partyBAddress, amount, tokenAddress);
// Or PartyB can cancel their own request
pledgeFacet.cancelPledgeWithdraw();
Slashing
If a PartyB misbehaves, an admin with PARTY_B_MANAGER_ROLE can slash their pledge collateral and redirect it to
any recipient:
pledgeFacet.slashPledge(partyBAddress, tokenAddress, penaltyAmount, recipientAddress);
Relation with ADL
Pledge collateral is primarily used as a penalty mechanism for ADL (Auto-Deleveraging) usage. Before enabling ADL for a PartyB, they should have deposited sufficient pledge collateral. If ADL is misused — e.g., closing positions at prices that unfairly harm PartyA — the pledge can be slashed. This ensures PartyBs are incentivized to use ADL fairly.