> For the complete documentation index, see [llms.txt](https://docs.anchorprotocol.com/anchor-2/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.anchorprotocol.com/anchor-2/xanchor/xanchor-terra-side-contracts/address-proxy.md).

# Address Proxy

The Address Proxy contract represents a foreign wallet address on the Terra chain. The xAnchor core creates an Address Proxy creates for every foreign address that interacts with Anchor. This will forward all actions received from xAnchor to Anchor.

### Config

| Key                | Type      | Description                                                             |
| ------------------ | --------- | ----------------------------------------------------------------------- |
| `core_address`     | `String`  | Address of xAnchor Core Contract                                        |
| `market_address`   | `String`  | Address of Anchor Market Contract                                       |
| `overseer_address` | `String`  | Address of Anchor Overseer Contract                                     |
| `aterra_address`   | `String`  | Address of aUST Token                                                   |
| `anc_token`        | `String`  | Address of ANC Token                                                    |
| `anc_gov_address`  | `String`  | Address of Anchor Governance Contract                                   |
| `chain_id`         | `u16`     | Chain ID of the foreign wallet that this address proxy instance maps to |
| `address`          | `Vec<u8>` | Address of the foreign wallet that this address proxy instance maps to. |

### InstantiateMsg

```rust
pub struct InstantiateMsg {
    pub market_address: String,
    pub overseer_address: String,
    pub anc_gov_address: String,
    pub aterra_address: String,
    pub anc_token: String,
    pub core_address: String,
    pub chain_id: u16,
    pub address: Vec<u8>,
}
```

### ExecuteMsg

```rust
pub enum ExecuteMsg {
    Receive(Cw20ReceiveMsg),

    /// depositors
    DepositStable {},
    /// borrowers
    RepayStable {},

    /// unlock + withdraw collateral (withdraw and unlock on anchor are combined into a single op)
    UnlockCollateral {
        asset: Asset,
    },
    BorrowStable {
        borrow_amount: Uint256,
    },
    ClaimRewards {},
    WithdrawAsset {
        asset_info: AssetInfo,
    },

    /// Internal Only
    ForwardDifference {
        asset_info: AssetInfo,
        to: String,
    },

    /// Governance
    StakeVotingTokens {
        stake_amount: Uint256,
    },
    WithdrawVotingTokens {
        unstake_amount: Uint256,
    },
    CastVote {
        poll_id: u64,
        vote: VoteOption,
        amount: Uint128,
    },
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.anchorprotocol.com/anchor-2/xanchor/xanchor-terra-side-contracts/address-proxy.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
