# supply

## Overview

<img src="https://1829638638-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0k7YXwFGMFZcsyqkM4q1%2Fuploads%2FRkTUXtC8ZSqHB3pCOIiZ%2Ffile.excalidraw.svg?alt=media&#x26;token=2846a983-1bcb-4be6-bc66-575b6e9a50d3" alt="" class="gitbook-drawing">

* `executeSupply` contains the core logics of the supply function

## executeSupply

<figure><img src="https://1829638638-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0k7YXwFGMFZcsyqkM4q1%2Fuploads%2FZhrkYQvAbRBDc4SgWmnW%2Fimage.png?alt=media&#x26;token=22a6e5f6-d7c7-4fbf-b44a-4c3d3d73f457" alt=""><figcaption></figcaption></figure>

### Execution flow

* [ ] <mark style="color:orange;">cache</mark>
* [ ] <mark style="color:orange;">updateState</mark>
* [ ] validateSupply
* [ ] <mark style="color:orange;">updateInterestRates</mark>
* [ ] transfer & mint
* [ ] If isFirstSupply (setup `userConfig`, if first supply & asset can be used as collateral)

We will breakdown and examine the unique sections of logics within **supply**. Code delineated in orange are common functions and can be explored in that [section](common-functions).

## Visual Aid

{% embed url="https://link.excalidraw.com/readonly/4hKXoUS5ExJDQxut21rn?darkMode=true" %}
[https://link.excalidraw.com/readonly/4hKXoUS5ExJDQxut21rn?darkMode=true](https://link.excalidraw.com/readonly/4hKXoUS5ExJDQxut21rn?darkMode=true)
{% endembed %}
