Giter VIP home page Giter VIP logo

aws-serverless-financial-functions's Introduction

AWS Serverless Financial Functions

This is a collection of serverless apps that wrap common financial functions in AWS Lambda functions. The financial functions' names and interfaces are identical to the corresponding functions in Microsoft Excel for convenience.

In addition to the individual function apps, an API app is included, which stands up an Amazon API Gateway REST endpoint surfacing all of the functions.

Financial Functions

  1. FV - Returns the future value of an investment based on periodic, constant payments and a constant interest rate.
  2. FVSCHEDULE - Returns the future value of an initial principal after applying a series of compound interest rates.
  3. PV - Returns the present value of an investment: the total amount that a series of future payments is worth now.
  4. NPV - Returns the net present value of an investment based on a discount rate and a series of future payments (negative values) and income (positive values).
  5. XNPV - Returns the net present value for a schedule of cash flows.
  6. PMT - Calculates the payment for a loan based on constant payments and a constant interest rate.
  7. PPMT - Returns the payment on the principal for a given investment based on periodic, constant payments and a constant interest rate.
  8. IRR - Returns the internal rate of return for a series of cash flows.
  9. MIRR - Returns the internal rate of return for a series of periodic cash flows, considering both cost of investment and interest on reinvestment of cash.
  10. XIRR - Returns the internal rate of return for a schedule of cash flows.
  11. NPER - Returns the number of periods for an investment based on periodic, constant payments and a constant interest rate.
  12. RATE - Returns the interest rate per period of a loan or an investment. For example, use 6%/4 for quarterly payments at 6% APR.
  13. EFFECT - Returns the effective annual interest rate.
  14. NOMINAL - Returns the annual nominal interest rate.
  15. SLN - Returns the straight-line depreciation of an asset for one period.

Installation Steps

  1. Create an AWS account if you do not already have one and login
  2. Search for the desired financial function application in the AWS Serverless Application Repository
  3. Click on the desired financial function application and click "Deploy"

License Summary

This sample code is made available under a modified MIT license. See the LICENSE file.

aws-serverless-financial-functions's People

Contributors

jlhood avatar salmanap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-serverless-financial-functions's Issues

RuntimeError: Failed to converge after 50 iterations, value is 524086168.635

I am trying to calculate XIRR and I get this error after calling the API.
I am providing my call arguments:

{
"values": [2109375, 2500000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000, -60000000],
"dates": ["2022-07-31", "2022-08-31", "2022-09-30", "2022-10-31", "2022-11-30", "2022-12-31", "2023-01-31", "2023-02-28", "2023-03-31", "2023-04-30", "2023-05-31", "2023-06-30", "2023-07-31", "2023-08-31", "2023-09-30", "2023-10-31", "2023-11-30", "2023-12-31", "2024-01-31", "2024-02-29", "2024-03-31", "2024-04-30", "2024-05-31", "2024-06-30", "2024-07-31", "2024-08-31", "2024-09-30", "2024-10-31", "2024-11-30", "2024-12-31", "2025-01-31", "2025-02-28", "2025-03-31", "2025-04-30", "2025-05-31", "2025-06-30"]
}

Failed validating 'required' in schema error

Hi,

I am trying out the XIRR serverless function and it constantly returns this error for me.

**Exception: 'values' is a required property.

Failed validating 'required' in schema:**
{'additionalProperties': False,
'properties': {'dates': {'items': {'minItems': 2,
'pattern': '^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$',
'type': 'string'},
'type': 'array'},
'guess': {'type': 'number'},
'values': {'items': {'type': 'number'},
'minItems': 2,
'type': 'array'}},
'required': ['values', 'dates'],
'type': 'object'}

On instance:
{'body': '{"values":[-100,10,20,45],"dates":["2016-01-01","2016-4-1","2016-10-1","2017-2-1"]}',
'headers': {'CloudFront-Forwarded-Proto': 'https',
'CloudFront-Is-Desktop-Viewer': 'true',
'CloudFront-Is-Mobile-Viewer': 'false',
'CloudFront-Is-SmartTV-Viewer': 'false',
'CloudFront-Is-Tablet-Viewer': 'false',
'CloudFront-Viewer-Country': 'IN',
'Content-Type': 'application/json; charset=utf-8',
'User-Agent': 'Paw/3.1.7 (Macintosh; OS X/10.13.6) '
}

Code below:
curl -X "POST" "{{URL}}"
-H 'X-Api-Key: {{API_KEY}}'
-H 'Content-Type: application/json; charset=utf-8'
-d $'{
"dates": [
"2016-01-01",
"2016-4-1",
"2016-10-1",
"2017-2-1"
],
"values": [
-100,
10,
20,
45
]
}'

What am I doing wrong here?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.