> For the complete documentation index, see [llms.txt](https://docs.equiteez.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.equiteez.com/platform/secondary-markets/technical-overview-of-the-pmm.md).

# Technical Overview of the PMM

Technical Overview of Entry Points and Contract Functions

#### A) SuperAdmin Entry Points

#### `%setSuperAdmin`

`Parameters: newSuperAdminAddress : address`

Entrypoint that can only be called by the superAdmin contract to set a new superAdmin contract.

#### `%claimSuperAdmin`

`Parameters: none`

Entrypoint that can only be called by a new superAdmin contract that had previously been set.

#### B) Admin Entrypoints

#### `%setGuidePrice`

`Parameters: setGuidePriceAction : setGuidePriceActionType`

`type setGuidePriceActionType is [@layout:comb] record [`

&#x20;   `configType : string;`

&#x20;   `natOption : option(nat);`

&#x20;   `stringOption : option(string);`

`]`

<br>

`// configType:`&#x20;

`//   "priceModel"            -> fixed or dynamic`

`//   "appraisalPrice"        -> newAppraisalPrice`&#x20;

`//   "fixedPricePercent"     -> newFixedPricePercent`

`//   "orderbookPricePercent" -> newOrderbookPricePercent`

Admin can set the guide price config (price model, appraisal price, fixed price percent, and orderbook price percent.

For the fixed price model, only the appraisal price is used.

For the dynamic price model, appraisal price, fixed price percent, and orderbook price percent is used. The final guide price used will be determined from the last matched price from the corresponding RWA Orderbook and the price configurations.

`const lastMatchedPrice : nat = getOrderbookLastMatchedPrice(s);`

<br>

`// adjust for decimals`

`const adjustedLastMatchedPrice : nat = (lastMatchedPrice * const_REBASE_QUOTE_TOKEN_DECIMALS);`

`guidePrice := mul(appraisalPrice, fixedPricePercent) + mul(orderbookPricePercent, adjustedLastMatchedPrice);`

Decimals used for percentages: 18

#### `%updateGuidePrice`

`Parameters: _ : unit`

Admin can call this entrypoint to update the guide price regularly from changes in the RWA Orderbook when the last matched price changes.

#### `%updateMetadata`

`Parameters: updateMetadataParams : updateMetadataType`

`type updateMetadataType is [@layout:comb] record [`

&#x20;   `metadataKey           : string;`

&#x20;   `metadataHash          : bytes;`&#x20;

`]`

Admin can update the contract metadata

#### `%updateConfig`

`Parameters: updateConfigParams : dodoUpdateConfigParamsType`

`type dodoUpdateConfigParamsType is [@layout:comb] record [`

&#x20;   `configName     : string;`

&#x20;   `newConfigValue : nat;`

`];`

Admin can update the configurations for LP Fee, maintainer Fee, and fee decimals.

#### C) Pause / Break Glass Entry points

#### `%togglePauseEntrypoint`

`Parameters: togglePauseParams : dodoTogglePauseEntrypointType`

`type dodoTogglePauseEntrypoinSingleType is [@layout:comb] record [`

&#x20;   `targetEntrypoint  : string;`

&#x20;   `pauseBool         : bool;`

`];`

`type dodoTogglePauseEntrypointType is list(dodoTogglePauseEntrypoinSingleType)`

<br>

`// valid target entrypoints:`

`// buyBaseToken, sellBaseToken, withdrawQuoteToken, withdrawBaseToken,`&#x20;

`// withdrawAllQuoteTokens, withdrawAllBaseTokens, depositQuoteToken,`&#x20;

`// depositBaseToken`

Admin can pause a given entrypoint on the DodoMav contract

#### D) Dodo Dex Entry Points

#### `%buyBaseToken`

`Parameters: tradeBaseTokenAction : tradeBaseTokenActionType`

`type tradeBaseTokenActionType is [@layout:comb] record [`

&#x20;   `amount : nat;`

&#x20;   `minMaxQuote : nat;`&#x20;

`]`

Users can buy base tokens (RWA Tokens). Max Pay Quote is used here to determine the maximum amount of Quote Tokens (e.g. USDT) that the buyer wants to use to purchase the given amount of Base Tokens (RWA Tokens)

#### `%sellBaseToken`

`Parameters: tradeBaseTokenAction : tradeBaseTokenActionType`

`type tradeBaseTokenActionType is [@layout:comb] record [`

&#x20;   `amount : nat;`

&#x20;   `minMaxQuote : nat;`&#x20;

`]`

Users can sell base tokens (RWA Tokens).

Min receive Quote is used here to determine the minimum amount of Quote Tokens (e.g. USDT) that the seller wants to receive from selling the given amount of Base Tokens (RWA Tokens)

#### `%withdrawQuoteToken`

`Parameters: withdrawAmount : nat`

User can withdraw Quote Tokens (e.g. USDT) from the DodoMav liquidity pool. Users may incur a withdrawalQuotePenalty if the rStatus is BELOW\_ONE to balance the liquidity based on the expected target.

#### `%withdrawBaseToken`

`Parameters: withdrawAmount : nat`

User can withdraw Base Tokens (RWA Tokens) from the DodoMav liquidity pool. Users may incur a withdrawal Base Penalty if the rStatus is ABOVE\_ONE to balance the liquidity based on the expected target.

#### `%withdrawAllQuoteTokens`

`Parameters: _ : unit`

Users can withdraw all their Quote Tokens (e.g. USDT) from the DodoMav liquidity pool. Users may incur a withdrawalQuotePenalty if the rStatus is BELOW\_ONE to balance the liquidity based on the expected target.

#### `%withdrawAllBaseTokens`

`Parameters: _ : unit`

User can withdraw all his Base Tokens (RWA Token) from the DodoMav liquidity pool. Users may incur a withdrawal Base Penalty if the rStatus is ABOVE\_ONE to balance the liquidity based on the expected target.

#### `%depositQuoteToken`

`Parameters: depositAmount : nat`

User can deposit Quote Tokens (e.g. USDT) to the DodoMav liquidity pool.

#### `%depositBaseToken`

`Parameters: depositAmount : nat`

User can deposit Base Tokens (RWA Tokens) to the DodoMav liquidity pool.

#### E) Lambda Entry Points

#### `%setLambda`

`Parameters: setLambdaParams : setLambdaType`

Admin to set lambdas for contract

<br>
