# Developer Integration

Module Address: `0x9770fa9c725cbd97eb50b2be5f7416efdfd1f1554beb0750d4dae4c64e860da3`

To start deposit into Aries, you need to first `register_user`

```
/// Register the user and also create a default `Profile` with the given name.
/// We requires that a name is given instead of a default name such as "main" because it might be
/// possible for user to already have a `ResourceAccount` that collides with our default name.
public entry fun register_user(
    account: &signer,
    default_profile_name: vector<u8>
) 
```

```
/// Deposit funds into the Aries protocol, this can result in two scenarios:
///
/// 1. User has an existing `Coin0` loan: the amount will first used to repay the loan then the
///    remaining part contribute to the collateral.
///
/// 2. User doesn't have an existing loan: all the amount will be contributed to collateral.
///
/// When the amount is `u64::max`, we will repay all the debt without deposit to Aries. This is
/// so that we don't leave any dust when users try to repay all.
public entry fun deposit<Coin0>(
    account: &signer,
    profile_name: vector<u8>,
    amount: u64,
    repay_only: bool,
)
```

```
/// Withdraw fund into the Aries protocol, there are two scenarios:
///
/// 1. User have an existing `Coin0` deposit: the existing deposit will be withdrawn first, if
/// it is not enough and user `allow_borrow`, a loan will be taken out.
///
/// 2. User doesn't have an existing `Coin0` deposit: if user `allow_borrow`, a loan will be taken out.
///
/// When the amount is `u64::max`, we will repay all the deposited funds from Aries. This is so
/// that we don't leave any dust when users try to withdraw all.
public entry fun withdraw<Coin0>(
    account: &signer,
    profile_name: vector<u8>,
    amount: u64,
    allow_borrow: bool,
)
```


---

# 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.ariesmarkets.xyz/aries-markets/developer-integration.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.
