# FathomStablecoinProxyActions

The `FathomStablecoinProxyActions` contract enables complex operations such as opening, managing, and interacting with positions (vaults) that hold collateral and issue stablecoins. It handles tasks like depositing collateral, drawing stablecoins against it, paying back debt, and unlocking collateral.

The address for this interface should be the address of the particular `ProxyWallet`.

#### Functions:

**Admin Functions:**

* **`whitelist(address _bookKeeper, address _usr)`**:
  * **Arguments**:
    * `_bookKeeper`: The address of the bookkeeper contract.
    * `_usr`: The address to be whitelisted.
* **`blacklist(address _bookKeeper, address _usr)`**:
  * **Arguments**:
    * `_bookKeeper`: The address of the bookkeeper contract.
    * `_usr`: The address to be blacklisted.

**Position Management Functions:**

* **`allowManagePosition(address _manager, uint256 _positionId, address _user, uint256 _ok)`**:
  * **Arguments**:
    * `_manager`: Address of the position management contract.
    * `_positionId`: Numeric ID of the position.
    * `_user`: Address of the user to be allowed or disallowed.
    * `_ok`: Permission flag (typically 0 or 1).
* **`allowMigratePosition(address _manager, address _user, uint256 _ok)`**:
  * **Arguments**:
    * `_manager`: Address of the position management contract.
    * `_user`: Address of the user whose migration permissions are being set.
    * `_ok`: Permission flag (typically 0 or 1).
* **`exportPosition(address _manager, uint256 _positionId, address _destination)`**:
  * **Arguments**:
    * `_manager`: Address of the position management contract.
    * `_positionId`: Numeric ID of the position.
    * `_destination`: Address where the position should be exported.
* **`importPosition(address _manager, address _source, uint256 _positionId)`**:
  * **Arguments**:
    * `_manager`: Address of the position management contract.
    * `_source`: Address from which the position is imported.
    * `_positionId`: Numeric ID of the position.
* **`movePosition(address _manager, uint256 _source, uint256 _destination)`**:
  * **Arguments**:
    * `_manager`: Address of the position management contract.
    * `_source`: Numeric ID of the source position.
    * `_destination`: Numeric ID of the destination position.

**Collateral and Stablecoin Management Functions:**

* **`safeLockXDC(address _manager, address _xdcAdapter, uint256 _positionId, address _owner, bytes calldata _data)`**:
  * **Arguments**:
    * `_manager`: Address of the manager contract.
    * `_xdcAdapter`: Address of the XDC adapter contract.
    * `_positionId`: Numeric ID of the position.
    * `_owner`: Address of the owner of the position.
    * `_data`: Additional data passed in call.
* **`draw(address _manager, address _stabilityFeeCollector, address _stablecoinAdapter, uint256 _positionId, uint256 _amount, bytes calldata _data)`**:
  * **Arguments**:
    * `_manager`: Address of the manager contract.
    * `_stabilityFeeCollector`: Address of the stability fee collector.
    * `_stablecoinAdapter`: Address of the stablecoin adapter.
    * `_positionId`: Numeric ID of the position.
    * `_amount`: Amount of stablecoins to draw.
    * `_data`: Additional data passed in call.

#### Events:

* **`LogBorrowedAmount(address _positionAddress, uint256 _FXDBorrowAmount)`**:
  * **Arguments**:
    * `_positionAddress`: Address of the position from which stablecoins were borrowed.
    * `_FXDBorrowAmount`: Amount of stablecoins borrowed.
* **`LogPaidAmount(address _positionAddress, uint256 _FXDPaidAmount)`**:
  * **Arguments**:
    * `_positionAddress`: Address of the position to which stablecoins were repaid.
    * `_FXDPaidAmount`: Amount of stablecoins repaid.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fathom.fi/fxd-stablecoin/interfaces/proxywallet/fathomstablecoinproxyactions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
